/* 
 * ==========================================
 * FutuEX Main Styling - Modern Aesthetic
 * ==========================================
 */

:root {
    /* Color Palette - Modern & Professional */
    --clr-primary: hsl(210, 80%, 35%);
    --clr-primary-light: hsl(210, 80%, 45%);
    --clr-secondary: hsl(150, 60%, 40%);

    /* Grays & Neutrals */
    --clr-bg-body: hsl(220, 20%, 97%);
    --clr-bg-panel: hsla(0, 0%, 100%, 0.85);
    --clr-text-main: hsl(220, 30%, 20%);
    --clr-text-muted: hsl(220, 15%, 45%);
    --clr-border: hsl(220, 20%, 90%);

    /* Sidebar specifics */
    --clr-bg-sidebar: hsl(220, 30%, 15%);
    --clr-text-sidebar: hsl(0, 0%, 90%);

    /* Typography */
    --font-main: 'Inter', sans-serif;

    /* Layout Constants */
    --sidebar-width: 260px;
    --topbar-height: 70px;

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--clr-bg-body);
    color: var(--clr-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Layout Structure */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar (Top Navigation) */
.navbar {
    background-color: var(--clr-bg-panel);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--clr-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 36px;
    width: 36px;
    border-radius: 6px;
}

.logo h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--clr-primary);
    letter-spacing: 0.5px;
}

/* Nav Links - Desktop */
.nav-links {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    margin-left: 3rem;
}

.nav-links ul {
    display: flex;
    gap: 1.5rem;
}

.nav-links li a {
    font-weight: 500;
    color: var(--clr-text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-links li a:hover,
.nav-links li.active a {
    color: var(--clr-primary);
    background-color: hsla(210, 80%, 35%, 0.08);
    /* Primary color with transparency */
}

/* Mobile Only elements hidden on Desktop */
.mobile-only {
    display: none;
}

.text-danger {
    color: hsl(0, 70%, 50%) !important;
}

/* User Area - Desktop */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-greeting {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--clr-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.btn-logout-icon {
    color: var(--clr-text-muted);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
}

.btn-logout-icon:hover {
    color: hsl(0, 70%, 50%);
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--clr-text-main);
    border-radius: 2px;
    transition: all 0.3s linear;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* Content Area */
.content-container {
    padding: 2.5rem;
    width: 100%;
    max-width: 1400px;
}

/* Reusable Glassmorphism Panel */
.panel {
    background: var(--clr-bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Typography Helpers */
h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--clr-text-main);
}

p {
    margin-bottom: 1rem;
    color: var(--clr-text-muted);
}

/* Forms & Buttons */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--clr-text-main);
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px hsla(210, 80%, 35%, 0.15);
    background: #fff;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background-color: var(--clr-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.btn-primary:hover {
    background-color: var(--clr-primary-light);
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Pagination Component */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--clr-border);
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--clr-border);
    border-radius: 6px;
    background-color: #fff;
    color: var(--clr-text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--clr-primary);
    color: var(--clr-primary);
    background-color: hsla(210, 80%, 35%, 0.05);
}

.pagination-btn.active {
    background-color: var(--clr-bg-sidebar);
    border-color: var(--clr-bg-sidebar);
    color: #fff;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* ==========================================
 * Responsive Media Queries
 * ========================================== */

@media screen and (max-width: 900px) {

    /* Tablet & Mobile */
    .mobile-menu-btn {
        display: flex;
    }

    .navbar-user {
        display: none;
        /* Hide user area on mobile, show it in the menu */
    }

    .mobile-only {
        display: block;
    }

    .nav-links {
        display: none;
        /* Initially hidden */
        position: absolute;
        top: var(--topbar-height);
        left: 0;
        width: 100%;
        background-color: var(--clr-bg-panel);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--clr-border);
        box-shadow: var(--shadow-md);
        margin: 0;
        padding: 1rem 0;
    }

    .nav-links.active {
        display: block;
    }

    .nav-links ul {
        flex-direction: column;
        gap: 0;
    }

    .nav-links li a {
        display: block;
        padding: 15px 2rem;
        border-radius: 0;
        border-left: 4px solid transparent;
    }

    .nav-links li a:hover,
    .nav-links li.active a {
        border-left-color: var(--clr-primary);
        background-color: hsla(210, 80%, 35%, 0.05);
        /* Lighter hover for mobile */
    }

    .content-container {
        padding: 1.5rem;
    }
}

@media screen and (max-width: 480px) {

    /* Small Mobile Phones */
    .navbar-container {
        padding: 0 1rem;
    }

    .content-container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }
}
/* Expediente tabs */
.tabs-nav { list-style: none; display: flex; gap: 0.5rem; padding: 0; margin-bottom: -1px; border-bottom: 2px solid var(--clr-border); overflow-x: auto;}
.tabs-nav li { margin: 0; }
.tab-btn { background: transparent; border: 2px solid transparent; border-bottom: none; padding: 10px 20px; font-size: 1rem; color: var(--clr-text-muted); cursor: pointer; border-radius: 8px 8px 0 0; transition: all 0.2s; white-space: nowrap; font-family: 'Inter', sans-serif;}
.tab-btn:hover { color: var(--clr-primary); }
.tabs-nav li.active .tab-btn { color: var(--clr-primary); border-color: var(--clr-border); border-bottom-color: var(--clr-background); background: var(--clr-background); font-weight: 600;}
.tab-panel { padding: 2rem 1rem; animation: fadeIn 0.3s ease; }
.tab-panel[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
/* Expediente Header */
.expediente-header-container {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.eh-photo {
    flex: 0 0 120px;
    min-height: 140px;
    border: 1px solid var(--clr-border);
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eh-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.eh-photo-placeholder {
    font-size: 4rem;
    color: #ccc;
}

.eh-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
}

.eh-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.eh-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.eh-field label {
    font-weight: 600;
    color: var(--clr-primary);
    white-space: nowrap;
    min-width: 120px;
    text-align: right;
}

.eh-field input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--clr-border);
    border-radius: 4px;
    background: #f9fafb;
    color: var(--clr-text);
    font-family: inherit;
    font-size: 0.95rem;
}

.eh-field input[readonly] {
    cursor: default;
}

.eh-field input:focus {
    outline: none;
    border-color: var(--clr-primary);
}

.eh-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
/* Formularios F (F0, F1...) */
.f-block {
    margin-bottom: 2rem;
    border: 1px solid var(--clr-border);
    border-radius: 4px;
    background: var(--clr-surface);
    overflow: hidden;
}

.f-block-header {
    background: #2b6ca3;
    color: white;
    padding: 0.5rem 1rem;
    font-weight: 600;
    text-align: center;
}

.f-block-body {
    padding: 1.5rem;
}

.f-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    row-gap: 1rem;
}

.f-field {
    display: flex;
    align-items: center;
}

.f-field label {
    flex: 0 0 160px;
    text-align: right;
    margin-right: 1rem;
    color: var(--clr-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.f-field input, .f-field select {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid var(--clr-border);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.9rem;
    background: #fff;
}

.f-field input[readonly], .f-field input[disabled], .f-field select[disabled] {
    background: #f4f6f8;
    color: #495057;
    border-color: #ced4da;
}

/* Data Table */
.f-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.f-table th, .f-table td {
    padding: 8px 12px;
    border: 1px solid var(--clr-border);
    text-align: left;
    font-size: 0.9rem;
}

.f-table th {
    background: #e9f2f9;
    color: #2b6ca3;
    font-weight: 600;
}

/* ==========================================
 * Responsive Form layout for details page
 * ========================================== */
@media screen and (max-width: 768px) {
    .expediente-header-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        padding: 1rem;
    }
    .eh-photo {
        flex: 0 0 160px;
        min-height: 180px;
        width: 160px;
    }
    .eh-row {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    .eh-field {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    .eh-field label {
        text-align: left;
        min-width: unset;
        width: 100%;
    }
    .f-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 1.5rem;
    }
    .f-field {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    .f-field label {
        flex: none;
        text-align: left;
        width: 100%;
        margin-right: 0;
    }
}
