:root {
    --primary-color: #ff6f00;   /* Modern orange */
    --primary-light: #ffa040;
    --primary-dark: #e65c00;
    --secondary-color: #ffffff; /* pure white */
    --bg-main: #f8fafc;
    --text-dark: #222222;
    --text-light: #555555;
    --border-color: rgba(0,0,0,0.05);
    --shadow-soft: 0 4px 15px rgba(0,0,0,0.03);
    --radius-sm: 8px;
    --radius-md: 12px;
    --transition-fast: 0.2s ease;
}

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

body { font-family: 'Inter', sans-serif; background-color: var(--bg-main); color: var(--text-dark); }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--secondary-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
    
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
/* Hide scrollbar on sidebar for a cleaner, premium look */
.sidebar::-webkit-scrollbar { display: none; }
.sidebar { -ms-overflow-style: none; scrollbar-width: none; }

.sidebar-brand {
    padding: 24px; font-size: 1.25rem; font-weight: 700; color: var(--primary-color);
    border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px;
}

.sidebar-nav { flex: 1; padding: 20px 12px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm);
    color: var(--text-light); text-decoration: none; transition: var(--transition-fast); margin-bottom: 4px; font-weight: 500;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,111,0,0.08); color: var(--primary-color);
}
.sidebar-nav a i { width: 20px; font-size: 1.1rem; text-align: center; }

/* Mobile Sidebar Toggle */
.sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,20,40,0.4); z-index: 90; backdrop-filter: blur(4px);
}
.sidebar-toggle-btn { display: none; background: transparent; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-dark); }

/* CRM Dropdown navigation */
.sidebar-dropdown { margin-bottom: 4px; }
.dropdown-btn {
    width: 100%; text-align: left; background: none; border: none; border-radius: var(--radius-sm);
    padding: 12px 16px; color: var(--text-light); font-size: 0.95rem; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; justify-content: space-between;
    transition: all 0.3s ease;
}
.dropdown-btn i:first-child { width: 20px; font-size: 1.1rem; color: inherit; margin-right: 12px; text-align: center; }
.dropdown-btn:hover { background: rgba(255,111,0,0.05); color: var(--primary-color); }
.active-dropdown { background: rgba(255,111,0,0.08); color: var(--primary-color); font-weight: 600; }
.drop-arrow { transition: transform 0.3s ease; font-size: 0.8rem; opacity: 0.7; }
.dropdown-container {
    display: none; background-color: transparent;
    padding: 0; margin-left: 20px; margin-top: 4px;
    border-left: 2px solid rgba(255,111,0,0.1);
}
.dropdown-container a { padding: 10px 16px 10px 24px; font-size: 0.85rem; font-weight: 500; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.dropdown-container a::before { display: none; }

.main-content {
    flex: 1; display: flex; flex-direction: column; width: calc(100% - 260px);
}

.topbar {
    background: var(--secondary-color); padding: 15px 30px; display: flex; justify-content: space-between;
    align-items: center; border-bottom: 1px solid var(--border-color); height: 70px;
}

.logout-btn { color: #ef4444; text-decoration: none; font-weight: 500; display: flex; align-items: center; gap: 8px; }

.content-area { padding: 30px; flex: 1; overflow-y: auto; }

/* Dashboard Cards */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 30px; }
.dash-card {
    background: var(--secondary-color); padding: 24px; border-radius: var(--radius-sm);
    box-shadow: var(--shadow-soft); display: flex; align-items: center; gap: 16px; border: 1px solid var(--border-color);
}
.dash-icon {
    width: 48px; height: 48px; border-radius: 10px; background: rgba(255,111,0,0.1);
    color: var(--primary-color); display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.dash-card h3 { font-size: 1.5rem; color: var(--text-dark); }
.dash-card p { color: var(--text-light); font-size: 0.9rem; }

/* Panels */
.panel {
    background: var(--secondary-color); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft);
    padding: 24px; margin-bottom: 24px; border: 1px solid var(--border-color);
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }

/* Elements */
.btn {
    padding: 10px 20px; border: none; border-radius: var(--radius-sm); cursor: pointer;
    background: var(--primary-color); color: white; font-family: inherit; font-weight: 500;
    display: inline-flex; align-items: center; gap: 8px; transition: var(--transition-fast);
}
.btn:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-color); color: var(--text-dark); }
.btn-outline:hover { background: var(--bg-main); border-color: var(--text-light); }
.btn-danger { background: #fef2f2; color: #ef4444; border: 1px solid #fca5a5; }
.btn-danger:hover { background: #ef4444; color: white; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
.table th { background: var(--bg-main); font-weight: 600; color: var(--text-dark); font-size: 0.9rem; }
.table td { color: var(--text-light); font-size: 0.95rem; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.9rem; }
.form-control {
    width: 100%; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: var(--radius-sm);
    font-family: inherit; background: var(--secondary-color);
}
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(255,111,0,0.1); }

/* File Input Specifically */
input[type="file"] {
    padding: 8px; background: var(--bg-main);
}

.alert { padding: 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.95rem; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Media Queries for Sidebar Toggle */
@media (max-width: 992px) {
    .sidebar { position: fixed; height: 100vh; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main-content { width: 100%; }
    .sidebar-toggle-btn { display: block; }
}
