:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --surface-color: #ffffff;
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    line-height: 1.5;
    min-height: 100vh;
}

/* Specific layout for Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    min-height: 600px;
    background: var(--surface-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Form Section */
.login-left {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-y: auto;
    max-height: 100vh;
}

.login-content {
    width: 100%;
    max-width: 400px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.login-header {
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.login-header p {
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f9fafb;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: white;
}

.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

/* Decorative Section */
.login-right {
    background: linear-gradient(135deg, var(--primary-color), #1e40af);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.login-right::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.4;
}

.glass-card {
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    max-width: 80%;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Responsiveness for Login */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .login-right {
        display: none;
    }
}

/* =========================================
   DASHBOARD & SIDEBAR STYLES
   ========================================= */

/* Application Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 280px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
    text-decoration: none;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.2s;
    justify-content: space-between;
}

.menu-link:hover,
.menu-link.active {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.menu-icon {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

/* Submenu */
.submenu {
    list-style: none;
    padding-left: 0;
    background-color: #f9fafb;
    display: none;
    /* JS will toggle this */
}

.submenu.show {
    display: block;
}

.submenu-link {
    display: block;
    padding: 0.6rem 1.5rem 0.6rem 3.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none !important;
}

.submenu-link:hover {
    color: var(--primary-color);
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    /* Width of sidebar */
    padding: 2rem;
    background-color: var(--bg-color);
    min-height: 100vh;
    width: calc(100% - 280px);
}

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--surface-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Top Bar (Mobile Toggle + Profile) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .mobile-toggle {
        display: block;
    }
}

/* =========================================
   MODERN TABLE STYLES
   ========================================= */

.table-container {
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    margin-top: 1.5rem;
    max-height: calc(100vh - 250px);
    /* Adaptable height */
}

.table-header-action {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: #f9fafb;
    flex-shrink: 0;
    /* Keep header from shrinking */
}

/* Wrapper for the table to handle scrolling */
.table-scroll-wrapper {
    overflow: auto;
    /* Both X and Y scrolling */
    flex: 1;
}

/* SEARCH INPUT */
padding: 0.6rem 1rem;
border: 1px solid var(--border-color);
border-radius: 8px;
width: 300px;
transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    background: #fdfdfd;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 var(--border-color);
    /* Bottom border fix for sticky */
}

.modern-table td {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
}

.modern-table tbody tr:hover {
    background-color: #f3f4f6;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s;
    gap: 6px;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background-color: #eff6ff;
    color: var(--primary-color);
}

.btn-edit:hover {
    background-color: #dbeafe;
}

.btn-delete {
    background-color: #fef2f2;
    color: #ef4444;
}

.btn-delete:hover {
    background-color: #fee2e2;
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.add-btn:hover {
    background-color: var(--primary-hover);
}