/* ================================================================
   CYBER CAFE PORTAL — BEAUTIFUL DESIGN SYSTEM
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    --bg: #f8fafc;
    --bg-alt: #f1f5f9;
    --card: #ffffff;
    --text: #0f172a;
    --text-soft: #475569;
    --muted: #94a3b8;
    --border: #e2e8f0;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-danger:  linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
    --shadow-xl: 0 24px 64px rgba(15, 23, 42, 0.16);
    --shadow-primary: 0 12px 32px rgba(99, 102, 241, 0.28);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    min-height: 100vh;
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    padding-top: 20px;
    position: fixed;
    width: 260px;
    left: 0; top: 0;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
    z-index: 100;
    overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.sidebar .brand {
    color: #fff;
    font-weight: 800;
    padding: 14px 24px 18px;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 22px;
    letter-spacing: -0.02em;
}
.sidebar .brand i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.8rem;
}
.sidebar .nav-link {
    color: rgba(255,255,255,0.55);
    padding: 11px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    font-size: 13.5px;
    border-left: 3px solid transparent;
    transition: var(--transition);
    position: relative;
}
.sidebar .nav-link i {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}
.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-left-color: rgba(139, 92, 246, 0.5);
}
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99,102,241,0.25) 0%, rgba(139,92,246,0.1) 100%);
    border-left-color: var(--primary-light);
    font-weight: 600;
}
.sidebar .nav-link.active::after {
    content: '';
    position: absolute;
    right: 18px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 12px var(--primary-light);
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

/* ==================== HEADINGS ==================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.02em;
}
h4 { font-size: 1.5rem; }

/* ==================== CARDS ==================== */
.card-box, .filter-card, .table-card {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.card-box:hover, .table-card:hover {
    box-shadow: var(--shadow-md);
}

/* ==================== STATS GRID ==================== */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}
.summary-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.summary-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
    border-radius: 4px;
}
.summary-card.primary::before { background: var(--gradient-primary); }
.summary-card.success::before { background: var(--gradient-success); }
.summary-card.warning::before { background: var(--gradient-warning); }
.summary-card.danger::before  { background: var(--gradient-danger); }
.summary-card.info::before    { background: linear-gradient(135deg, #06b6d4, #22d3ee); }

.summary-card .num {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1.1;
}
.summary-card .lbl {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-top: 4px;
}
.summary-card i.bg-icon {
    position: absolute;
    right: 16px; top: 16px;
    font-size: 2.4rem;
    opacity: 0.07;
}

/* ==================== BUTTONS ==================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 9px 20px;
    font-size: 13.5px;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.25);
}
.btn-primary:hover {
    color: #fff;
    box-shadow: var(--shadow-primary);
}
.btn-success {
    background: var(--gradient-success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}
.btn-success:hover { color: #fff; box-shadow: 0 8px 22px rgba(16,185,129,0.4); }
.btn-danger {
    background: var(--gradient-danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239,68,68,0.25);
}
.btn-danger:hover { color: #fff; box-shadow: 0 8px 22px rgba(239,68,68,0.4); }
.btn-warning {
    background: var(--gradient-warning);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245,158,11,0.25);
}
.btn-warning:hover { color: #fff; box-shadow: 0 8px 22px rgba(245,158,11,0.4); }

.btn-outline-primary { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }
.btn-outline-secondary { border: 2px solid var(--border); color: var(--text-soft); background: #fff; }
.btn-outline-secondary:hover { background: var(--bg-alt); color: var(--text); }
.btn-outline-success { border: 2px solid var(--success); color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-outline-warning { border: 2px solid var(--warning); color: var(--warning); background: transparent; }
.btn-outline-warning:hover { background: var(--warning); color: #fff; }
.btn-outline-danger { border: 2px solid var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

/* ==================== FORM CONTROLS ==================== */
.form-control, .form-select {
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    font-size: 14px;
    transition: var(--transition);
    background: #fff;
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.12);
    outline: none;
}
.form-label { font-weight: 600; color: var(--text-soft); font-size: 13px; margin-bottom: 6px; }

/* ==================== BADGES ==================== */
.badge-status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-objection { background: #fee2e2; color: #991b1b; }

/* ==================== SUB ROW ==================== */
.sub-row {
    padding: 20px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
    flex-wrap: wrap;
    gap: 14px;
    background: #fff;
}
.sub-row:last-child { border-bottom: none; }
.sub-row:hover { background: #fafbff; }

.sub-row .avatar {
    width: 46px; height: 46px;
    border-radius: 14px;
    background: var(--gradient-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99,102,241,0.25);
}

.preview-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 4px 11px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    font-size: 12.5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.preview-item .lbl {
    color: var(--muted);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 5px;
}
.preview-item .val { color: var(--text); font-weight: 600; }

/* ==================== MODAL ==================== */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}
.modal-header {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    padding: 22px 26px;
}
.modal-header .btn-close { filter: invert(1); opacity: 0.9; }
.modal-title { font-weight: 800; display: flex; align-items: center; gap: 10px; font-size: 1.1rem; }
.modal-body { padding: 26px; }
.modal-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 16px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ==================== DATA GRID (modal) ==================== */
.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.data-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 13px 16px;
    border-left: 3px solid var(--primary);
}
.data-item .lbl {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 5px;
}
.data-item .val {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    word-break: break-word;
}
.data-item .val.null { color: #cbd5e1; font-style: italic; font-weight: 500; }

/* ==================== FILE PREVIEW ==================== */
.file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid var(--border);
    margin-top: 6px;
}
.file-preview img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.file-preview a {
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.file-preview a:hover { text-decoration: underline; }

/* ==================== REMARK BOXES ==================== */
.remark-box {
    padding: 15px 18px;
    border-radius: 12px;
    margin-top: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 14px;
    border-left: 4px solid;
}
.remark-box.objection { background: #fef2f2; border-color: var(--danger); color: #7f1d1d; }
.remark-box.approved  { background: #f0fdf4; border-color: var(--success); color: #14532d; }
.remark-box.pending   { background: #fffbeb; border-color: var(--warning); color: #78350f; }
.remark-box i { font-size: 1.15rem; margin-top: 2px; }
.remark-box strong { display: block; margin-bottom: 4px; font-weight: 700; }

/* ==================== TABLE ==================== */
.table { margin: 0; }
.table thead th {
    background: var(--bg-alt);
    border-bottom: 2px solid var(--border);
    font-weight: 700;
    color: var(--text-soft);
    padding: 14px 18px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.table tbody td {
    padding: 15px 18px;
    vertical-align: middle;
    border-color: var(--border);
    font-size: 13.5px;
}

/* ==================== FLASH ALERTS ==================== */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 14px 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #f0fdf4; color: #14532d; border-left: 4px solid var(--success); }
.alert-danger  { background: #fef2f2; color: #7f1d1d; border-left: 4px solid var(--danger); }
.alert-warning { background: #fffbeb; color: #78350f; border-left: 4px solid var(--warning); }
.alert-info    { background: #eff6ff; color: #1e3a8a; border-left: 4px solid var(--info); }

/* ==================== EMPTY STATE ==================== */
.empty-state, .empty {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 60px 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.empty-state i, .empty i { font-size: 4rem; color: #cbd5e1; }
.empty-state h5, .empty h5 { margin-top: 20px; color: var(--text); font-weight: 800; }
.empty-state p, .empty p { color: var(--muted); }

/* ==================== ANIMATIONS ==================== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.card-box, .summary-card, .sub-row, .group-box, .table-card {
    animation: fadeUp 0.4s ease both;
}
.summary-card:nth-child(1) { animation-delay: 0.03s; }
.summary-card:nth-child(2) { animation-delay: 0.06s; }
.summary-card:nth-child(3) { animation-delay: 0.09s; }
.summary-card:nth-child(4) { animation-delay: 0.12s; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { width: 220px; }
    .main-content { margin-left: 220px; padding: 22px; }
}
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 18px; }
    .summary-grid { grid-template-columns: 1fr; }
    .data-grid { grid-template-columns: 1fr; }
}