:root {
    --navy: #0f2c4a;
    --navy-2: #163a60;
    --gold: #e6a419;
    --gold-2: #f4bd44;
    --green: #1f9d68;
    --ink: #1d2733;
    --muted: #5d6b7a;
    --paper: #f6f8fb;
    --card: #ffffff;
    --line: #e2e8f0;
    --shadow: 0 1px 3px rgba(15, 44, 74, .08), 0 6px 20px rgba(15, 44, 74, .06);
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}

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

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.main { padding: 28px 20px 56px; }

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff;
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.28rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.5rem; }
.brand-accent { color: var(--gold-2); }
.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: #dbe6f2; font-weight: 600; font-size: .98rem; }
.site-nav a:hover { color: #fff; text-decoration: none; }
.nav-admin { background: var(--gold); color: var(--navy) !important; padding: 5px 12px; border-radius: 999px; }

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: #fff; border-radius: 16px; padding: 44px 40px; margin-bottom: 30px;
    position: relative; overflow: hidden;
}
.hero::after {
    content: "🦅"; position: absolute; right: 26px; bottom: -14px; font-size: 8rem; opacity: .10;
}
.hero h1 { margin: 0 0 10px; font-size: 2.3rem; letter-spacing: -.02em; }
.hero p { margin: 0 0 22px; font-size: 1.12rem; color: #d5e2f0; max-width: 640px; }
.hero .hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-block; border-radius: 999px; padding: 11px 22px; font-weight: 700; font-size: .96rem; border: 0; cursor: pointer; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-2); text-decoration: none; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.22); text-decoration: none; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 16px; }
.section-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.section-head a { font-weight: 600; font-size: .92rem; }

/* Grids + cards */
.grid { display: grid; gap: 16px; }
.grid-cats { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-listings { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(15,44,74,.12), 0 12px 30px rgba(15,44,74,.10); }

.cat-card { display: block; color: var(--ink); }
.cat-card:hover { text-decoration: none; }
.cat-icon { font-size: 1.8rem; }
.cat-card h3 { margin: 8px 0 4px; font-size: 1.12rem; }
.cat-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.cat-count { display: inline-block; margin-top: 10px; font-size: .8rem; font-weight: 700; color: var(--navy-2); background: #eef3f9; padding: 3px 10px; border-radius: 999px; }

.listing-card { display: flex; flex-direction: column; }
.listing-card .lc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.listing-card h3 { margin: 0 0 6px; font-size: 1.08rem; }
.listing-card h3 a { color: var(--ink); }
.listing-card .lc-cat { font-size: .78rem; font-weight: 700; color: var(--navy-2); background: #eef3f9; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.listing-card p { margin: 0 0 14px; color: var(--muted); font-size: .93rem; flex: 1; }
.listing-card .lc-visit { align-self: flex-start; font-weight: 700; color: var(--green); }
.badge-featured { font-size: .72rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: .04em; }

/* Directory search */
.dir-controls { margin: 6px 0 22px; }
.dir-search { width: 100%; padding: 14px 18px; font-size: 1.05rem; border: 2px solid var(--line); border-radius: 999px; outline: none; }
.dir-search:focus { border-color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 6px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.dir-count { color: var(--muted); font-size: .9rem; margin: 4px 0 12px; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* Blog */
.post-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.post-card { display: block; color: var(--ink); }
.post-card:hover { text-decoration: none; }
.post-emoji { font-size: 2rem; }
.post-card h3 { margin: 8px 0 6px; font-size: 1.18rem; }
.post-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.post-meta { color: var(--muted); font-size: .82rem; margin-top: 10px; }

.article { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 36px 40px; box-shadow: var(--shadow); max-width: 760px; margin: 0 auto; }
.article .art-emoji { font-size: 3rem; }
.article h1 { margin: 8px 0 6px; font-size: 2rem; letter-spacing: -.02em; }
.article .art-meta { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.article h2 { margin: 26px 0 10px; font-size: 1.35rem; }
.article p, .article li { font-size: 1.04rem; }
.article ul { padding-left: 22px; }

/* Listing profile */
.crumb { margin: 4px 0 16px; color: var(--muted); font-size: .9rem; }
.crumb a { font-weight: 600; }
.profile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 32px 36px; box-shadow: var(--shadow); max-width: 760px; }
.profile .lc-cat { display: inline-block; margin-bottom: 12px; }
.profile h1 { margin: 6px 0 12px; font-size: 1.9rem; letter-spacing: -.02em; }
.profile-desc { font-size: 1.1rem; color: var(--ink); margin: 0 0 16px; }
.profile .chips { margin-bottom: 6px; }
.profile-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 12px; }
.profile-url { color: var(--muted); font-size: .88rem; word-break: break-all; }

/* Calculators */
.calc-title { margin: 6px 0 6px; font-size: 1.7rem; letter-spacing: -.02em; }
.calc-intro { color: var(--muted); max-width: 640px; margin: 0 0 22px; }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.calc-form { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.calc-field { margin-bottom: 15px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
.calc-field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 1.05rem; font-family: inherit; }
.calc-field input:focus { outline: none; border-color: var(--gold); }
.calc-result { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: sticky; top: 82px; }
.calc-result .big-label { color: #b9cbe0; font-size: .92rem; font-weight: 600; }
.calc-result .big { font-size: 2.5rem; font-weight: 800; color: var(--gold-2); letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.calc-rows { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.16); padding-top: 12px; }
.calc-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; color: #cfdcec; font-size: .96rem; }
.calc-row strong { color: #fff; }
.calc-note { color: var(--muted); font-size: .86rem; margin-top: 18px; max-width: 640px; }

.calc-cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; border-radius: 16px; padding: 24px 30px; margin: 30px 0; box-shadow: var(--shadow); }
.calc-cta:hover { text-decoration: none; }
.calc-cta h2 { margin: 0 0 4px; font-size: 1.35rem; }
.calc-cta p { margin: 0; color: #d5e2f0; }

@media (max-width: 720px) {
    .calc { grid-template-columns: 1fr; }
    .calc-result { position: static; }
}

/* Footer */
.site-footer { background: var(--navy); color: #c7d5e4; margin-top: 40px; }
.footer-inner { padding: 26px 20px; text-align: center; }
.footer-brand { font-weight: 700; color: #fff; margin-bottom: 8px; }
.footer-links { display: flex; gap: 16px; justify-content: center; margin-bottom: 10px; }
.footer-links a { color: var(--gold-2); font-weight: 600; }
.footer-note { font-size: .82rem; color: #8ba4bf; }

/* Admin */
.admin-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-nav a { background: #fff; border: 1px solid var(--line); padding: 8px 16px; border-radius: 999px; font-weight: 600; }
.admin-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: .9rem; }

table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .93rem; }
table.data th { background: #f0f4f9; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }

.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); max-width: 680px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .92rem; }
.form-row input[type=text], .form-row input[type=url], .form-row input[type=number], .form-row input[type=password], .form-row input[type=datetime-local], .form-row textarea, .form-row select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .98rem; font-family: inherit;
}
.form-row textarea { min-height: 200px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); text-decoration: none; }
.btn-danger { background: #c0392b; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .84rem; }
.btn-line { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.error { background: #fdecea; border: 1px solid #f5c6cb; color: #a1352a; padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }

.login-card { max-width: 380px; margin: 40px auto; }

@media (max-width: 640px) {
    .hero { padding: 32px 24px; }
    .hero h1 { font-size: 1.7rem; }
    .site-nav { gap: 14px; }
    .article { padding: 24px 20px; }
}
