/* 
   Darshan Networks CSS Stylesheet
   Designed with Vanilla CSS. Deep Navy, Teal, and Slate Palette.
*/

:root {
    --primary-color: #0f172a;       /* Deep Navy */
    --primary-hover: #1e293b;
    --accent-color: #0d9488;        /* Teal */
    --accent-hover: #0f766e;
    --bg-light: #f8fafc;            /* Off-white */
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-muted: #64748b;          /* Slate */
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --danger-bg: #fee2e2;
    --success-color: #10b981;
    --success-bg: #d1fae5;
    --warning-color: #f59e0b;
    --warning-bg: #fef3c7;
    --info-color: #3b82f6;
    --info-bg: #dbeafe;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Globals */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.5;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
}

/* Typography helper */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-block {
    display: flex !important;
    width: 100%;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 550;
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: var(--danger-color);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success-color);
    border: 1px solid #a7f3d0;
}

/* ─── LOGIN PANEL ─── */
.login-body {
    background: radial-gradient(circle at 10% 20%, #0f172a 0%, #1e293b 90%);
    min-height: 100vh;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block !important;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.input-wrapper {
    position: relative;
    display: flex !important;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* ─── NAVBAR (Worker/User) ─── */
.navbar {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 1rem 2rem;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}

.navbar-brand .logo-icon {
    font-size: 1.75rem;
    margin: 0;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.user-info {
    display: flex !important;
    align-items: center;
    gap: 1.5rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.navbar .btn-outline {
    border-color: rgba(255,255,255,0.2);
    color: #ffffff;
}
.navbar .btn-outline:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: #ffffff;
}

/* ─── CONTAINER & GRID ─── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.main-content {
    display: block !important;
}

.dashboard-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    width: 100%;
    min-width: 0;
    margin-bottom: 2rem;
}

.card-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-header h2, .card-header h3 {
    font-size: 1.35rem;
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ─── TICKET FORM ─── */
.ticket-form {
    display: flex !important;
    flex-direction: column;
    gap: 1.25rem;
}

.form-row {
    display: flex !important;
    gap: 1.5rem;
}

.col-6 {
    flex: 1;
}

.ticket-form input[type="date"],
.ticket-form input[type="time"],
.ticket-form select,
.quick-form input[type="text"],
.quick-form input[type="password"],
.quick-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.ticket-form input[type="date"]:focus,
.ticket-form input[type="time"]:focus,
.ticket-form select:focus,
.quick-form input[type="text"]:focus,
.quick-form input[type="password"]:focus,
.quick-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.ticket-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    outline: none;
}

.ticket-form textarea:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-actions {
    margin-top: 1.5rem;
}

/* ─── AUTOCOMPLETE COMPONENT ─── */
.autocomplete-container {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    display: none !important;
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover, .suggestion-item.active {
    background-color: #f1f5f9;
    color: var(--accent-color);
    font-weight: 600;
}

/* ─── ADMIN DASHBOARD LAYOUT ─── */
.dashboard-body {
    background-color: #f8fafc;
}

.dashboard-wrapper {
    display: flex !important;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: #ffffff;
    display: flex !important;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-brand {
    display: flex !important;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand .logo-box {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(13,148,136,0.45);
}

.sidebar-brand .brand-info {
    display: flex !important;
    flex-direction: column;
}

.sidebar-brand .brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.65rem;
    font-weight: 500;
    color: rgba(13,148,136,0.9);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 1px;
}

.sidebar-user {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.user-avatar {
    font-size: 1.5rem;
}

.user-details {
    display: flex !important;
    flex-direction: column;
}

.user-details .user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-details .user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-menu {
    display: flex !important;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.menu-item.active {
    background-color: var(--accent-color);
    color: #ffffff;
}

.menu-divider {
    height: 1px;
    background-color: rgba(255,255,255,0.08);
    margin: 1rem 0;
}

.logout-item:hover {
    background-color: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.content-area {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.content-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.content-header h1 {
    font-size: 1.75rem;
    margin: 0;
}

.current-time {
    font-weight: 550;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: #ffffff;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
}

.metric-info {
    display: flex !important;
    flex-direction: column;
}

.metric-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.metric-value {
    font-size: 2rem;
    font-weight: 750;
}

.metric-icon {
    font-size: 2.25rem;
    opacity: 0.3;
}

.bg-navy { background-color: var(--primary-color); }
.bg-green { background-color: var(--success-color); }
.bg-yellow { background-color: var(--warning-color); }
.bg-purple { background-color: #6366f1; }

/* 2-Column Grid for Dashboard Dashboard */
.grid-2-col {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1.75rem;
    align-items: start;
}

/* Mobile navbar styling defaults */
.mobile-navbar {
    display: none !important;
}

.sidebar-backdrop {
    display: none !important;
}

@media (max-width: 768px) {
    /* Mobile topbar */
    .mobile-navbar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 64px;
        background: linear-gradient(90deg, #0a1628 0%, #0f2044 100%);
        color: #ffffff;
        padding: 0 1.1rem;
        box-shadow: 0 2px 16px rgba(0,0,0,0.35);
        z-index: 999;
        border-bottom: 2px solid #0d9488;
    }

    .mobile-toggle-btn {
        background: none;
        border: none;
        color: #ffffff;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.25rem;
    }

    .mobile-brand {
        display: flex !important;
        align-items: center;
        gap: 0.6rem;
    }

    .mobile-brand .logo-box {
        width: 36px; height: 36px;
        border-radius: 9px;
        background: linear-gradient(135deg, #0d9488, #0891b2);
        display: flex !important; align-items: center; justify-content: center;
        font-size: 1.1rem;
        box-shadow: 0 2px 10px rgba(13,148,136,0.4);
    }

    .mobile-brand .brand-info { display: flex !important; flex-direction: column; }

    .mobile-brand .brand-name {
        font-weight: 700;
        font-size: 1rem;
        color: #ffffff;
        line-height: 1.2;
        display: block !important;
    }

    .mobile-brand .brand-sub {
        font-size: 0.6rem;
        color: rgba(13,148,136,0.9);
        text-transform: uppercase;
        letter-spacing: 0.07em;
    }

    .mobile-logout-icon {
        text-decoration: none;
        font-size: 1.25rem;
        color: rgba(255, 255, 255, 0.8);
    }

    /* Mobile Sidebar Backdrop Overlay */
    .sidebar-backdrop {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Sidebar transformed into a drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        flex-direction: column;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Keep items inside the sidebar visible */
    .sidebar .brand-text, 
    .sidebar .user-details, 
    .sidebar-brand, 
    .sidebar-user {
        display: flex !important;
    }

    /* Layout Adjustments */
    .dashboard-wrapper {
        margin-top: 60px;
        flex-direction: column;
    }

    .content-area {
        padding: 1.5rem 1rem;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .content-header h1 {
        font-size: 1.45rem;
    }

    .current-time {
        font-size: 0.8rem;
    }

    /* Metrics Grid styling on Mobile */
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-icon {
        font-size: 1.75rem;
    }

    .grid-2-col, .grid-3-col {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    /* Full width app-like container */
    .container {
        padding: 1rem 0;
    }
    .dashboard-card {
        padding: 1.25rem 1rem;
        margin-bottom: 1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .header-actions {
        padding: 0 1rem;
    }
    .grid-2-col, .grid-3-col {
        gap: 1rem;
    }
    .metrics-grid {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding: 0 0.5rem;
    }
    /* Form row stacking */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-row .col-6 {
        width: 100%;
    }
    
    /* Navbar compact mode */
    .navbar {
        padding: 0.75rem 1rem;
    }
    .navbar .user-name {
        display: none !important;
    }
}

@media (max-width: 480px) {
    /* Single col metrics for tiny screens */
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

/* Tables Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.select-list-box {
    max-height: 520px;
    overflow-y: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.table th {
    padding: 0.875rem 1rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: #f8fafc;
    border-bottom: 1.5px solid var(--border-color);
}

.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

.table-responsive::-webkit-scrollbar,
.select-list-box::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb,
.select-list-box::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-sm);
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
}

.badge-info {
    background-color: var(--info-bg);
    color: var(--info-color);
}

.badge-success {
    background-color: var(--success-bg);
    color: var(--success-color);
}

.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning-color);
}

.username-badge {
    background-color: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    color: var(--accent-color);
    font-weight: 600;
}

.materials-text {
    max-width: 250px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--accent-color); }
.text-danger { color: var(--danger-color); }
.font-semibold { font-weight: 600; }

/* Quick form in Dashboard */
.quick-form {
    display: flex !important;
    flex-direction: column;
    gap: 1.25rem;
}

/* 3-Column Grid for Statistics */
.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    align-items: start;
}
. b a d g e - p u r p l e   {   b a c k g r o u n d - c o l o r :   # f 3 e 8 f f ;   c o l o r :   # 7 e 2 2 c e ;   } 
 
 @media (max-width: 768px) {
    .mobile-card-table thead {
        display: none !important;
    }
    .mobile-card-table tr {
        display: block !important;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        background: #fff;
        padding: 0.5rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .mobile-card-table td {
        display: flex !important;
        flex-direction: column;
        padding: 0.5rem;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.95rem;
    }
    .mobile-card-table td:last-child {
        border-bottom: none;
    }
    .mobile-card-table td::before {
        content: attr(data-label);
        font-weight: 600;
        margin-bottom: 0.25rem;
        color: #475569;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
}
