:root {
    --primary: #18aadf;
    --secondary: #ccb181;
    --dark: #0f172a;
    --dark-nav: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --text: #334155;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #2ecc71;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--light);
    color: var(--text);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--dark-nav);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-logo {
    max-width: 140px;
    filter: brightness(0) invert(1);
}

.sidebar-nav {
    list-style: none;
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-nav li {
    margin-bottom: 5px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a i {
    width: 25px;
    font-size: 1.1rem;
    margin-right: 10px;
}

.sidebar-nav a:hover,
.sidebar-nav li.active>a {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--secondary);
    border-left: 4px solid var(--secondary);
}

.ms-auto {
    margin-left: auto;
}

.chevron {
    transition: transform 0.3s ease;
    font-size: 0.8rem !important;
    width: auto !important;
}

.has-submenu.open .chevron {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    background-color: rgba(0, 0, 0, 0.2);
    display: none;
    padding: 5px 0;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu a {
    padding: 10px 25px 10px 60px !important;
    font-size: 0.9rem;
    border-left: 4px solid transparent !important;
}

.submenu a:hover,
.submenu li.active a {
    color: var(--white);
    background-color: transparent !important;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    background-color: rgba(239, 68, 68, 0.2);
    padding: 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.logout-btn:hover {
    background-color: var(--danger);
}

.logout-btn i {
    margin-right: 8px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background-color: var(--white);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar h1 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 700;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 600;
}

.avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 40px;
    flex: 1;
}

.welcome-banner {
    background: linear-gradient(135deg, var(--dark-nav) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 20px rgba(24, 170, 223, 0.1);
}

.welcome-banner h2 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.8);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background-color: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.stat-info h3 {
    color: #64748b;
    font-size: 0.95rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.stat-value {
    color: var(--dark);
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

/* Tables */
.recent-activity {
    background-color: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.recent-activity h3 {
    margin-bottom: 25px;
    color: var(--dark);
    font-size: 1.3rem;
    font-weight: 700;
}

.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 15px;
    border-bottom: 2px solid var(--border);
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
}

.admin-table tr:hover td {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-completed {
    background-color: rgba(46, 204, 113, 0.1);
    color: #2ecc71;
}

/* Mobile Sidebar App Styling */
#sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 15px;
    padding: 5px;
}

.topbar-left {
    display: flex;
    align-items: center;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .admin-layout.sidebar-active .sidebar {
        transform: translateX(0);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .admin-layout.sidebar-active #sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 600px) {
    .topbar {
        padding: 15px 20px;
    }

    .topbar h1 {
        font-size: 1.25rem;
    }

    .admin-profile span {
        display: none;
    }

    .dashboard-content {
        padding: 20px;
    }

    .welcome-banner {
        padding: 20px;
        margin-bottom: 25px;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 15px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .recent-activity {
        padding: 15px;
    }

    .recent-activity h3 {
        font-size: 1.15rem;
        margin-bottom: 15px;
    }
}

/* =============================================================
   GLOBAL DARK BORDERS — Applied to ALL admin pages
   ============================================================= */

/* --- Form Fields --- */
.dashboard-content input[type="text"],
.dashboard-content input[type="email"],
.dashboard-content input[type="number"],
.dashboard-content input[type="tel"],
.dashboard-content input[type="url"],
.dashboard-content input[type="date"],
.dashboard-content input[type="time"],
.dashboard-content input[type="search"],
.dashboard-content input[type="color"],
.dashboard-content select,
.dashboard-content textarea {
    border: 2px solid #94a3b8 !important;
    border-radius: 8px !important;
    transition: border-color 0.15s;
}

.dashboard-content input:focus,
.dashboard-content select:focus,
.dashboard-content textarea:focus {
    border-color: var(--primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(24, 170, 223, 0.12) !important;
}

/* Keep color picker natural */
.dashboard-content input[type="color"] {
    padding: 2px !important;
    cursor: pointer;
}

/* --- Content Cards --- */
.data-card,
.recent-activity,
.app-card {
    border: 2px solid #cbd5e1 !important;
}

/* --- Table --- */
.admin-table th {
    border-bottom: 2px solid #94a3b8 !important;
    background: #f8fafc;
}

.admin-table td {
    border-bottom: 1px solid #cbd5e1 !important;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

/* --- Generic Modal/Fixed Overlays --- */
[id$="Modal"] input,
[id$="Modal"] select,
[id$="Modal"] textarea {
    border: 2px solid #94a3b8 !important;
    border-radius: 8px !important;
}

[id$="Modal"] input:focus,
[id$="Modal"] select:focus,
[id$="Modal"] textarea:focus {
    border-color: var(--primary) !important;
    outline: none !important;
}

/* --- Welcome banner & filter cards border --- */
.welcome-banner {
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* =============================================================
   MOBILE APP-STYLE ENHANCEMENTS (Bottom Nav & Cards)
   ============================================================= */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #fff;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 0 5px;
}

.mobile-bottom-nav a, .mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #94a3b8;
    gap: 4px;
    background: none;
    border: none;
    width: 20%;
    cursor: pointer;
    font-family: inherit;
}

.mobile-bottom-nav a i, .mobile-bottom-nav button i {
    font-size: 1.2rem;
}

.mobile-bottom-nav a span, .mobile-bottom-nav button span {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mobile-bottom-nav a.active {
    color: var(--primary);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    .dashboard-content {
        padding-bottom: 80px !important;
    }

    /* Transform Table to Cards on Mobile */
    .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
        display: block !important;
    }

    .admin-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .admin-table tr {
        background: #fff;
        border: 2px solid #e2e8f0 !important;
        border-radius: 12px;
        margin-bottom: 15px;
        padding: 10px;
        box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    }

    .admin-table td {
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
        position: relative;
        padding-left: 40% !important;
        text-align: left !important;
        min-height: 45px;
        display: flex;
        align-items: center;
    }

    .admin-table td:last-child {
        border-bottom: none !important;
    }

    .admin-table td:before {
        position: absolute;
        left: 15px;
        width: 35%;
        white-space: nowrap;
        font-weight: 700;
        color: #94a3b8;
        font-size: 0.7rem;
        text-transform: uppercase;
        content: attr(data-label);
    }
    
    .stackable {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}