:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #d4af37;
    --accent-hover: #b5952f;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --border: #e2e8f0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body, sans-serif); background: var(--primary); color: var(--text-main); min-height: 100vh; display: flex; }
.admin-layout { display: flex; width: 100%; min-height: 100vh; }


.admin-sidebar { 
    width: 260px; 
    background: var(--primary-light); 
    color: white; 
    display: flex; 
    flex-direction: column; 
    border-right: 1px solid rgba(255,255,255,0.05); 
    position: fixed; 
    height: 100vh; 
    overflow-y: auto; 
    transition: transform 0.3s ease; 
    z-index: 1100; 
}
.admin-sidebar.open { transform: translateX(0); }


.sidebar-search-wrapper { padding: 0 20px 20px 20px; }
.sidebar-search-input {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 10px 12px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    transition: 0.2s;
}
.sidebar-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}


.admin-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    z-index: 2200; 
    display: none; 
    flex-direction: column;
    padding: 24px;
    backdrop-filter: blur(10px);
    overflow-y: auto;
}
.admin-mobile-menu-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 16px;
}
.mobile-menu-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
}
.mobile-menu-close:hover { color: var(--danger); }

.mobile-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}
.mobile-tile {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid transparent;
}
.mobile-tile:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}
.mobile-tile.active {
    background: var(--accent);
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}
.mobile-tile-icon { font-size: 2rem; margin-bottom: 12px; }
.mobile-tile-label { font-size: 0.85rem; font-weight: 600; line-height: 1.2; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }


.mobile-toggle { display: none; }
@media (max-width: 768px) {
    .mobile-toggle { 
        display: flex !important; 
        position: fixed; 
        bottom: 20px; 
        left: 20px; 
        z-index: 2000 !important; 
        width: 50px; 
        height: 50px; 
        background: #0f172a; 
        color: #d4af37; 
        border: 2px solid #d4af37; 
        border-radius: 50%; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.5);
        align-items: center; 
        justify-content: center;
        font-size: 1.5rem;
        cursor: pointer;
    }
    .admin-sidebar { z-index: 2001; }
}

.sidebar-header { padding: 24px; font-size: 1.2rem; font-weight: 700; color: var(--accent); border-bottom: 1px solid rgba(255,255,255,0.05); display: flex; align-items: center; gap: 10px; }
.sidebar-nav { padding: 20px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.sidebar-footer { padding: 20px; border-top: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }

.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: #94a3b8; text-decoration: none; border-radius: 8px; transition: 0.2s; font-size: 0.9rem; font-weight: 500; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,0.05); color: white; }
.nav-link.active { color: var(--accent); background: rgba(212, 175, 55, 0.1); }
.nav-icon { width: 20px; text-align: center; }


.admin-main { flex: 1; margin-left: 260px; background: var(--bg-body); padding: 32px; overflow-y: auto; width: calc(100% - 260px); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-title { font-size: 1.8rem; font-weight: 700; color: var(--primary); font-family: 'Outfit', sans-serif; }


.admin-card { background: white; border-radius: 16px; padding: 24px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border: 1px solid var(--border); margin-bottom: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }


.dashboard-grid-split { grid-template-columns: 2fr 1fr; }


.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


.stat-card { background: white; padding: 20px; border-radius: 12px; border: 1px solid var(--border); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--primary); margin: 8px 0; }
.stat-trend { font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }
.trend-up { color: var(--success); } .trend-down { color: var(--danger); }


.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: 0.2s; border: none; text-decoration: none; font-size: 0.9rem; }
.btn-primary { background: var(--primary); color: white; } .btn-primary:hover { background: var(--primary-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); } .btn-outline:hover { border-color: var(--primary); }
.btn-danger { background: #fee2e2; color: #991b1b; } .btn-danger:hover { background: #fecaca; }


.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 12px 16px; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; }
.admin-table td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.admin-table tr:last-child td { border-bottom: none; }
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; display: inline-block; }


.form-group { margin-bottom: 20px; position: relative; } 


.voice-input-icon {
    right: 12px; 
    z-index: 1100; 
}
.voice-input-icon.listening {
    color: #ef4444;
}

.admin-sidebar .voice-input-icon {
    color: rgba(255,255,255,0.5);
}
.admin-sidebar .voice-input-icon:hover {
    color: var(--accent);
}
.admin-label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: var(--text-main); }
.admin-input, .admin-select, .admin-textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 0.95rem; transition: 0.2s; background: #fff; }
.admin-input:focus, .admin-select:focus, .admin-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1); }


.alert { padding: 16px; border-radius: 8px; margin-bottom: 24px; font-weight: 500; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--primary); color: white; padding: 16px 24px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: flex; align-items: center; gap: 12px; animation: slideIn 0.3s ease; z-index: 100; }
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


.btn-login {
    width: 100%; padding: 16px; background: linear-gradient(135deg, #d4af37 0%, #b5952f 100%); color: #0f172a; border: none; border-radius: 8px; font-weight: 800; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2); margin-top: 10px; position: relative; overflow: hidden;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4); background: linear-gradient(135deg, #e5c158 0%, #c6a640 100%); }


.config-builder-wrapper { display: flex; flex-direction: column; gap: 24px; }
.config-simulation-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.config-item-list { display: flex; flex-direction: column; gap: 10px; }
.config-item-row {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.config-item-row:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateX(2px);
}
.config-item-row::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--border); transition: 0.2s;
}
.config-item-row:hover::before { background: var(--accent); }
.item-meta { display: flex; gap: 15px; align-items: center; font-size: 0.9rem; color: var(--text-muted); }
.item-price-tag {
    background: #f8fafc; padding: 4px 10px; border-radius: 6px; font-weight: 700; color: var(--primary); border: 1px solid #e2e8f0;
}
.limit-badge {
    font-size: 0.75rem; padding: 2px 8px; border-radius: 4px; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca;
}


@media (max-width: 1024px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); width: 85%; max-width: 300px; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
    .admin-main { margin-left: 0; width: 100%; padding: 10px; overflow-x: hidden; }
    
    
    .grid-2, .grid-3, .grid-4, .dashboard-grid-split { grid-template-columns: 1fr !important; gap: 16px; }
    
    .mobile-toggle { display: flex !important; }
    
    
    .task-item { flex-direction: column; gap: 10px; width: 100%; box-sizing: border-box; }
    .task-actions { width: 100%; flex-direction: row; justify-content: space-between; margin-top: 5px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
    .task-main { width: 100%; min-width: 0;  }
    .package-header { padding: 10px; flex-wrap: wrap; gap: 10px; }
    .package-title { font-size: 1rem; white-space: normal; }
    
    
    .stat-card { margin-bottom: 0; }
    
    
    .admin-card { padding: 15px; max-width: 100%; overflow: hidden; }
    .table-container { 
        width: 100%; 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch; 
        display: block;
        padding-bottom: 10px; 
    }
    .admin-table { min-width: 600px; } 
    
    
    .admin-card form { flex-direction: column; align-items: stretch !important; }
    .admin-card form > div, .admin-card form input, .admin-card form select { width: 100% !important; max-width: 100% !important; margin-bottom: 5px; }
    .admin-card form button, .admin-card form a.btn { width: 100%; justify-content: center; margin-top: 5px; }

    
    .config-item-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .config-item-row > div { width: 100%; }
    .config-item-row > div:last-child { display: flex; justify-content: flex-end; width: 100%; border-top: 1px solid #f1f5f9; padding-top: 10px; margin-top: 5px; }

    
    .dashboard-grid-split .btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    
    .orbit-fab {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}
