:root {
    --primary: #E47A2E;
    --primary-hover: #c96623;
    --secondary: #1C1C1C;
    --bg-light: #F4F7F6;
    --white: #FFFFFF;
    --text-main: #333333;
    --text-muted: #666666;
    --danger: #E74C3C;
    --success: #2ECC71;
    --border: #EEEEEE;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --font-titles: 'Oswald', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --sidebar-width: 260px;
    --transition: all 0.3s ease;
}

body.dark-mode {
    --bg-light: #121212;
    --white: #1E1E1E;
    --text-main: #EEEEEE;
    --text-muted: #AAAAAA;
    --border: #333333;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.dark-mode .card, body.dark-mode .top-bar, body.dark-mode td {
    background: #1E1E1E;
    border-color: #333333;
}

body.dark-mode .sidebar {
    background-color: #000000;
}

body.dark-mode input, body.dark-mode select {
    background: #252525;
    border-color: #333333;
    color: white;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Layout */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--secondary);
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

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

.sidebar-header img {
    height: 80px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(228, 122, 46, 0.4));
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #AAA;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.sidebar-menu a i, .sidebar-menu a [data-lucide] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    stroke-width: 1.5px;
}

[data-lucide] {
    stroke-width: 1.5px;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background: rgba(255,255,255,0.05);
    color: white;
    border-left-color: var(--primary);
}

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

/* Main Content */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: var(--transition);
}

.top-bar {
    background: white;
    padding: 15px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

/* UI Elements */
.card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(0,0,0,0.02);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-family: var(--font-titles);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(228, 122, 46, 0.3);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th {
    padding: 15px;
    text-align: left;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-titles);
}

td {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

td:first-child {
    border-left: 1px solid var(--border);
    border-radius: 10px 0 0 10px;
}

td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 10px 10px 0;
}

tr:hover td {
    background: #FAFAFA;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success { background: #E8F8F0; color: var(--success); }
.badge-danger { background: #FDECEA; color: var(--danger); }

/* Helpers */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-10 { gap: 10px; }
.w-100 { width: 100%; }

/* Mobile App-Style Bottom Nav */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 10px 0;
    justify-content: space-around;
    align-items: center;
    z-index: 2000;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.05);
}

.mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    gap: 5px;
}

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

.mobile-nav a i {
    width: 22px;
    height: 22px;
    stroke-width: 2px;
}

/* Responsive Updates */
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-wrapper { 
        margin-left: 0; 
        padding-bottom: 80px; /* Space for bottom nav */
    }
    .mobile-nav { display: flex; }
    #toggleSidebar { display: none !important; } /* Hidden as we use bottom nav */
}

@media (max-width: 768px) {
    .main-wrapper { padding: 15px; padding-bottom: 90px; }
    .top-bar { padding: 10px 15px; }
    .card { padding: 15px; }
    .d-flex { flex-wrap: wrap; }
    
    /* Better table for mobile */
    table thead { display: none; }
    table tr { 
        display: block; 
        margin-bottom: 15px; 
        border: 1px solid var(--border); 
        border-radius: 10px;
        padding: 10px;
    }
    table td { 
        display: flex; 
        justify-content: space-between; 
        padding: 8px 5px;
        border: none;
        text-align: right;
    }
    table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        color: var(--text-muted);
        font-size: 0.75rem;
    }
    table td:first-child, table td:last-child { border: none; border-radius: 0; }
}


/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 3000;
}

.toast {
    background: #1C1C1C;
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    animation: slideIn 0.3s ease-out forwards;
    border-left: 4px solid #E47A2E;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success { border-left-color: #2ECC71; }
.toast.danger { border-left-color: #E74C3C; }
