:root {
    --primary: #ff6a00;
    --primary-dark: #e65f00;
    --black: #0f172a; /* Slate 900 */
    --dark-gray: #1e293b; /* Slate 800 */
    --gray: #334155; /* Slate 700 */
    --light-gray: #94a3b8; /* Slate 400 */
    --white: #ffffff;
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --logo-gold: #fbbf24;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid { display: grid; gap: 20px; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-dark {
    background-color: var(--black);
    color: var(--white);
}

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

.btn-block {
    display: block;
    width: 100%;
}

/* Table Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.btn-action-view {
    background: rgba(255, 102, 0, 0.1);
    color: var(--primary);
}
.btn-action-view:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-action-edit {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-action-edit:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-action-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.btn-action-delete:hover {
    background: #ef4444;
    color: var(--white);
    transform: translateY(-1px);
}

/* Cards */
.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1.25rem;
    padding-right: 40px;
}

select.form-control option {
    background-color: var(--bg-card);
    color: var(--text-main);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
}

/* Navbar */
.navbar {
    background: var(--bg-main);
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.logo span {
    color: var(--text-main);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--black) 0%, #333 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--light-gray);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Sections */
.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
}

/* Dashboard Sidebar */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 2rem 1rem;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav {
    list-style: none;
    margin-top: 2rem;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: var(--light-gray);
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--primary);
    color: var(--white);
}

.main-content {
    flex-grow: 1;
    padding: 2rem;
    background: var(--bg-main);
}

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

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.stat-card .value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table */
.table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-weight: 600;
}

/* ===========================
   MOBILE RESPONSIVE
   =========================== */

/* Desktop: hide mobile-only elements */
.mobile-topbar { display: none; }
.hamburger-btn { display: none; }
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 998;
}
.sidebar-overlay.active { display: block; }

/* Sidebar image constrain */
.sidebar img {
    max-width: 100%;
    max-height: 55px;
    height: auto;
    object-fit: contain;
}

@media (max-width: 768px) {
    /* Prevent any horizontal overflow */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Hero */
    .hero h1 { font-size: 2rem; }

    /* Dashboard layout: content fills full width */
    .dashboard-layout {
        display: block;
    }

    /* Sidebar: slides in from left, hidden by default */
    .sidebar {
        width: 260px;
        position: fixed;
        top: 0;
        left: -270px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        padding-top: 1rem;
    }

    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.4);
    }

    /* Mobile top bar */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: var(--black);
        padding: 10px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        width: 100%;
    }

    .mobile-topbar img {
        max-height: 38px;
        max-width: 140px;
        object-fit: contain;
    }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        padding: 8px;
    }

    /* Main content */
    .main-content {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Force all inline grids to single column */
    .main-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Stats grid single column on very small screens */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Cards full width */
    .card {
        width: 100%;
        box-sizing: border-box;
    }

    /* Table horizontal scroll contained */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Compact form spacing on mobile */
    .form-group {
        margin-bottom: 0.75rem;
    }

    .form-group label {
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
    }

    .form-control {
        padding: 9px 10px;
        font-size: 0.95rem;
    }

    .card {
        padding: 1rem !important;
    }
}
