:root {
    --navy: #0a223c;
    --navy-2: #10355c;
    --accent: #d49b28;
    --bg: #f4f6fa;
    --border: #e3e8ef;
    --sidebar-w: 240px;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: #1e293b;
    font-size: 0.93rem;
}

.btn-primary { background: var(--navy-2); border-color: var(--navy-2); }
.btn-primary:hover, .btn-primary:focus { background: var(--navy); border-color: var(--navy); }

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

/* Shell */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--navy);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.2s;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-brand img { background: #fff; border-radius: 50%; padding: 2px; }
.sidebar-nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
}
.sidebar-nav a i { width: 18px; text-align: center; opacity: 0.85; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sidebar-nav a.active { background: rgba(212, 155, 40, 0.18); color: #fff; }
.sidebar-nav a.active i { color: var(--accent); }
.sidebar-foot {
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-foot a, .sidebar-foot .btn-link { color: #cbd5e1; text-decoration: none; font-size: 0.88rem; text-align: left; }
.sidebar-foot a:hover, .sidebar-foot .btn-link:hover { color: #fff; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
}
.content { padding: 24px; max-width: 1400px; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.3); }
    .main { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 12px 16px; }
}

/* Cards & tables */
.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    height: 100%;
}
.stat:hover { border-color: var(--navy-2); }
.stat i { font-size: 1.4rem; width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; background: #eef3fa; color: var(--navy-2); }
.stat .num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat .lbl { color: #64748b; font-size: 0.85rem; }

.table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.table { margin-bottom: 0; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table td { vertical-align: middle; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e2e8f0; }
.slug { font-family: ui-monospace, Consolas, monospace; font-size: 0.82rem; color: #475569; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .form-control, .toolbar .form-select { width: auto; min-width: 180px; }
@media (max-width: 575.98px) { .toolbar .form-control, .toolbar .form-select { width: 100%; } }

/* Page editor */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 1199.98px) { .editor-grid { grid-template-columns: minmax(0, 1fr); } }
.editor-side { position: sticky; top: 80px; }
.mode-tabs .nav-link { color: #475569; }
.mode-tabs .nav-link.active { font-weight: 600; color: var(--navy-2); }
.CodeMirror { height: 640px; border: 1px solid var(--border); border-radius: 0 0 8px 8px; font-size: 13px; }
.code-small .CodeMirror { height: 320px; }
.jodit-container { border-radius: 0 0 8px 8px !important; }
.revision { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.revision:last-child { border-bottom: 0; }

/* Navigation editor */
.nav-item-card { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 12px; }
.nav-item-card > .head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; }
.nav-item-card > .children { padding: 0 12px 12px 36px; }
.nav-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.nav-child.sub { padding-left: 28px; }
.nav-child .form-control, .nav-item-card .head .form-control { flex: 1 1 180px; }
.nav-child .form-select { flex: 0 0 140px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

/* Media */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.media-tile { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.media-tile .thumb { aspect-ratio: 4 / 3; background: #f1f5f9 center / cover no-repeat; display: grid; place-items: center; color: #94a3b8; font-size: 2rem; }
.media-tile .meta { padding: 8px 10px; font-size: 0.78rem; word-break: break-all; }
.media-tile.pickable { cursor: pointer; }
.media-tile.pickable:hover { border-color: var(--navy-2); box-shadow: 0 0 0 2px rgba(16, 53, 92, 0.2); }
.dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 24px; text-align: center; color: #64748b; background: #fff; }
.dropzone.drag { border-color: var(--navy-2); background: #eef3fa; }

.empty { text-align: center; color: #64748b; padding: 40px 16px; }
