:root {
    /* --- Modern Palette (Slate & Indigo) --- */
    --primary-bg: #f8fafc;       /* Slate 50 */
    --surface-bg: #ffffff;       /* White */
    --surface-hover: #f1f5f9;    /* Slate 100 */
    
    --brand-color: #4f46e5;      /* Indigo 600 */
    --brand-hover: #4338ca;      /* Indigo 700 */
    --brand-light: #e0e7ff;      /* Indigo 100 */
    --brand-text: #3730a3;       /* Indigo 800 */

    --text-main: #1e293b;        /* Slate 800 */
    --text-muted: #64748b;       /* Slate 500 */
    --border-color: #e2e8f0;     /* Slate 200 */

    --success-bg: #dcfce7;
    --success-text: #166534;
    --danger-bg: #fee2e2;
    --danger-text: #991b1b;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;

    /* --- Effects --- */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Global Reset & Typography --- */
body {
    background-color: var(--primary-bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: #0f172a; /* Slate 900 */
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.75em;
}

a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--brand-hover);
}

/* --- Navbar (Glassmorphism) --- */
.navbar {
    background-color: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 800;
    color: var(--brand-color) !important;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
}

.nav-link {
    color: var(--text-main) !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--brand-color) !important;
}

/* --- Cards (Premium) --- */
.card, .crud-card, .infra-card, .info-card, .dashboard-card, .auth-card {
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden; /* Ensure rounded corners clip content */
}

/* Hover Effects */
.card:hover, .crud-card:hover, .infra-card:hover, .dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-light);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* --- Infrastructure Specific --- */
.infra-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Subtle colored borders for ownership types */
.border-provincia { border-top: 4px solid #10b981 !important; } /* Emerald */
.border-alquilada { border-top: 4px solid #f59e0b !important; } /* Amber */
.border-default   { border-top: 4px solid var(--brand-color) !important; }

.infra-title {
    font-size: 1.125rem;
    letter-spacing: -0.01em;
}

.infra-stat-badge {
    background-color: var(--primary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s;
}

.infra-stat-badge strong {
    color: var(--text-main);
}

.infra-stat-badge:hover {
    background-color: var(--brand-light);
    color: var(--brand-text);
    border-color: var(--brand-light);
}

/* --- Buttons --- */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xs);
    letter-spacing: -0.01em;
}

.btn:active {
    transform: translateY(1px);
    box-shadow: none;
}

.btn-primary, .btn-gradient {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: white;
}

.btn-primary:hover, .btn-gradient:hover {
    background-color: var(--brand-hover);
    border-color: var(--brand-hover);
    box-shadow: var(--shadow-md);
}

.btn-outline-secondary { /* Usually 'Back' buttons */
    background-color: white;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-outline-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-muted);
    color: var(--text-main);
}

/* --- Forms --- */
.form-control, .form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-main);
    background-color: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); /* Brand Shadow */
    outline: 0;
}

.form-label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.9rem;
}

/* --- Badges --- */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.container, .card, .crud-card {
    animation: fadeIn 0.4s ease-out forwards;
}

/* --- Utilities --- */
.text-muted { color: var(--text-muted) !important; }
.fw-bold { font-weight: 700 !important; }
.rounded-4 { border-radius: var(--radius-xl) !important; }
.rounded-pill { border-radius: 9999px !important; }

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Section Titles (Optional Custom) */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--surface-hover);
}
.section-title i {
    color: var(--brand-color);
}