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

:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --sidebar-bg: #0b0f19;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --text: #0f172a;
    --text-secondary: #475569;
    --muted: #64748b;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --primary-glow: rgba(79, 70, 229, 0.25);
    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --danger: #e11d48;
    --danger-bg: #fff1f2;
    --danger-border: #fecdd3;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 12px 28px -6px rgba(15, 23, 42, 0.08), 0 4px 10px -3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.16);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.05) 0px, transparent 50%);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .page-title, .login-title, .kpi-value {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    letter-spacing: -0.025em;
}

a { color: inherit; text-decoration: none; }

@keyframes pageReveal {
    0% { opacity: 0; transform: translateY(12px) scale(0.993); filter: blur(3px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(18px, -14px) scale(1.04); }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #070a13;
    position: relative;
    overflow: hidden;
}

.login-page::before, .login-page::after {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.42;
    pointer-events: none;
    animation: floatSlow 10s ease-in-out infinite;
}

.login-page::before { background: #4f46e5; top: -120px; left: -100px; }
.login-page::after { background: #0ea5e9; bottom: -140px; right: -80px; animation-delay: -5s; }

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    padding: 40px 36px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
    animation: pageReveal 0.65s var(--ease-out-expo) both;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
    margin: 0 auto 14px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-title { margin: 0 0 6px; font-size: 25px; font-weight: 800; text-align: center; color: #0f172a; }
.login-subtitle { margin: 0 0 26px; font-size: 13.5px; color: var(--text-secondary); text-align: center; }

.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 268px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #0b0f19 0%, #111827 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--sidebar-border);
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    padding: 4px 10px 18px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 16px;
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #6366f1 0%, #3b82f6 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
}

.brand span.accent {
    background: linear-gradient(135deg, #818cf8, #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta { min-width: 0; flex: 1; }
.user-box .user-name { font-weight: 600; font-size: 13px; color: #f8fafc; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-box .user-role {
    display: inline-block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.22);
    color: #a5b4fc;
}

.nav-section-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0 12px;
    margin: 6px 0 8px;
}

.nav-list { display: flex; flex-direction: column; gap: 3px; }

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 13px;
    border-radius: 10px;
    color: #94a3b8;
    font-weight: 500;
    font-size: 13.5px;
    transition: all 0.2s var(--ease-smooth);
    position: relative;
}

.nav-link:hover { background: var(--sidebar-hover); color: #f8fafc; transform: translateX(3px); }

.nav-link.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.24) 0%, rgba(79, 70, 229, 0.06) 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    height: 56%;
    width: 3.5px;
    border-radius: 0 4px 4px 0;
    background: #818cf8;
}

.nav-pill-count {
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    padding: 1px 7px;
    border-radius: 999px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(225, 29, 72, 0.12);
    border: 1px solid rgba(225, 29, 72, 0.22);
    color: #fda4af;
    font-weight: 600;
    font-size: 13px;
    margin-top: 16px;
    transition: all 0.2s var(--ease-smooth);
}

.logout-btn:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 62px;
    padding: 0 32px;
    background: rgba(246, 248, 251, 0.82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.breadcrumb strong { color: var(--text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 999px;
    box-shadow: var(--shadow-xs);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.main-content {
    flex: 1;
    min-width: 0;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px 44px;
    animation: pageReveal 0.52s var(--ease-out-expo) both;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
}

.page-title { margin: 0; font-size: 24px; font-weight: 800; color: var(--text); }
.btn-group { display: flex; flex-wrap: wrap; gap: 10px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    transition: box-shadow 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth);
}

.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card-title { margin: 0 0 16px; font-size: 16px; font-weight: 700; color: var(--text); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}

.kpi-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #818cf8);
}

.kpi-card.indigo::after { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.kpi-card.green::after { background: linear-gradient(90deg, #059669, #34d399); }
.kpi-card.amber::after { background: linear-gradient(90deg, #d97706, #fbbf24); }
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.kpi-label { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-value { font-size: 30px; font-weight: 800; margin-top: 8px; color: var(--text); line-height: 1.15; }
.kpi-sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dashboard-split, .sidebar-split { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 22px; align-items: start; }

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }

.form-control, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-textarea { min-height: 150px; resize: vertical; line-height: 1.65; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filter-bar .search-input { flex: 1; min-width: 220px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%); color: #fff; box-shadow: 0 4px 12px var(--primary-glow); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px var(--primary-glow); }
.btn-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; }
.btn-success:hover { transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); color: #fff; }
.btn-danger:hover { transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; border-color: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #e2e8f0; color: #0f172a; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.table-wrap { width: 100%; overflow-x: auto; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f8fafc; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: #64748b; letter-spacing: 0.05em; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-published { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-scheduled { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-draft { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-admin { background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-manager { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-staff { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.badge-cat { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-tag { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; }

.alert {
    padding: 13px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13.5px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: pageReveal 0.4s var(--ease-out-expo) both;
}

.alert-error { background: var(--danger-bg); color: #9f1239; border: 1px solid var(--danger-border); }
.alert-success { background: var(--success-bg); color: #065f46; border: 1px solid var(--success-border); }

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.media-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s var(--ease-out-expo), box-shadow 0.25s var(--ease-out-expo);
}
.media-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.media-thumb { width: 100%; height: 145px; object-fit: cover; border-radius: 8px; background: #f1f5f9; margin-bottom: 10px; }
.media-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 10px; }
.media-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.action-links { display: flex; gap: 12px; justify-content: flex-end; }
.text-link-blue { color: var(--primary); font-weight: 600; font-size: 12.5px; }
.text-link-blue:hover { text-decoration: underline; }
.text-link-red { color: var(--danger); font-weight: 600; font-size: 12.5px; }
.text-link-red:hover { text-decoration: underline; }
.muted { color: var(--text-secondary); font-size: 12.5px; }

.mobile-bar {
    display: none;
    background: #0b0f19;
    color: #fff;
    padding: 13px 18px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 7px 13px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.toast-banner {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s var(--ease-out-expo);
    pointer-events: none;
}

.toast-banner.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1080px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-split, .sidebar-split { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .mobile-bar { display: flex; }
    .topbar { display: none; }
    .sidebar { display: none; position: static; height: auto; width: 100%; }
    .sidebar.open { display: flex; }
    .main-content { padding: 18px 16px 32px; }
    .kpi-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media print {
    .no-print, .sidebar, .topbar, .mobile-bar { display: none !important; }
    body { background: #fff; }
}
