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

:root {
    --bg-body: #06080a;
    --bg-card: #0d1117;
    --bg-sidebar: #090c10;
    --accent: #e11d2a;
    --accent-soft: rgba(225, 29, 42, 0.1);
    --border: rgba(255, 255, 255, 0.05);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar { width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 15px; position: fixed; height: 100vh; z-index: 1000; overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.sidebar-logo img { height: 32px; }
.sidebar-logo h1 { font-size: 16px; font-weight: 700; letter-spacing: -0.5px; }
.sidebar-logo .version { font-size: 10px; color: var(--text-muted); }

.nav-menu { list-style: none; flex-grow: 1; }
.nav-item { margin-bottom: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: var(--text-muted); text-decoration: none; border-radius: 10px; font-size: 14px; font-weight: 500; transition: 0.2s; cursor: pointer; background: transparent; border: none; width: 100%; text-align: left; }
.nav-link:hover { color: var(--text-main); background-color: var(--accent-soft); }
.nav-link.active { background-color: var(--accent-soft); color: var(--accent); position: relative; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 15%; bottom: 15%; width: 4px; background-color: var(--accent); border-radius: 0 4px 4px 0; }

.pro-card { background: #161b22; border: 1px solid var(--border); border-radius: 12px; padding: 15px; margin-top: auto; border-top: 1px solid rgba(225, 29, 42, 0.3); }
.pro-card-title { font-size: 12px; font-weight: 700; display: block; margin-bottom: 2px; }
.pro-card-subtitle { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; display: block; }
.progress-bar { height: 4px; background: #30363d; border-radius: 10px; margin-bottom: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 72%; }
.progress-text { font-size: 9px; text-align: right; color: var(--text-muted); margin-bottom: 8px; }
.btn-pro { width: 100%; padding: 8px; background: transparent; border: 1px solid var(--border); color: white; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; }

.sidebar-footer { display: none; }

/* Main Content */
.main-wrapper { flex-grow: 1; margin-left: 260px; padding: 20px 25px; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* Topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 15px; }
.topbar-left h2 { font-size: 20px; font-weight: 700; }
.topbar-left span { color: var(--text-muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.search-box { position: relative; width: 260px; }
.search-box input { width: 100%; background: #161b22; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 35px; color: white; font-size: 13px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.notification-bell { font-size: 18px; color: var(--text-muted); position: relative; cursor: pointer; }
.notification-badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: white; font-size: 9px; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg-body); pointer-events: none; }

/* Notifications Dropdown */
.notif-dropdown { position: absolute; top: calc(100% + 15px); right: -10px; width: 320px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5); display: none; flex-direction: column; z-index: 2000; cursor: default; }
.notif-dropdown.active { display: flex; animation: slideIn 0.2s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.notif-header { padding: 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-header h3 { font-size: 14px; font-weight: 600; color: var(--text-main); }

.notif-list { max-height: 350px; overflow-y: auto; display: flex; flex-direction: column; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid var(--border); transition: 0.2s; cursor: pointer; display: flex; gap: 12px; align-items: flex-start; }
.notif-item:hover { background: rgba(255,255,255,0.02); }
.notif-item:last-child { border-bottom: none; }

.notif-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.notif-icon.success { background: rgba(35,134,54,0.1); color: #3fb950; }
.notif-icon.danger { background: rgba(248,81,73,0.1); color: #f85149; }
.notif-icon.info { background: rgba(56,139,253,0.1); color: #58a6ff; }

.notif-content { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.notif-title { font-size: 12px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.notif-footer { padding: 12px; text-align: center; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--accent); cursor: pointer; border-radius: 0 0 12px 12px; }
.notif-footer:hover { background: var(--accent-soft); }
.user-profile { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar { width: 32px; height: 32px; background: #30363d; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-muted); }

/* Dashboard Bento Grid */
.dashboard-container { display: flex; flex-direction: column; gap: 15px; flex: 1; min-height: 0; }
.summary-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; flex-shrink: 0; }
.main-row { display: grid; grid-template-columns: 1fr 340px; gap: 15px; flex: 1; min-height: 0; }
.bottom-row { display: grid; grid-template-columns: 1fr 340px; gap: 15px; flex-shrink: 0; }

/* Cards */
.card-bento { background: var(--bg-card); border: 1px solid var(--border); border-radius: 15px; }

/* Stats Cards */
.stat-card { padding: 12px 15px; position: relative; }
.stat-header { display: flex; align-items: center; gap: 10px; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.stat-title { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; display: block; }
.stat-value { font-size: 18px; font-weight: 700; margin-bottom: 0px; }
.stat-footer { font-size: 10px; font-weight: 600; }
.sparkline { position: absolute; bottom: 10px; right: 10px; width: 60px; height: 25px; }

/* Table */
.card-table { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.card-header { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.card-header h3 { font-size: 15px; font-weight: 600; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.btn-red { background: var(--accent); color: white; border: none; padding: 6px 15px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }

.table-container { flex: 1; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
th { position: sticky; top: 0; background: var(--bg-card); z-index: 10; text-align: left; padding: 12px 20px; font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 10px 20px; font-size: 12px; border-bottom: 1px solid var(--border); }
.badge { padding: 4px 10px; border-radius: 15px; font-size: 10px; font-weight: 700; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.badge-active { background: rgba(35, 134, 54, 0.1); color: #3fb950; }
.badge-used { background: rgba(210, 153, 34, 0.1); color: #d29922; }
.badge-expired { background: rgba(248, 81, 73, 0.12); color: #f85149; }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.pagination { padding: 12px 25px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }
.page-btns { display: flex; gap: 6px; }
.page-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: #161b22; border: 1px solid var(--border); color: white; cursor: pointer; }
.page-btn.active { background: var(--accent); border: none; }

/* Timeline */
.card-activity { display: flex; flex-direction: column; height: 100%; padding: 15px 20px; overflow: hidden; }
.timeline-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; margin-top: 15px; padding-right: 5px; }
.timeline-item { display: flex; gap: 10px; }
.timeline-icon { width: 30px; height: 30px; border-radius: 50%; background: #161b22; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border); }
.timeline-icon.success { color: #3fb950; }
.timeline-icon.danger { color: #f85149; }
.timeline-content { display: flex; flex-direction: column; gap: 2px; }
.timeline-title { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; }
.timeline-time { font-size: 11px; color: var(--text-muted); font-weight: 400; }
.timeline-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* Quick Stats Row */
.card-quick-stats { padding: 12px 15px; }
.quick-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-top: 10px; }
.small-stat { padding-right: 15px; border-right: 1px solid rgba(255,255,255,0.05); }
.small-stat:not(:first-child) { padding-left: 15px; }
.small-stat-title { font-size: 10px; color: var(--text-muted); margin-bottom: 5px; display: block; }
.small-stat-val { font-size: 20px; font-weight: 700; }
.small-stat-sparkline { width: 70px; height: 25px; }

/* Quick Actions Card */
.card-quick-actions { padding: 12px 15px; }
.actions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.action-box { background: #161b22; border: 1px solid #1a2026; border-radius: 10px; padding: 10px 5px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; transition: 0.2s; }
.action-box i { font-size: 14px; color: white; }
.action-box span { font-size: 9px; font-weight: 500; color: var(--text-muted); text-align: center; }
.action-box.active { border-color: rgba(225, 29, 42, 0.3); background: rgba(225, 29, 42, 0.05); }
.action-box.active i { color: var(--accent); }
.action-box:hover { border-color: var(--accent); }

/* Layout Footer */
.developed-by { margin-top: 5px; text-align: center; font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.developed-by span { color: var(--accent); }

/* Sections Visibility */
.section { display: none; height: 100%; }
.section.active { display: flex; flex-direction: column; }
