/* --- 1. MODERN RESET & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC; /* Light Slate Background */
    margin: 0;
    padding: 0;
    color: #334155; /* Dark Grey Text */
    -webkit-font-smoothing: antialiased;
}

/* --- 2. DARK NAVIGATION --- */
.nav {
    background-color: #0F172A; /* Slate 900 */
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.nav a { text-decoration: none; color: white; }
.nav div { color: white !important; }

/* Back Button in Nav */
.nav button { 
    background: rgba(255,255,255,0.15) !important; 
    color: white !important; 
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1) !important;
}
.nav button:hover { background: rgba(255,255,255,0.25) !important; }

/* --- 3. CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* --- 4. KPI STATS (DESKTOP DEFAULT) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Equal Columns */
    gap: 20px;                             /* BIG SPACE between cards */
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #e5e5ea;
    
    /* Top Border Colors */
    border-top-width: 4px;
    border-top-style: solid;
    /* Colors (.blue, .red) inherited */
    
    display: flex;
    flex-direction: column-reverse; /* Desktop: Number on TOP */
    justify-content: center;
    align-items: center;
}

.stat-card.blue { border-top-color: #3B82F6; }
.stat-card.red { border-top-color: #EF4444; }
.stat-card.orange { border-top-color: #F59E0B; }
.stat-card.green { border-top-color: #10B981; }

.stat-value {
    font-size: 32px; /* Large Number */
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- 5. SEARCH & FILTERS BOX --- */
.search-box {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #E2E8F0;
}

.search-row { display: flex; gap: 10px; }

input[type="text"], input[type="date"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #F8FAFC;
    font-family: 'Inter', sans-serif;
}

input:focus, select:focus, textarea:focus {
    border-color: #3B82F6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Primary Buttons (Global Style) */
button {
    background-color: #2563EB; /* Bright Blue */
    color: white;
    border: none;
    padding: 10px 20px; /* Default Desktop Padding */
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
}
button:hover { background-color: #1D4ED8; }

/* Header Buttons Specific Class */
.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* --- 6. TABS (Pill Style) --- */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-link {
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    background: white;
    border: 1px solid #E2E8F0;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-link:hover { background: #F1F5F9; color: #334155; }

.tab-link.active {
    background-color: #2563EB;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* --- 7. MODERN TABLE (Desktop) --- */
.dashboard-table, .users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
}

.dashboard-table th, .users-table th {
    text-align: left;
    padding: 16px 24px;
    background: #F8FAFC;
    color: #64748B;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #E2E8F0;
}

.dashboard-table td, .users-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    vertical-align: middle;
    color: #334155;
}

.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover { background-color: #F8FAFC; }

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.status-New, .status-Low { background: #DBEAFE; color: #1E40AF; }
.status-InProcess, .status-Medium { background: #FEF3C7; color: #92400E; }
.status-Critical, .status-High { background: #FEE2E2; color: #991B1B; }
.status-Closed, .status-Solved, .status-active { background: #DCFCE7; color: #166534; }
.status-Deleted, .status-blocked { background: #F1F5F9; color: #94A3B8; }
.status-UserAction, .status-OnHold { background: #E0E7FF; color: #3730A3; }






/* --- 1. MODERN RESET & FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8FAFC; /* Light Slate Background */
    margin: 0;
    padding: 0;
    color: #334155; /* Dark Grey Text */
    -webkit-font-smoothing: antialiased;
}

/* --- 2. DARK NAVIGATION --- */
.nav {
    background-color: #0F172A; /* Slate 900 */
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.nav a { text-decoration: none; color: white; }
.nav div { color: white !important; }

/* Back Button in Nav */
.nav button { 
    background: rgba(255,255,255,0.15) !important; 
    color: white !important; 
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1) !important;
}
.nav button:hover { background: rgba(255,255,255,0.25) !important; }

/* --- 3. CONTAINER --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* --- 4. KPI STATS (DESKTOP DEFAULT) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Equal Columns */
    gap: 20px;                             /* BIG SPACE between cards */
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    text-align: center;
    border: 1px solid #e5e5ea;
    
    /* Top Border Colors */
    border-top-width: 4px;
    border-top-style: solid;
    /* Colors (.blue, .red) inherited */
    
    display: flex;
    flex-direction: column-reverse; /* Desktop: Number on TOP */
    justify-content: center;
    align-items: center;
}

.stat-card.blue { border-top-color: #3B82F6; }
.stat-card.red { border-top-color: #EF4444; }
.stat-card.orange { border-top-color: #F59E0B; }
.stat-card.green { border-top-color: #10B981; }

.stat-value {
    font-size: 32px; /* Large Number */
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- 5. SEARCH & FILTERS BOX --- */
.search-box {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    border: 1px solid #E2E8F0;
}

.search-row { display: flex; gap: 10px; }

input[type="text"], input[type="date"], input[type="password"], select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    background: #F8FAFC;
    font-family: 'Inter', sans-serif;
}

input:focus, select:focus, textarea:focus {
    border-color: #3B82F6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Primary Buttons (Global Style) */
button {
    background-color: #2563EB; /* Bright Blue */
    color: white;
    border: none;
    padding: 10px 20px; /* Default Desktop Padding */
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
}
button:hover { background-color: #1D4ED8; }

/* Header Buttons Specific Class */
.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* --- 6. TABS (Pill Style) --- */
.tab-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-link {
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: #64748B;
    background: white;
    border: 1px solid #E2E8F0;
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-link:hover { background: #F1F5F9; color: #334155; }

.tab-link.active {
    background-color: #2563EB;
    color: white;
    border-color: #2563EB;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* --- 7. MODERN TABLE (Desktop) --- */
.dashboard-table, .users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #E2E8F0;
}

.dashboard-table th, .users-table th {
    text-align: left;
    padding: 16px 24px;
    background: #F8FAFC;
    color: #64748B;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #E2E8F0;
}

.dashboard-table td, .users-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    vertical-align: middle;
    color: #334155;
}

.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-table tr:hover { background-color: #F8FAFC; }

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}
.status-New, .status-Low { background: #DBEAFE; color: #1E40AF; }
.status-InProcess, .status-Medium { background: #FEF3C7; color: #92400E; }
.status-Critical, .status-High { background: #FEE2E2; color: #991B1B; }
.status-Closed, .status-Solved, .status-active { background: #DCFCE7; color: #166534; }
.status-Deleted, .status-blocked { background: #F1F5F9; color: #94A3B8; }
.status-UserAction, .status-OnHold { background: #E0E7FF; color: #3730A3; }


/* --- 8. MOBILE OPTIMIZATIONS --- */
@media (max-width: 768px) {
    .container { padding: 0 15px 30px 15px; }

    /* --- MOBILE STATS OVERRIDE (Connected Bar) --- */
    .stats-grid {
        display: flex;              /* Switch to Flex Row */
        gap: 0;                     /* NO GAP */
        background: white;
        border: 1px solid #d2d2d7;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    }

    .stat-card {
        flex: 1;                    /* Equal Width */
        background: transparent;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 12px 5px;
        
        border-right: 1px solid #e5e5ea; /* Vertical Divider */
        /* Top Border color inherited */
        
        flex-direction: column;     /* Mobile: Label on TOP */
    }

    .stat-card:last-child { border-right: none; }

    .stat-value { font-size: 20px; margin-bottom: 0; }
    .stat-label { margin-bottom: 4px; font-size: 9px; }

    /* --- SHRINK HEADER BUTTONS ON MOBILE --- */
    .header-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }

    /* --- SHRINK SEARCH & FILTERS ON MOBILE --- */
    .search-row input {
        padding: 8px 12px; /* Smaller than desktop */
        font-size: 13px;
        height: auto;
    }
    .search-row button {
        padding: 8px 12px; /* Smaller to match New Ticket button */
        font-size: 13px;
    }

    /* --- TABLE RESET --- */
    .dashboard-table thead, .users-table thead { display: none; }

    .dashboard-table, .dashboard-table tbody, 
    .users-table, .users-table tbody {
        display: block; width: 100%; border: none; box-shadow: none; background: transparent;
    }

    /* Base Card Style */
    .dashboard-table tr, .users-table tr {
        background: white;
        margin-bottom: 12px;
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
        border: 1px solid #E2E8F0;
    }

    /* =========================================
       DASHBOARD CARD LAYOUT (ID | Subject | Status)
       ========================================= */
    .dashboard-table tr {
        display: grid;
        grid-template-columns: auto 1fr auto; 
        gap: 6px 12px;
        align-items: center;
        padding: 12px 16px;
    }

    /* ID */
    .dashboard-table td:nth-of-type(1) {
        grid-column: 1; grid-row: 1;
        font-weight: 700; color: #64748B; font-size: 14px; padding: 0; border: none; width: auto;
    }
    .dashboard-table td:nth-of-type(1)::before { content: none; }

    /* Subject */
    .dashboard-table td:nth-of-type(2) {
        grid-column: 2; grid-row: 1;
        padding: 0; border: none;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        font-weight: 700; color: #0F172A; font-size: 14px;
        display: block;
    }
    .dashboard-table td:nth-of-type(2)::before { content: none; }

    /* Status Badge */
    .dashboard-table td:nth-of-type(6) {
        grid-column: 3; grid-row: 1;
        padding: 0; border: none; justify-self: end;
    }
    .dashboard-table td:nth-of-type(6)::before { content: none; }

    /* Created By */
    .dashboard-table td:nth-of-type(3) {
        grid-column: 1 / -1; grid-row: 2;
        padding: 8px 0; border: none;
        border-top: 1px solid #F1F5F9; border-bottom: 1px solid #F1F5F9;
        color: #64748B; font-size: 12px;
        display: block;
    }
    .dashboard-table td:nth-of-type(3)::before { content: "Created by: "; font-weight: 400; color: #94A3B8; }

    /* Priority */
    .dashboard-table td:nth-of-type(5) {
        grid-column: 1 / span 2; grid-row: 3;
        padding-top: 4px; border: none; justify-self: start;
    }
    .dashboard-table td:nth-of-type(5)::before { content: none; }

    /* Action */
    .dashboard-table td:nth-of-type(7) {
        grid-column: 3; grid-row: 3;
        padding-top: 4px; border: none; justify-self: end;
    }
    .dashboard-table td:nth-of-type(7)::before { content: none; }

    /* Hide Unused */
    .dashboard-table td:nth-of-type(4) { display: none; }


    /* =========================================
       USERS LIST CARD LAYOUT (Name | Role)
       ========================================= */
    .users-table tr {
        display: flex;
        flex-direction: column;
        position: relative;
        padding: 16px;
    }

    /* 1. Name (Top Left) */
    .users-table td:nth-of-type(2) {
        order: 1;
        padding: 0; border: none;
        margin-bottom: 15px; /* Push Status/Actions down */
        padding-right: 100px; /* Space for Role Badge */
    }
    .users-table td:nth-of-type(2) strong { font-size: 16px; color: #0F172A; }
    .users-table td:nth-of-type(2)::before { content: none; }

    /* 2. Role (Top Right - Absolute) */
    .users-table td:nth-of-type(3) {
        position: absolute;
        top: 16px; right: 16px;
        padding: 0; border: none;
    }
    .users-table td:nth-of-type(3)::before { content: none; }

    /* 3. Status (Bottom Left) */
    .users-table td:nth-of-type(4) {
        order: 2;
        padding: 0; border: none;
        display: flex; align-items: center;
    }
    .users-table td:nth-of-type(4)::before { 
        content: "Status: "; font-size: 11px; color:#94A3B8; margin-right: 5px; font-weight: 700; text-transform: uppercase;
    }

    /* 4. Actions (Bottom Right) */
    .users-table td:nth-of-type(5) {
        position: absolute;
        bottom: 16px; right: 16px;
        padding: 0; border: none;
        font-size: 14px; font-weight: 600;
    }
    .users-table td:nth-of-type(5)::before { content: none; }

    /* 5. Hide ID */
    .users-table td:nth-of-type(1) { display: none; }


    /* --- OTHER MOBILE FIXES --- */
    .search-row { flex-wrap: wrap; }
    .search-row input { width: 100%; }
    .search-row button { flex: 1; justify-content: center; }
    .nav { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nav div:last-child { width: 100%; display: flex; justify-content: space-between; margin-top: 10px; }
    .advanced-grid { grid-template-columns: 1fr !important; }
}

/* Pagination */
.pagination { margin-top: 20px; text-align: center; }
.page-btn {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.page-btn.active {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
}

/* Advanced Filter Grid */
.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #E2E8F0;
}

/* --- FILTER LABELS (Resize Here) --- */
.advanced-grid label {
    font-size: 12px;       /* <--- CHANGE THIS NUMBER to resize (e.g. 11px or 13px) */
    font-weight: 700;      /* Makes it bold */
    color: #64748B;        /* Grey color */
    margin-bottom: 5px;    /* Space between label and input */
    display: block;        /* Ensures it sits above the input */
    text-transform: uppercase; /* Optional: Makes it all caps like headers */
    letter-spacing: 0.5px;
}



/* --- LOGIN PAGE LAYOUT (Centers on Desktop, Top on Mobile) --- */
.auth-body {
    display: flex;
    align-items: center;     /* Desktop: Center Vertically */
    justify-content: center; /* Desktop: Center Horizontally */
    min-height: 100vh;
}

@media (max-width: 768px) {
    .auth-body {
        align-items: flex-start; /* Mobile: Align to Top */
        padding-top: 100px;       /* Mobile: Push down slightly (Half the previous space) */
    }
    
    /* Optional: Fix the container width on mobile */
    .auth-body .container {
        width: 90% !important;   
    }
}
