/* ═══════════════════════════════════════
   PAKClub Admin Panel - Styles
   Theme: Dark with Gold/Orange accents
   ═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a25;
    --border: rgba(255,165,0,0.12);
    --border-subtle: rgba(255,255,255,0.06);
    --text-primary: #f0f0f0;
    --text-secondary: #999;
    --text-muted: #666;
    --accent: #FFA500;
    --accent-hover: #FF8C00;
    --accent-glow: rgba(255,165,0,0.15);
    --gradient: linear-gradient(135deg, #FFA500, #FF6B00);
    --danger: #ff1744;
    --success: #00c853;
    --warning: #FFB300;
    --info: #00B0FF;
    --sidebar-w: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family:'Inter',sans-serif;
    background:var(--bg-primary);
    color:var(--text-primary);
    min-height:100vh;
    overflow-x:hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--bg-secondary); }
::-webkit-scrollbar-thumb { background:var(--accent); border-radius:3px; }

/* ── Login Page ── */
.login-page {
    min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px;
    background-image: radial-gradient(ellipse at 20% 50%, rgba(255,165,0,0.08) 0%, transparent 50%),
                      radial-gradient(ellipse at 80% 20%, rgba(255,69,0,0.06) 0%, transparent 50%);
}
.login-card {
    background:linear-gradient(145deg,#13131a,#1a1a25);
    border:1px solid var(--border);
    border-radius:20px; padding:45px 40px; width:100%; max-width:420px;
    box-shadow:0 20px 60px rgba(0,0,0,0.5);
    animation: fadeUp 0.6s ease;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.login-card .logo { text-align:center; margin-bottom:35px; }
.login-card .logo h1 {
    font-size:32px; font-weight:900;
    background:var(--gradient); -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.login-card .logo p { color:var(--text-secondary); font-size:14px; margin-top:6px; }

/* ── Form Elements ── */
.form-group { margin-bottom:20px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--text-secondary); margin-bottom:8px; }
.form-group input, .form-group select, .form-group textarea {
    width:100%; padding:13px 16px; background:var(--bg-input); border:1px solid var(--border-subtle);
    border-radius:var(--radius-sm); color:var(--text-primary); font-size:14px; font-family:inherit;
    transition:var(--transition); outline:none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow);
}
.form-group textarea { resize:vertical; min-height:80px; }
.form-group .hint { font-size:11px; color:var(--text-muted); margin-top:5px; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }

/* ── Buttons ── */
.btn {
    display:inline-flex; align-items:center; gap:8px; padding:12px 24px;
    border:none; border-radius:var(--radius-sm); font-size:14px; font-weight:600;
    cursor:pointer; transition:var(--transition); font-family:inherit; text-decoration:none;
}
.btn-primary { background:var(--gradient); color:#fff; }
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 8px 25px rgba(255,165,0,0.3); }
.btn-secondary { background:rgba(255,255,255,0.06); color:var(--text-primary); border:1px solid var(--border-subtle); }
.btn-secondary:hover { background:rgba(255,255,255,0.1); }
.btn-danger { background:rgba(255,23,68,0.15); color:var(--danger); border:1px solid rgba(255,23,68,0.2); }
.btn-danger:hover { background:rgba(255,23,68,0.25); }
.btn-success { background:rgba(0,200,83,0.15); color:var(--success); }
.btn-sm { padding:8px 16px; font-size:12px; }
.btn-block { width:100%; justify-content:center; }
.btn:disabled { opacity:0.5; cursor:not-allowed; transform:none !important; }

/* ── Layout ── */
.admin-layout { display:flex; min-height:100vh; }

/* ── Sidebar ── */
.sidebar {
    width:var(--sidebar-w); background:var(--bg-secondary); border-right:1px solid var(--border);
    display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:100;
    transition:var(--transition);
}
.sidebar-header {
    padding:24px 20px; border-bottom:1px solid var(--border);
}
.sidebar-header h1 {
    font-size:22px; font-weight:900;
    background:var(--gradient); -webkit-background-clip:text; -webkit-text-fill-color:transparent;
}
.sidebar-header span { font-size:11px; color:var(--text-muted); }
.sidebar-nav { flex:1; padding:16px 12px; overflow-y:auto; }
.nav-item {
    display:flex; align-items:center; gap:12px; padding:12px 16px;
    border-radius:var(--radius-sm); color:var(--text-secondary); cursor:pointer;
    transition:var(--transition); font-size:14px; font-weight:500; margin-bottom:4px;
    border:1px solid transparent;
}
.nav-item:hover { background:rgba(255,255,255,0.04); color:var(--text-primary); }
.nav-item.active {
    background:var(--accent-glow); color:var(--accent);
    border-color:rgba(255,165,0,0.2);
}
.nav-item .icon { font-size:18px; width:24px; text-align:center; }
.nav-section { font-size:10px; font-weight:700; color:var(--text-muted); padding:16px 16px 8px; text-transform:uppercase; letter-spacing:1.5px; }
.sidebar-footer {
    padding:16px 12px; border-top:1px solid var(--border);
}

/* ── Main Content ── */
.main-content {
    flex:1; margin-left:var(--sidebar-w); padding:30px;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(255,165,0,0.03) 0%, transparent 50%);
}

/* ── Page Header ── */
.page-header {
    display:flex; align-items:center; justify-content:space-between; margin-bottom:30px;
    flex-wrap:wrap; gap:16px;
}
.page-header h2 { font-size:26px; font-weight:800; }
.page-header p { color:var(--text-secondary); font-size:14px; margin-top:4px; }
.header-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* ── Cards ── */
.card {
    background:var(--bg-card); border:1px solid var(--border-subtle);
    border-radius:var(--radius); padding:24px; margin-bottom:20px;
    transition:var(--transition);
}
.card:hover { border-color:var(--border); }
.card-title { font-size:16px; font-weight:700; margin-bottom:16px; display:flex; align-items:center; gap:10px; }

/* ── Stat Cards ── */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:30px; }
.stat-card {
    background:var(--bg-card); border:1px solid var(--border-subtle);
    border-radius:var(--radius); padding:24px; position:relative; overflow:hidden;
    transition:var(--transition);
}
.stat-card:hover { border-color:var(--border); transform:translateY(-3px); box-shadow:0 10px 30px rgba(0,0,0,0.3); }
.stat-card .stat-icon { font-size:28px; margin-bottom:12px; }
.stat-card .stat-value { font-size:32px; font-weight:800; background:var(--gradient); -webkit-background-clip:text; -webkit-text-fill-color:transparent; }
.stat-card .stat-label { font-size:13px; color:var(--text-secondary); margin-top:4px; }
.stat-card::after {
    content:''; position:absolute; top:0; right:0; width:80px; height:80px;
    background:radial-gradient(circle, var(--accent-glow), transparent 70%);
    border-radius:50%; transform:translate(30%,-30%);
}

/* ── App Grid ── */
.app-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:20px; }
.app-card {
    background:var(--bg-card); border:1px solid var(--border-subtle);
    border-radius:var(--radius); overflow:hidden; transition:var(--transition);
    position:relative;
}
.app-card:hover { border-color:var(--border); transform:translateY(-3px); box-shadow:0 12px 35px rgba(0,0,0,0.3); }
.app-card-header { padding:20px; display:flex; align-items:center; gap:16px; }
.app-card-logo {
    width:56px; height:56px; border-radius:14px; object-fit:cover;
    background:var(--bg-input); border:2px solid var(--border);
    display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0;
}
.app-card-logo img { width:100%; height:100%; border-radius:12px; object-fit:cover; }
.app-card-info h3 { font-size:16px; font-weight:700; margin-bottom:4px; }
.app-card-info .pkg { font-size:12px; color:var(--text-muted); font-family:monospace; word-break:break-all; }
.app-card-body { padding:0 20px 16px; }
.app-card-meta { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.app-meta-item { font-size:11px; padding:4px 10px; border-radius:20px; background:rgba(255,255,255,0.04); color:var(--text-secondary); }
.app-card-actions { display:flex; gap:8px; padding:16px 20px; border-top:1px solid var(--border-subtle); }
.app-card-actions .btn { flex:1; justify-content:center; }

/* Status badges */
.badge {
    display:inline-flex; align-items:center; gap:4px; padding:4px 10px;
    border-radius:20px; font-size:11px; font-weight:600;
}
.badge-active { background:rgba(0,200,83,0.12); color:var(--success); }
.badge-inactive { background:rgba(255,23,68,0.12); color:var(--danger); }
.badge-maintenance { background:rgba(255,179,0,0.12); color:var(--warning); }

/* ── Modal ── */
.modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.7); backdrop-filter:blur(8px);
    display:flex; align-items:center; justify-content:center; z-index:1000;
    opacity:0; visibility:hidden; transition:var(--transition); padding:20px;
}
.modal-overlay.active { opacity:1; visibility:visible; }
.modal {
    background:var(--bg-card); border:1px solid var(--border);
    border-radius:16px; width:100%; max-width:700px; max-height:90vh;
    overflow-y:auto; transform:scale(0.9); transition:var(--transition);
    box-shadow:0 30px 80px rgba(0,0,0,0.6);
}
.modal-overlay.active .modal { transform:scale(1); }
.modal-header {
    display:flex; align-items:center; justify-content:space-between;
    padding:24px 28px; border-bottom:1px solid var(--border-subtle); position:sticky; top:0;
    background:var(--bg-card); z-index:1;
}
.modal-header h3 { font-size:20px; font-weight:700; }
.modal-close {
    width:36px; height:36px; border-radius:50%; border:1px solid var(--border-subtle);
    background:transparent; color:var(--text-secondary); cursor:pointer; font-size:18px;
    display:flex; align-items:center; justify-content:center; transition:var(--transition);
}
.modal-close:hover { background:rgba(255,23,68,0.1); color:var(--danger); border-color:var(--danger); }
.modal-body { padding:28px; }
.modal-footer { padding:20px 28px; border-top:1px solid var(--border-subtle); display:flex; justify-content:flex-end; gap:10px; }

/* ── Tabs ── */
.tabs { display:flex; gap:4px; margin-bottom:24px; border-bottom:1px solid var(--border-subtle); padding-bottom:0; }
.tab {
    padding:10px 20px; cursor:pointer; font-size:13px; font-weight:600;
    color:var(--text-secondary); border-bottom:2px solid transparent;
    transition:var(--transition);
}
.tab:hover { color:var(--text-primary); }
.tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.tab-panel { display:none; }
.tab-panel.active { display:block; animation: fadeUp 0.3s ease; }

/* ── Upload Zone ── */
.upload-zone {
    border:2px dashed var(--border); border-radius:var(--radius);
    padding:30px; text-align:center; cursor:pointer; transition:var(--transition);
    position:relative; overflow:hidden;
}
.upload-zone:hover, .upload-zone.dragover { border-color:var(--accent); background:var(--accent-glow); }
.upload-zone .upload-icon { font-size:40px; margin-bottom:10px; }
.upload-zone p { color:var(--text-secondary); font-size:13px; }
.upload-zone input[type="file"] { position:absolute; inset:0; opacity:0; cursor:pointer; }
.upload-preview { margin-top:16px; }
.upload-preview img { max-width:120px; max-height:120px; border-radius:var(--radius-sm); border:2px solid var(--border); }
.upload-progress { margin-top:12px; }
.progress-bar { width:100%; height:8px; background:var(--bg-input); border-radius:4px; overflow:hidden; }
.progress-fill { height:100%; background:var(--gradient); border-radius:4px; transition:width 0.3s ease; width:0%; }
.progress-text { font-size:12px; color:var(--accent); margin-top:6px; font-weight:600; }

/* ── Table ── */
.table-wrapper { overflow-x:auto; }
table { width:100%; border-collapse:collapse; }
th { text-align:left; padding:12px 16px; font-size:12px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:1px; border-bottom:1px solid var(--border-subtle); }
td { padding:12px 16px; font-size:13px; border-bottom:1px solid var(--border-subtle); }
tr:hover td { background:rgba(255,255,255,0.02); }

/* ── Toggle Switch ── */
.toggle { position:relative; width:44px; height:24px; cursor:pointer; }
.toggle input { display:none; }
.toggle-slider {
    position:absolute; inset:0; background:var(--bg-input); border:1px solid var(--border-subtle);
    border-radius:12px; transition:var(--transition);
}
.toggle-slider::before {
    content:''; position:absolute; width:18px; height:18px; border-radius:50%;
    background:#fff; top:2px; left:3px; transition:var(--transition);
}
.toggle input:checked + .toggle-slider { background:var(--accent); border-color:var(--accent); }
.toggle input:checked + .toggle-slider::before { transform:translateX(19px); }

/* ── Search Bar ── */
.search-bar {
    display:flex; align-items:center; gap:10px; background:var(--bg-input);
    border:1px solid var(--border-subtle); border-radius:var(--radius-sm);
    padding:0 16px; transition:var(--transition); max-width:350px;
}
.search-bar:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-glow); }
.search-bar input { flex:1; border:none; background:none; padding:12px 0; color:var(--text-primary); font-size:14px; outline:none; }
.search-bar .search-icon { color:var(--text-muted); font-size:16px; }

/* ── Toast Notifications ── */
.toast-container { position:fixed; top:20px; right:20px; z-index:9999; display:flex; flex-direction:column; gap:10px; }
.toast {
    padding:14px 20px; border-radius:var(--radius-sm); font-size:13px; font-weight:500;
    min-width:300px; max-width:420px; display:flex; align-items:center; gap:10px;
    animation:slideIn 0.4s ease; box-shadow:0 10px 30px rgba(0,0,0,0.4);
}
@keyframes slideIn { from{opacity:0;transform:translateX(50px)} to{opacity:1;transform:translateX(0)} }
.toast-success { background:linear-gradient(135deg,#0a2e1a,#0d3320); border:1px solid rgba(0,200,83,0.3); color:var(--success); }
.toast-error { background:linear-gradient(135deg,#2e0a14,#330d18); border:1px solid rgba(255,23,68,0.3); color:var(--danger); }
.toast-info { background:linear-gradient(135deg,#0a1e2e,#0d2333); border:1px solid rgba(0,176,255,0.3); color:var(--info); }

/* ── Pagination ── */
.pagination { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:24px; }
.page-btn {
    padding:8px 14px; border-radius:var(--radius-sm); border:1px solid var(--border-subtle);
    background:var(--bg-card); color:var(--text-secondary); cursor:pointer; font-size:13px;
    transition:var(--transition);
}
.page-btn:hover { border-color:var(--accent); color:var(--accent); }
.page-btn.active { background:var(--accent); color:#fff; border-color:var(--accent); }

/* ── Toolbar ── */
.toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; flex-wrap:wrap; gap:12px; }
.filter-group { display:flex; gap:8px; flex-wrap:wrap; }
.filter-btn {
    padding:8px 16px; border-radius:20px; border:1px solid var(--border-subtle);
    background:transparent; color:var(--text-secondary); cursor:pointer; font-size:12px;
    font-weight:600; transition:var(--transition);
}
.filter-btn:hover, .filter-btn.active { border-color:var(--accent); color:var(--accent); background:var(--accent-glow); }

/* ── Empty State ── */
.empty-state { text-align:center; padding:60px 20px; }
.empty-state .empty-icon { font-size:64px; margin-bottom:16px; opacity:0.3; }
.empty-state h3 { font-size:20px; margin-bottom:8px; color:var(--text-secondary); }
.empty-state p { font-size:14px; color:var(--text-muted); margin-bottom:24px; }

/* ── Settings Grid ── */
.settings-grid { display:grid; gap:16px; }
.setting-item {
    display:flex; align-items:center; justify-content:space-between; gap:20px;
    padding:16px 20px; background:rgba(255,255,255,0.02); border-radius:var(--radius-sm);
    border:1px solid var(--border-subtle);
}
.setting-info { flex:1; }
.setting-info .setting-label { font-size:14px; font-weight:600; margin-bottom:4px; }
.setting-info .setting-desc { font-size:12px; color:var(--text-muted); }
.setting-input { width:300px; }
.setting-input input, .setting-input select { width:100%; padding:10px 14px; background:var(--bg-input); border:1px solid var(--border-subtle); border-radius:var(--radius-sm); color:var(--text-primary); font-size:13px; outline:none; transition:var(--transition); }
.setting-input input:focus { border-color:var(--accent); }

/* ── Confirm Dialog ── */
.confirm-dialog { text-align:center; }
.confirm-dialog .confirm-icon { font-size:48px; margin-bottom:16px; }
.confirm-dialog h3 { margin-bottom:8px; }
.confirm-dialog p { color:var(--text-secondary); font-size:14px; margin-bottom:24px; }
.confirm-actions { display:flex; gap:10px; justify-content:center; }

/* ── Mobile Sidebar Toggle ── */
.mobile-toggle {
    display:none; position:fixed; top:16px; left:16px; z-index:200;
    width:44px; height:44px; border-radius:12px; background:var(--bg-card);
    border:1px solid var(--border); color:var(--accent); font-size:20px;
    cursor:pointer; align-items:center; justify-content:center;
}

/* ── Responsive ── */
@media(max-width:768px) {
    .mobile-toggle { display:flex; }
    .sidebar { transform:translateX(-100%); }
    .sidebar.open { transform:translateX(0); }
    .main-content { margin-left:0; padding:20px; padding-top:70px; }
    .stats-grid { grid-template-columns:repeat(2,1fr); }
    .app-grid { grid-template-columns:1fr; }
    .form-row { grid-template-columns:1fr; }
    .page-header { flex-direction:column; align-items:flex-start; }
    .setting-item { flex-direction:column; align-items:flex-start; }
    .setting-input { width:100%; }
    .search-bar { max-width:100%; }
    .toolbar { flex-direction:column; }
}

/* ── Loading Spinner ── */
.spinner { width:20px; height:20px; border:2px solid var(--border-subtle); border-top-color:var(--accent); border-radius:50%; animation:spin 0.6s linear infinite; display:inline-block; }
@keyframes spin { to{transform:rotate(360deg)} }

/* ── Skeleton Loading ── */
.skeleton { background:linear-gradient(90deg,var(--bg-input) 25%,rgba(255,255,255,0.05) 50%,var(--bg-input) 75%); background-size:200% 100%; animation:shimmer 1.5s infinite; border-radius:var(--radius-sm); }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Section Headers ── */
.section-header { font-size:14px; font-weight:700; color:var(--accent); margin:24px 0 12px; padding-bottom:8px; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; }

/* ── Copy Button ── */
.copy-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:4px; transition:var(--transition); }
.copy-btn:hover { color:var(--accent); }

/* ── Checkbox ── */
.checkbox { display:flex; align-items:center; gap:8px; cursor:pointer; font-size:13px; }
.checkbox input[type="checkbox"] {
    width:18px; height:18px; accent-color:var(--accent); cursor:pointer;
}
