:root {
    --primary-color: #d4af37;
    /* Gold */
    --primary-hover: #b8962e;
    --bg-color: #f8f9fa;
    --text-color: #333;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 350px;
    max-width: 90vw;
    text-align: center;
}

.login-box h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1rem;
}


.login-box .btn-primary {
    width: 100%;
}

.btn-primary {
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    /* Ensure links don't have underline */
    display: inline-block;
    /* Ensure proper sizing */
    text-align: center;
}

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

.error-msg {
    color: #e74c3c;
    background: #fadbd8;
    padding: 0.5rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Dashboard */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Mobile topbar (hamburger) */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1100;
    align-items: center;
    padding: 0 1rem;
    box-sizing: border-box;
}

.mobile-topbar h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 1rem;
    box-sizing: border-box;
}

.sidebar h3 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.nav-link {
    display: block;
    padding: 0.8rem 1rem !important;
    color: var(--sidebar-text);
    text-decoration: none;
    margin-bottom: 0.5rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

.main-content {
    flex: 1;
    padding: 2rem;
    min-width: 0;
    /* prevents flex child overflow */
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    /* horizontal scroll for tables on small screens */
}

/* ================================================
   RESPONSIVE / MOBILE  (max-width: 768px)
   ================================================ */
@media (max-width: 768px) {

    /* Show mobile topbar */
    .mobile-topbar {
        display: flex;
    }

    /* Push content below fixed topbar */
    .app-container {
        padding-top: 50px;
        flex-direction: column;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100%;
        width: 250px;
        z-index: 1200;
        transition: left 0.3s ease;
        padding-top: 60px;
        overflow-y: auto;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay.open {
        display: block;
    }

    /* Main content full width */
    .main-content {
        padding: 1rem;
        width: 100%;
    }

    /* Reduce page header */
    .header h1 {
        font-size: 1.3rem;
    }

    /* Tables scroll horizontally */
    .card table,
    table {
        min-width: 500px;
    }

    /* Make grid forms single column */
    div[style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }

    /* Form inputs */
    .form-control {
        font-size: 16px;
        /* prevents iOS zoom on focus */
    }

    /* Filters inline to stacked */
    .filter-form,
    form[style*="display:flex"] {
        flex-direction: column !important;
    }
}

.badge.badge-success {
    color: green;
}

.badge.badge-info {
    color: blue;
}

.badge.badge-warning {
    color: orange;
}

.badge.badge-danger {
    color: red;
}

.badge.badge-secondary {
    color: gray;
}

.badge.badge-primary {
    color: blue;
}