@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600&family=DM+Sans:ital,wght@0,400;0,500;1,400&display=swap');

/* ─── Reset & Variables ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --nav-bg:       #0E2A4A;
    --nav-hover:    #1A3D6B;
    --nav-active:   #1E4D84;
    --accent:       #2196F3;
    --accent-dark:  #1565C0;
    --accent-light: #E3F2FD;
    --bg:           #F0F4F9;
    --card:         #ffffff;
    --border:       #DDE4EF;
    --text:         #1a2940;
    --text-muted:   #6B7FA3;
    --danger:       #E53935;
    --success:      #43A047;
    --warning:      #FB8C00;
    --font-head:    'Sora', sans-serif;
    --font-body:    'DM Sans', sans-serif;
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 2px 12px rgba(0,0,0,0.07);
    --sidebar-w:    230px;
    --topbar-h:     56px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--nav-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-logo .org {
    font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
    text-transform: uppercase; color: rgba(255,255,255,0.4);
    font-family: var(--font-head);
}
.sidebar-logo .section-name {
    font-size: 13px; font-weight: 600; color: #fff;
    margin-top: 4px; line-height: 1.3;
    font-family: var(--font-head);
}
.sidebar-logo .badge {
    display: inline-block; margin-top: 8px;
    background: var(--accent); color: #fff;
    font-size: 9px; font-weight: 700; padding: 2px 8px;
    border-radius: 20px; letter-spacing: 0.05em;
    font-family: var(--font-head);
}

.nav-section { padding: 10px 0 4px; }
.nav-label {
    font-size: 9px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase; color: rgba(255,255,255,0.3);
    padding: 0 20px 6px;
    font-family: var(--font-head);
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px;
    font-size: 13px; font-weight: 500;
    color: rgba(255,255,255,0.6);
    border-left: 3px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
}
.nav-item:hover {
    background: var(--nav-hover);
    color: #fff;
    text-decoration: none;
}
.nav-item.active {
    background: var(--nav-active);
    color: #fff;
    border-left-color: var(--accent);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }
.nav-count {
    margin-left: auto;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.65);
    font-size: 10px; padding: 1px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    bottom: 0;
    background: var(--nav-bg);
    z-index: 2;
}
.user-row { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #1E4D84;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #7EB8F9;
    flex-shrink: 0; font-family: var(--font-head);
}
.user-name  { font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,0.85); }
.user-role  { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }

/* ─── Sidebar toggle button ─── */
.sidebar-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; flex-shrink: 0;
    background: transparent; border: none; border-radius: var(--radius-sm);
    cursor: pointer; color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.sidebar-toggle svg { width: 18px; height: 18px; pointer-events: none; }

/* ─── Sidebar collapse transition ─── */
.sidebar { transition: transform 0.25s ease; }
.shell.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.shell.sidebar-collapsed .main  { margin-left: 0; }

/* ─── Main content area ─── */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* ─── Top bar ─── */
.topbar {
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-title {
    font-family: var(--font-head);
    font-size: 15px; font-weight: 600;
    color: var(--text); flex: 1;
}
.topbar-date { font-size: 12px; color: var(--text-muted); }

/* ─── Page Content ─── */
.content { padding: 28px; flex: 1; }
.page-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-title {
    font-family: var(--font-head);
    font-size: 20px; font-weight: 600; color: var(--text);
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ─── Section heading ─── */
.section-heading {
    font-family: var(--font-head);
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--text-muted);
    margin-bottom: 12px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-body); font-size: 13px; font-weight: 500;
    padding: 8px 16px; border-radius: var(--radius-sm);
    border: none; cursor: pointer; transition: all 0.15s;
    text-decoration: none;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost    { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover  { background: var(--bg); color: var(--text); text-decoration: none; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c62828; color: #fff; text-decoration: none; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ─── Cards ─── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.card-title {
    font-family: var(--font-head);
    font-size: 13px; font-weight: 600; color: var(--text);
}
.card-link { font-size: 12px; color: var(--accent); font-weight: 500; }

/* ─── Stat Cards ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative; overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none; display: block; color: inherit;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
}
.stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--stat-color, var(--accent));
}
.stat-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--stat-bg, var(--accent-light));
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 10px;
}
.stat-icon img, .stat-icon svg { width: 16px; height: 16px; }
.stat-num {
    font-family: var(--font-head);
    font-size: 24px; font-weight: 600; color: var(--text);
    line-height: 1;
}
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-delta { font-size: 10px; color: var(--success); margin-top: 5px; font-weight: 600; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
    text-align: left; padding: 10px 14px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F5F8FF; }
tbody td { padding: 11px 14px; font-size: 13px; vertical-align: middle; }
.uid-badge {
    font-family: monospace; font-size: 11px; color: var(--text-muted);
    background: var(--bg); padding: 2px 6px; border-radius: 4px;
}

/* ─── Platform Pills ─── */
.pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; font-weight: 700; padding: 3px 8px;
    border-radius: 20px; white-space: nowrap;
    font-family: var(--font-head); letter-spacing: 0.03em;
}
.pill-yt    { background: #FFEBEE; color: #C62828; }
.pill-fb    { background: #E8F0FE; color: #1565C0; }
.pill-ig    { background: #FCE4EC; color: #AD1457; }
.pill-tiktok { background: #F5F5F5; color: #111111; }
.pill-x     { background: #F3E5F5; color: #6A1B9A; }
.pill-blog  { background: #E8F5E9; color: #2E7D32; }

.pill-admin   { background: #FFF3E0; color: #E65100; }
.pill-member  { background: #E3F2FD; color: #1565C0; }
.pill-section-admin { background: #E0F2F1; color: #00695C; }
.pill-viewer  { background: #F3E5F5; color: #6A1B9A; }

.pill-inspection { background: #FFF8E1; color: #F57F17; }
.pill-meeting    { background: #E8F5E9; color: #2E7D32; }
.pill-event      { background: #E8EAF6; color: #283593; }
.pill-other      { background: #ECEFF1; color: #455A64; }

/* ─── Forms ─── */
.form-group { margin-bottom: 18px; }
label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted); margin-bottom: 6px;
    font-family: var(--font-head); letter-spacing: 0.04em;
    text-transform: uppercase;
}
input[type=text], input[type=email], input[type=password],
input[type=date], input[type=url], select, textarea {
    width: 100%; padding: 9px 13px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size: 14px; color: var(--text);
    background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(33,150,243,0.12);
}
textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ─── Alerts / Flashes ─── */
.alert {
    padding: 11px 16px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 8px;
}
.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.alert-error   { background: #FFEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.alert-info    { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #90CAF9; }

/* ─── Album Grid ─── */
.albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.album-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex; flex-direction: column;
}
.album-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.album-thumb {
    height: 130px; background: linear-gradient(135deg, #1E4D84, #2196F3);
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: rgba(255,255,255,0.3);
    position: relative;
}
.album-thumb img { width: 100%; height: 100%; object-fit: cover; }
.album-thumb-overlay {
    position: absolute; bottom: 8px; left: 10px;
}
.album-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.album-uid  { font-family: monospace; font-size: 10px; color: var(--text-muted); }
.album-title { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--text); }
.album-caption { font-size: 12px; color: var(--text-muted); }
.album-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.album-footer {
    padding: 10px 16px; border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}

/* ─── Media Grid ─── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.media-item {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); overflow: hidden;
    transition: transform 0.15s;
}
.media-item:hover { transform: translateY(-1px); }
.media-thumb {
    height: 120px; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-info { padding: 8px 10px; }
.media-uid   { font-family: monospace; font-size: 9px; color: var(--text-muted); }
.media-caption { font-size: 11px; font-weight: 500; color: var(--text); margin-top: 2px; }

/* ─── Login Page ─── */
.login-bg {
    min-height: 100vh;
    background: var(--nav-bg);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-box {
    background: #fff; border-radius: 14px;
    padding: 40px 44px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
    text-align: center; margin-bottom: 32px;
}
.login-logo .org-name {
    font-family: var(--font-head); font-size: 11px; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-muted);
}
.login-logo h1 {
    font-family: var(--font-head); font-size: 22px; font-weight: 600;
    color: var(--text); margin-top: 6px;
}
.login-logo .sub {
    font-size: 13px; color: var(--text-muted); margin-top: 4px;
}
.login-logo .bar {
    width: 40px; height: 3px; background: var(--accent);
    margin: 12px auto 0; border-radius: 2px;
}

/* ─── Activity Feed (dashboard) ─── */
.feed-list { list-style: none; }
.feed-item {
    display: flex; gap: 12px; padding: 11px 20px;
    border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); margin-top: 5px; flex-shrink: 0;
}
.feed-body { flex: 1; }
.feed-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.feed-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.feed-link { font-size: 11px; color: var(--accent); font-weight: 500; }

/* ─── Pagination ─── */
.pagination { display: flex; gap: 6px; margin-top: 20px; }
.page-btn {
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); font-size: 12px;
    background: var(--card); color: var(--text-muted);
    cursor: pointer; text-decoration: none; transition: all 0.1s;
}
.page-btn.active, .page-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

/* ─── Utilities ─── */
.flex        { display: flex; }
.items-center { align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); font-size: 12px; }
.text-danger { color: var(--danger); }
.text-right  { text-align: right; }
.w-full      { width: 100%; }
.two-col     { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel       { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.empty-state {
    text-align: center; padding: 60px 20px;
    color: var(--text-muted); font-size: 14px;
}
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main    { margin-left: 0; }
    .form-row { grid-template-columns: 1fr; }
    .two-col  { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
