/* ============================================================================
   App Platform — design system
   Premium dark SaaS: deep navy, glass surfaces, soft blue/lavender accents.
   Shared by the public site and the admin panel.
   ========================================================================== */

:root {
    --bg: #070b14;
    --bg-soft: #0a1020;
    --surface: rgba(148, 163, 198, 0.055);
    --surface-2: rgba(148, 163, 198, 0.09);
    --surface-solid: #0d1424;
    --border: rgba(148, 163, 198, 0.14);
    --border-strong: rgba(148, 163, 198, 0.28);
    --text: #e7ebf4;
    --text-dim: #99a3ba;
    --text-faint: #667089;
    --accent: #6c8cff;
    --accent-soft: rgba(108, 140, 255, 0.14);
    --lavender: #a78bfa;
    --lavender-soft: rgba(167, 139, 250, 0.14);
    --green: #34d399;
    --green-soft: rgba(52, 211, 153, 0.13);
    --red: #f87171;
    --red-soft: rgba(248, 113, 113, 0.12);
    --amber: #fbbf24;
    --amber-soft: rgba(251, 191, 36, 0.12);
    --grad: linear-gradient(135deg, #6c8cff 0%, #a78bfa 100%);
    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 20px;
    --shadow: 0 14px 40px rgba(2, 6, 18, 0.5);
    --shadow-soft: 0 6px 18px rgba(2, 6, 18, 0.35);
    --glow: 0 0 0 1px rgba(108, 140, 255, 0.25), 0 8px 28px rgba(108, 140, 255, 0.16);
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.public {
    background:
        radial-gradient(1100px 500px at 18% -8%, rgba(108, 140, 255, 0.13), transparent 60%),
        radial-gradient(900px 480px at 88% 4%, rgba(167, 139, 250, 0.09), transparent 55%),
        var(--bg);
}

/* Decorative glow behind page content */
.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(700px 340px at 50% -12%, rgba(108, 140, 255, 0.08), transparent 70%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; filter: brightness(1.12); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.4em; font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }

img { max-width: 100%; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.page-main { min-height: calc(100vh - 260px); padding: 26px 22px 60px; }

.icon { width: 17px; height: 17px; flex: 0 0 auto; vertical-align: -3px; }

.muted { color: var(--text-dim); }

/* --------------------------------------------------------------------------
   Top bar
   ------------------------------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 11, 20, 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16.5px; letter-spacing: -0.01em; }
.brand-mark { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.brand-mark svg { width: 21px; height: 21px; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a {
    color: var(--text-dim);
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: color .16s, background .16s;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang-switch { color: var(--text-faint); font-size: 13px; display: inline-flex; gap: 5px; }
.lang-switch a { color: var(--text-faint); font-weight: 600; padding: 3px 4px; }
.lang-switch a.is-active { color: var(--text); text-shadow: 0 0 12px rgba(108, 140, 255, .6); }

/* --------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .08s, filter .16s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: 0 6px 20px rgba(108, 140, 255, 0.28);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 26px rgba(108, 140, 255, 0.38); }
.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger {
    background: var(--red-soft);
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--red);
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* --------------------------------------------------------------------------
   Cards, sections
   ------------------------------------------------------------------------- */
.card {
    background: linear-gradient(180deg, rgba(148, 163, 198, 0.07), rgba(148, 163, 198, 0.03));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.card.pad { padding: 22px; }
.card-title { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.card-subtitle { font-size: 14px; margin-top: 18px; color: var(--text-dim); }

.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-head h2 { font-size: 18px; margin: 0; display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.section-head h2 .icon { color: var(--accent); }
.section-count {
    font-size: 12.5px; color: var(--text-dim);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 999px; padding: 1px 9px;
}
.page-head { margin: 8px 0 26px; }
.page-title { font-size: 27px; margin-bottom: 4px; }
.page-sub { color: var(--text-dim); margin: 0; }

/* --------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero { text-align: center; padding: 58px 10px 34px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(108, 140, 255, 0.3);
    border-radius: 999px;
    padding: 6px 14px;
    margin-bottom: 22px;
}
.hero-title {
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 750;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    background: linear-gradient(120deg, #f2f5fd 30%, #9db1ff 75%, #c4b1ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: 16.5px; color: var(--text-dim); max-width: 640px; margin: 0 auto 30px; }
.hero-search {
    display: flex; align-items: center; gap: 10px;
    max-width: 560px; margin: 0 auto 26px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 7px 8px 7px 18px;
    box-shadow: var(--shadow);
}
.hero-search .search-icon { color: var(--text-faint); width: 19px; height: 19px; }
.hero-search input {
    flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
    color: var(--text); font: inherit; padding: 8px 0;
}
.hero-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.stat-chip {
    display: inline-flex; align-items: baseline; gap: 7px;
    background: var(--surface); border: 1px solid var(--border);
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-dim);
}
.stat-chip strong { color: var(--text); font-size: 15.5px; }

/* --------------------------------------------------------------------------
   Category chips
   ------------------------------------------------------------------------- */
.category-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 13.5px;
    font-weight: 500;
    transition: all .16s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.is-active {
    color: #fff;
    background: var(--accent-soft);
    border-color: rgba(108, 140, 255, 0.45);
    box-shadow: 0 0 16px rgba(108, 140, 255, 0.12) inset;
}
.chip-count {
    font-size: 11.5px;
    background: rgba(7, 11, 20, 0.55);
    border-radius: 999px;
    padding: 1px 7px;
    color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Application cards
   ------------------------------------------------------------------------- */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.app-card {
    display: flex; flex-direction: column; gap: 12px;
    background: linear-gradient(180deg, rgba(148, 163, 198, 0.07), rgba(148, 163, 198, 0.028));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-soft);
    transition: transform .18s, border-color .18s, box-shadow .18s;
}
.app-card:hover {
    transform: translateY(-3px);
    border-color: rgba(108, 140, 255, 0.38);
    box-shadow: var(--shadow), 0 0 0 1px rgba(108, 140, 255, 0.12);
}
.app-card-head { display: flex; align-items: center; gap: 13px; }
.app-card-title h3 { margin: 0; font-size: 16px; }
.app-card-title h3 a { color: var(--text); }
.app-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-card-desc { color: var(--text-dim); font-size: 13.8px; margin: 0; flex: 1; }
.app-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-faint); }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item .icon { width: 14px; height: 14px; }
.app-card-actions { display: flex; gap: 9px; margin-top: 2px; }

.app-icon {
    width: 44px; height: 44px; flex: 0 0 auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon-lg { width: 48px; height: 48px; }
.app-icon-xl { width: 76px; height: 76px; border-radius: 18px; }
.app-icon-fallback {
    width: 100%; height: 100%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 750; font-size: 19px;
    background: linear-gradient(135deg, rgba(108, 140, 255, 0.35), rgba(167, 139, 250, 0.35));
    color: #dfe6ff;
}
.app-icon-xl.app-icon-fallback { font-size: 31px; }

.shot-strip { display: flex; gap: 8px; }
.shot-strip img {
    width: 50%; height: 76px; object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.version-badge {
    display: inline-flex; align-items: center;
    font-size: 12px; font-weight: 700; letter-spacing: .02em;
    font-family: var(--mono);
    color: #c9d4ff;
    background: var(--accent-soft);
    border: 1px solid rgba(108, 140, 255, 0.35);
    padding: 2px 9px;
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Badges, tags
   ------------------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 600;
    padding: 3px 10px; border-radius: 999px;
    border: 1px solid transparent;
}
.badge .icon { width: 13px; height: 13px; }
.badge-blue { color: #9db4ff; background: var(--accent-soft); border-color: rgba(108, 140, 255, 0.3); }
.badge-purple { color: #c9b8ff; background: var(--lavender-soft); border-color: rgba(167, 139, 250, 0.3); }
.badge-green { color: #7ce0bb; background: var(--green-soft); border-color: rgba(52, 211, 153, 0.3); }
.badge-red { color: #fda4a4; background: var(--red-soft); border-color: rgba(248, 113, 113, 0.3); }
.badge-amber { color: #fcd34d; background: var(--amber-soft); border-color: rgba(251, 191, 36, 0.3); }
.badge-gray { color: var(--text-dim); background: var(--surface-2); border-color: var(--border); }

.tag { color: var(--text-faint); font-size: 12.5px; margin-right: 9px; }

/* --------------------------------------------------------------------------
   Empty state, pagination
   ------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 54px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-dim);
    background: var(--surface);
}
.empty-state .icon { width: 34px; height: 34px; color: var(--text-faint); margin-bottom: 10px; }
.empty-state h3 { color: var(--text); font-size: 17px; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.page-btn {
    min-width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-dim);
    font-size: 13.5px; font-weight: 600;
    padding: 0 8px;
}
.page-btn:hover { border-color: var(--border-strong); color: var(--text); }
.page-btn.is-active { background: var(--grad); border-color: transparent; color: #fff; }
.page-dots { color: var(--text-faint); padding: 0 4px; }

/* --------------------------------------------------------------------------
   Application detail
   ------------------------------------------------------------------------- */
.app-hero { padding: 26px; }
.app-hero-main { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.app-hero-info { flex: 1; min-width: 260px; }
.app-hero-title { font-size: 25px; margin-bottom: 8px; }
.app-hero-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.app-hero-desc { color: var(--text-dim); font-size: 15.5px; margin-bottom: 10px; }
.app-hero-tags { display: flex; flex-wrap: wrap; gap: 2px; }
.app-hero-actions { display: flex; flex-direction: column; gap: 9px; align-self: center; }

.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.rich-text { color: var(--text-dim); font-size: 14.5px; overflow-wrap: anywhere; }
.meta-list { margin: 0; }
.meta-list div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.meta-list div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--text-faint); }
.meta-list dd { margin: 0; color: var(--text); text-align: right; overflow-wrap: anywhere; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery-item {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color .16s, transform .16s;
}
.gallery-item:hover { border-color: rgba(108, 140, 255, 0.45); transform: translateY(-2px); }
.gallery-item img { width: 100%; height: 150px; object-fit: cover; display: block; }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(4, 7, 14, 0.88);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius); box-shadow: var(--shadow); }
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); border-radius: 50%;
    width: 40px; height: 40px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* --------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 30px 0 26px; background: rgba(7, 11, 20, 0.5); }
.footer-inner { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.footer-brand p { color: var(--text-faint); font-size: 13.5px; margin: 6px 0 0; max-width: 360px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-dim); font-size: 13.5px; }
.footer-lang { display: flex; gap: 12px; }
.footer-lang a { color: var(--text-faint); font-size: 13px; }
.footer-lang a.is-active { color: var(--text); }
.footer-copy { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12.5px; }

/* --------------------------------------------------------------------------
   Flash messages
   ------------------------------------------------------------------------- */
.flash-stack {
    position: fixed; top: 74px; right: 20px; z-index: 150;
    display: flex; flex-direction: column; gap: 10px;
    max-width: 380px;
}
.flash {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.5px;
    box-shadow: var(--shadow);
    animation: flash-in .22s ease-out;
}
.flash .icon { margin-top: 1px; }
.flash-success { border-left: 3px solid var(--green); }
.flash-success .icon { color: var(--green); }
.flash-error { border-left: 3px solid var(--red); }
.flash-error .icon { color: var(--red); }
.flash-info { border-left: 3px solid var(--accent); }
.flash-info .icon { color: var(--accent); }
.flash-close {
    margin-left: auto; background: none; border: 0; cursor: pointer;
    color: var(--text-faint); padding: 0 0 0 8px;
}
.flash-close .icon { width: 14px; height: 14px; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.flash.is-leaving { opacity: 0; transition: opacity .3s; }

/* --------------------------------------------------------------------------
   Admin shell
   ------------------------------------------------------------------------- */
body.admin { background: var(--bg); }
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px; flex: 0 0 248px;
    background: linear-gradient(180deg, rgba(148, 163, 198, 0.05), rgba(148, 163, 198, 0.015));
    border-right: 1px solid var(--border);
    padding: 20px 14px;
    position: sticky; top: 0;
    height: 100vh;
    display: flex; flex-direction: column; gap: 6px;
    overflow-y: auto;
    z-index: 90;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: var(--text); font-weight: 700; }
.sidebar-brand .brand-mark { width: 32px; height: 32px; }
.side-label {
    font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-faint); padding: 14px 10px 6px;
}
.side-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 500;
    font-size: 14px;
    transition: background .15s, color .15s;
    position: relative;
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.is-active {
    background: var(--accent-soft);
    color: var(--text);
}
.side-item.is-active::before {
    content: "";
    position: absolute; left: -14px; top: 20%; bottom: 20%;
    width: 3px; border-radius: 3px;
    background: var(--grad);
    box-shadow: 0 0 12px rgba(108, 140, 255, .8);
}
.side-item .icon { color: var(--text-faint); }
.side-item.is-active .icon { color: var(--accent); }
.sidebar-footer { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--grad);
    color: #fff; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
}
.sidebar-user .u-name { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.2; }
.sidebar-user .u-role { font-size: 11.5px; color: var(--text-faint); }
.backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 80;
    background: rgba(4, 7, 14, 0.6);
}

.admin-main { flex: 1; min-width: 0; padding: 22px 26px 60px; }
.admin-topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-topbar h1 { font-size: 21px; margin: 0; }
.admin-topbar-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.menu-toggle { display: none; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card { padding: 18px; }
.stat-card .stat-icon {
    width: 38px; height: 38px; border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
    background: var(--accent-soft); color: var(--accent);
}
.stat-card .stat-icon.purple { background: var(--lavender-soft); color: var(--lavender); }
.stat-card .stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-card .stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-card .stat-value { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; }
.stat-card .stat-label { color: var(--text-dim); font-size: 13px; }

.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(180deg, rgba(148, 163, 198, 0.05), rgba(148, 163, 198, 0.02)); }
.table { width: 100%; border-collapse: collapse; font-size: 13.8px; min-width: 640px; }
.table th {
    text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
    color: var(--text-faint); font-weight: 600;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .cell-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .cell-name { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.table .cell-name a { color: var(--text); font-weight: 600; }
.table .cell-name .slug { color: var(--text-faint); font-size: 12px; font-family: var(--mono); }

/* Forms */
.form-card { padding: 22px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid .span-2 { grid-column: span 2; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.field .hint { font-size: 12px; color: var(--text-faint); }
.label-lang { font-weight: 400; font-size: 11.5px; color: var(--text-faint); }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="number"], input[type="url"], select, textarea {
    width: 100%;
    background: rgba(7, 11, 20, 0.55);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    padding: 9px 12px;
    outline: 0;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.18);
}
textarea { min-height: 110px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type="file"] { color: var(--text-dim); font-size: 13px; }
input[type="file"]::file-selector-button {
    background: var(--surface-2); border: 1px solid var(--border-strong);
    color: var(--text); border-radius: 7px; padding: 6px 12px; margin-right: 12px;
    font: inherit; font-size: 13px; cursor: pointer;
}
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; }
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.checkbox-row label { font-size: 13.5px; color: var(--text-dim); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-search { position: relative; flex: 1; min-width: 220px; display: flex; align-items: center; }
.filter-search .search-icon { position: absolute; left: 12px; color: var(--text-faint); }
.filter-search input { padding-left: 38px; }

/* Screenshots manager */
.shots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.shot-tile { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.shot-tile img { width: 100%; height: 120px; object-fit: cover; display: block; }
.shot-tile .shot-actions {
    position: absolute; inset: auto 0 0 0;
    display: flex; justify-content: center; gap: 6px;
    padding: 8px;
    background: linear-gradient(transparent, rgba(4, 7, 14, 0.85));
}
.shot-tile .shot-actions form { margin: 0; }
.icon-btn {
    width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(7, 11, 20, 0.75);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    transition: background .14s, color .14s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn .icon { width: 15px; height: 15px; }

/* Sub navigation (editor tabs) */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.subnav a {
    padding: 7px 14px; border-radius: 999px;
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    border: 1px solid var(--border);
    background: var(--surface);
}
.subnav a:hover { color: var(--text); border-color: var(--border-strong); }

/* Details/summary blocks (logs, warnings) */
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.disclosure summary {
    cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 600;
    color: var(--text-dim); list-style: none; display: flex; align-items: center; gap: 8px;
}
details.disclosure summary::-webkit-details-marker { display: none; }
details.disclosure summary:hover { color: var(--text); }
details.disclosure .disclosure-body { padding: 4px 14px 12px; font-size: 13px; color: var(--text-dim); }
.deploy-log { font-family: var(--mono); font-size: 12.2px; background: rgba(4, 7, 14, 0.6); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; overflow-x: auto; }
.deploy-log .log-ok { color: var(--green); }
.deploy-log .log-fail { color: var(--red); }
.deploy-log .log-skip { color: var(--text-faint); }

/* Callout */
.callout {
    display: flex; gap: 11px; align-items: flex-start;
    border: 1px solid rgba(108, 140, 255, 0.3);
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13.3px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.callout .icon { color: var(--accent); margin-top: 1px; }
.callout.warn { border-color: rgba(251, 191, 36, 0.35); background: var(--amber-soft); }
.callout.warn .icon { color: var(--amber); }

/* Login page */
body.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(900px 460px at 20% -10%, rgba(108, 140, 255, 0.16), transparent 60%),
        radial-gradient(800px 420px at 85% 105%, rgba(167, 139, 250, 0.12), transparent 55%),
        var(--bg);
}
.login-box { width: 400px; max-width: calc(100vw - 40px); padding: 34px; }
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .brand-mark { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 14px; }
.login-brand .brand-mark svg { width: 34px; height: 34px; }
.login-brand h1 { font-size: 21px; margin-bottom: 4px; }
.login-brand p { color: var(--text-dim); font-size: 13.5px; margin: 0; }
.login-lang { position: absolute; top: 18px; right: 22px; }
.login-footer { text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--text-faint); }

/* Kpi mini list (dashboard lists) */
.mini-list { display: flex; flex-direction: column; }
.mini-list .mini-item { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.mini-list .mini-item:last-child { border-bottom: 0; }
.mini-list .mini-item .when { margin-left: auto; color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.mini-list .mini-item .icon { color: var(--text-faint); }
.mini-list .mini-item a { color: var(--text); }

/* URL copy chips */
.url-chip {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: 12.3px;
    background: rgba(4, 7, 14, 0.55);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 5px 10px;
    color: #b9c6e8;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.url-chip a { color: #9db4ff; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .detail-grid, .two-col { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: var(--shadow);
    }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .backdrop { display: block; }
    .menu-toggle { display: inline-flex; }
    .admin-main { padding: 16px 16px 50px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: span 1; }
}

@media (max-width: 640px) {
    .topnav { display: none; }
    .topbar-actions .btn span { display: none; }
    .hero { padding-top: 40px; }
    .app-hero-actions { width: 100%; }
    .app-hero-actions .btn { justify-content: center; }
    .flash-stack { left: 14px; right: 14px; max-width: none; top: 68px; }
    .hero-search { flex-wrap: nowrap; }
    .hero-search .btn { padding: 8px 12px; }
}
