:root {
    --blue-900: #08204a;
    --blue-800: #0b2d66;
    --blue-700: #123f86;
    --gold: #f2c94c;
    --text: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --success: #138a5e;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(15, 23, 42, .10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; }
.site-header, .admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226,232,240,.8);
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 14px;
    background: linear-gradient(135deg, var(--blue-900), var(--blue-700));
    color: var(--gold); display: grid; place-items: center;
    font-weight: 900; box-shadow: 0 8px 20px rgba(8,32,74,.25);
}
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.site-nav { display: flex; gap: 8px; align-items: center; }
.site-nav a, .admin-user a {
    padding: 9px 13px; border-radius: 999px; color: #334155; font-weight: 650; font-size: 14px;
}
.site-nav a:hover, .admin-user a:hover { background: #eef2ff; color: var(--blue-800); }
.hero {
    margin: 18px clamp(14px, 4vw, 56px) 0;
    border-radius: 28px;
    overflow: hidden;
    min-height: 245px;
    display: grid;
    align-items: center;
    background:
        radial-gradient(circle at 86% 18%, rgba(242,201,76,.32), transparent 25%),
        radial-gradient(circle at 15% 15%, rgba(67, 147, 255, .28), transparent 28%),
        linear-gradient(135deg, #071b42, #0c3677 62%, #113e84);
    color: white;
    position: relative;
}
.hero:after {
    content: "";
    position: absolute; inset: auto 0 0 0; height: 80px;
    background: linear-gradient(to top, rgba(8,32,74,.42), transparent);
}
.hero-content { position: relative; z-index: 2; max-width: 680px; padding: clamp(24px, 4vw, 40px); }
.eyebrow, .section-title span, .admin-title span {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--blue-700); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
}
.hero .eyebrow { color: var(--gold); }
.hero h1 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; margin: 8px 0 12px; letter-spacing: -.035em; }
.hero p { max-width: 560px; color: rgba(255,255,255,.88); font-size: 15px; margin: 8px 0 16px; }
.search-box, .filter-panel, .admin-filter {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.search-box { max-width: 640px; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.24); padding: 7px; border-radius: 17px; }
.search-box input { flex: 1; min-width: 230px; border: 0; border-radius: 13px; padding: 11px 13px; outline: none; }
.search-box button, .btn-primary, .filter-panel button, .admin-filter button, .inline-form button, .row-edit button, .form-actions button {
    border: 0; border-radius: 13px; padding: 10px 15px; background: linear-gradient(135deg, var(--blue-800), var(--blue-700)); color: white; font-weight: 800;
    box-shadow: 0 10px 22px rgba(18,63,134,.22);
}
.quick-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.quick-actions a { padding: 8px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; color: white; background: rgba(255,255,255,.10); font-size: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px clamp(14px, 4vw, 56px); }
.stat-card { background: var(--card); padding: 22px; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 10px 28px rgba(15,23,42,.05); }
.stat-card strong { display: block; font-size: 34px; color: var(--blue-800); letter-spacing: -.04em; }
.stat-card span { color: var(--muted); font-weight: 700; }
.content-section { margin: 34px clamp(14px, 4vw, 56px); }
.section-title { margin-bottom: 18px; }
.section-title h2, .admin-title h1 { margin: 3px 0 0; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.035em; }
.with-actions, .admin-title { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 18px; }
.result-count { color: var(--muted); font-weight: 700; }
.filter-panel, .admin-filter { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 12px; margin-bottom: 20px; box-shadow: 0 10px 24px rgba(15,23,42,.05); }
.filter-panel input, .filter-panel select, .admin-filter input, .form-grid input, .form-grid select, .form-grid textarea, .inline-form input, .row-edit input, .login-card input {
    border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; outline: none; background: white; width: 100%;
}
.filter-panel input { min-width: 220px; flex: 1; }
.filter-panel select { width: auto; min-width: 190px; }
.btn-secondary { display: inline-flex; justify-content: center; align-items: center; border-radius: 16px; padding: 11px 15px; border: 1px solid var(--line); background: white; color: var(--blue-800); font-weight: 800; }
.journal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.journal-card { background: white; border: 1px solid var(--line); border-radius: 26px; overflow: hidden; box-shadow: 0 14px 34px rgba(15,23,42,.07); transition: transform .18s ease, box-shadow .18s ease; }
.journal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.journal-cover { height: 180px; background: linear-gradient(135deg, #eaf2ff, #fdf6d8); display: grid; place-items: center; overflow: hidden; }
.journal-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { width: 84%; height: 76%; border-radius: 22px; background: linear-gradient(135deg, var(--blue-800), #1f6feb); color: var(--gold); display: grid; place-items: center; font-size: 26px; font-weight: 900; }
.cover-placeholder.large { min-height: 330px; width: 100%; }
.journal-body { padding: 20px; }
.journal-meta { color: var(--muted); font-size: 13px; font-weight: 800; }
.journal-body h3 { margin: 6px 0 8px; font-size: 21px; line-height: 1.18; letter-spacing: -.02em; }
.journal-body p { color: var(--muted); min-height: 64px; margin: 0 0 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badges span, .pill { font-size: 12px; font-weight: 800; color: var(--blue-800); background: #eaf2ff; padding: 6px 9px; border-radius: 999px; }
.pill.ok { color: var(--success); background: #e8f8f0; }
.pill.muted { color: #64748b; background: #f1f5f9; }
.card-actions, .detail-actions, .form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.card-actions a { flex: 1; }
.empty-state { background: white; border: 1px dashed #cbd5e1; border-radius: 22px; padding: 28px; color: var(--muted); text-align: center; }
.detail-wrap { display: grid; grid-template-columns: 380px 1fr; gap: 30px; margin: 38px clamp(14px, 5vw, 76px); align-items: start; }
.detail-cover { background: white; border: 1px solid var(--line); border-radius: 30px; overflow: hidden; box-shadow: var(--shadow); }
.detail-cover img { width: 100%; min-height: 360px; object-fit: cover; }
.detail-content { background: white; border: 1px solid var(--line); border-radius: 30px; padding: clamp(24px, 4vw, 42px); box-shadow: 0 14px 34px rgba(15,23,42,.06); }
.detail-content h1 { font-size: clamp(31px, 5vw, 52px); line-height: 1; margin: 10px 0 16px; letter-spacing: -.05em; }
.info-list { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; margin: 22px 0; }
.info-list dt { font-weight: 900; color: var(--blue-800); }
.info-list dd { margin: 0; color: var(--muted); }
.site-footer { margin-top: 50px; padding: 28px clamp(18px, 4vw, 56px); background: #071b42; color: white; display: flex; justify-content: space-between; gap: 20px; }
.site-footer p, .footer-note { color: rgba(255,255,255,.72); }
.flash { margin: 18px clamp(14px, 4vw, 56px); padding: 14px 16px; border-radius: 16px; font-weight: 700; }
.flash-success { background: #e8f8f0; color: var(--success); }
.flash-error { background: #fff0ed; color: var(--danger); }
.login-card { max-width: 430px; margin: 52px auto; background: white; border: 1px solid var(--line); border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { margin-top: 0; }
.login-card label, .form-grid label, .inline-form label { display: block; font-weight: 850; margin: 12px 0 6px; }
.login-card p, .form-grid small { color: var(--muted); }
.full { width: 100%; margin-top: 16px; }
.admin-body { background: #f1f5f9; }
.admin-topbar { background: white; }
.admin-layout { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 72px); }
.admin-sidebar { background: #071b42; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar a { color: rgba(255,255,255,.82); padding: 12px 14px; border-radius: 15px; font-weight: 750; }
.admin-sidebar a:hover { color: white; background: rgba(255,255,255,.10); }
.admin-content { padding: 24px; min-width: 0; }
.admin-user { display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 800; }
.admin-title { align-items: center; }
.admin-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { background: white; border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: 0 12px 28px rgba(15,23,42,.05); }
.panel h2 { margin: 0 0 14px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; color: var(--muted); font-size: 13px; }
.data-table th, .data-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table code { background: #f8fafc; border: 1px solid var(--line); padding: 3px 6px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions a, .actions button, .data-table button { border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--blue-800); padding: 7px 9px; font-weight: 800; }
.actions form { display: inline; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full { grid-column: 1 / -1; }
.check-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
.image-preview { width: 180px; height: 130px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: #f8fafc; }
.image-preview.empty { display: grid; place-items: center; color: var(--muted); }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-bottom: 18px; }
.inline-form label { grid-column: 1 / -1; margin-top: 0; }
.row-edit { display: flex; gap: 8px; }
.row-edit input { min-width: 260px; }
@media (max-width: 1020px) {
    .journal-grid, .featured-grid, .stat-grid, .admin-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-wrap { grid-template-columns: 1fr; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; flex-direction: row; overflow-x: auto; }
}
@media (max-width: 680px) {
    .site-header, .site-footer, .admin-topbar { flex-direction: column; align-items: flex-start; }
    .site-nav { width: 100%; overflow-x: auto; }
    .hero { margin: 12px; border-radius: 22px; min-height: 0; }
    .hero-content { padding: 22px 18px; }
    .hero h1 { font-size: clamp(24px, 8vw, 32px); line-height: 1.08; }
    .hero p { font-size: 14px; margin-bottom: 14px; }
    .search-box input, .search-box button, .filter-panel input, .filter-panel select, .filter-panel button, .btn-secondary { width: 100%; }
    .journal-grid, .featured-grid, .stat-grid, .form-grid { grid-template-columns: 1fr; }
    .with-actions, .admin-title { align-items: flex-start; flex-direction: column; }
    .info-list { grid-template-columns: 1fr; }
    .admin-content { padding: 14px; }
    .row-edit { flex-direction: column; }
    .row-edit input { min-width: 0; }
}
