:root {
    --ink: #14232b;
    --muted: #64747d;
    --line: #dfe8eb;
    --surface: #ffffff;
    --soft: #f4f8f9;
    --brand: #0596a6;
    --brand-dark: #057480;
    --accent: #11b981;
    --danger: #c43b3b;
    --shadow: 0 18px 50px rgba(22, 55, 67, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: #fff; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(680px, calc(100% - 32px)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.topbar { min-height: 74px; display: flex; align-items: center; gap: 30px; }
.brand { font-size: 25px; font-weight: 850; letter-spacing: -.8px; }
.brand span { color: var(--brand); }
.nav { display: flex; gap: 24px; margin-right: auto; color: #44555e; }
.nav a:hover, .auth-links a:hover { color: var(--brand); }
.auth-links { display: flex; align-items: center; gap: 16px; }
.inline-form { display: inline-flex; gap: 7px; align-items: center; margin: 0; }
.link-button { border: 0; background: none; color: var(--ink); cursor: pointer; padding: 0; }

.hero { padding: 92px 0 76px; background: radial-gradient(circle at 86% 16%, rgba(5,150,166,.14), transparent 31%), linear-gradient(180deg,#fbfefe,#fff); }
.hero-grid { display: grid; grid-template-columns: 1.22fr .78fr; gap: 64px; align-items: center; }
h1 { margin: 10px 0 18px; font-size: clamp(36px, 5vw, 64px); line-height: 1.06; letter-spacing: -2px; }
h2 { line-height: 1.25; letter-spacing: -.5px; }
.lead { font-size: 20px; color: var(--muted); max-width: 760px; }
.eyebrow { display: inline-block; color: var(--brand-dark); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; font-size: 12px; }
.actions { display: flex; gap: 12px; margin: 30px 0 24px; flex-wrap: wrap; }
.trust-row { display: flex; flex-wrap: wrap; gap: 18px; color: #49606a; font-size: 14px; }
.hero-panel { padding: 34px; background: linear-gradient(145deg,#fff,#eef9fa); border-color: rgba(5,150,166,.25); }
.pulse { display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 8px rgba(17,185,129,.12); }
.ai-buttons { display: grid; gap: 10px; margin-top: 24px; }
.ai-buttons a { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 700; }

.section { padding: 68px 0; }
.section.muted { background: var(--soft); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 22px; margin-top: 28px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.category { padding: 28px; transition: transform .2s ease, border-color .2s ease; }
.category:hover { transform: translateY(-4px); border-color: rgba(5,150,166,.5); }
.icon { width: 48px; height: 48px; display: grid; place-items: center; background: #eaf8f9; color: var(--brand-dark); border-radius: 14px; font-size: 24px; font-weight: 800; }
.service-card, .expert-card, .card:not(.form-card):not(.hero-panel):not(.category):not(.stat):not(.detail) { padding: 24px; }
.service-card h2, .expert-card h2, .grid .card h2 { font-size: 20px; }
.service-card p, .expert-card p, .grid .card p { color: var(--muted); }
.tag, .status, .verified { display: inline-block; border-radius: 999px; padding: 5px 10px; background: #eaf8f9; color: var(--brand-dark); font-size: 12px; font-weight: 800; }
.verified { background: #eaf9f3; color: #087a57; }
.status-new { background: #eaf8f9; color: #057480; }
.status-accepted { background: #eef2ff; color: #3d4ea3; }
.status-in_progress { background: #fff8e8; color: #745614; }
.status-answered { background: #eaf9f3; color: #087a57; }
.status-completed { background: #e8f7ec; color: #236d38; }
.status-cancelled { background: #fff0f0; color: #9c2d2d; }
.status-published { background: #eaf9f3; color: #087a57; }
.status-draft { background: #f1f3f4; color: #5d6970; }
.meta { display: flex; justify-content: space-between; gap: 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 16px; margin: 18px 0; font-size: 14px; }
.avatar { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(145deg,var(--brand),var(--brand-dark)); color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 16px; }

.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand); color: #fff; padding: 12px 18px; font-weight: 750; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button.outline { background: #fff; color: var(--brand-dark); }
.button.small { padding: 8px 12px; font-size: 13px; }
.button.danger { background: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: #9f2929; border-color: #9f2929; }
.button.secondary { background: #667780; border-color: #667780; }
.button.secondary:hover { background: #4d5d65; border-color: #4d5d65; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.chips { display: flex; gap: 9px; flex-wrap: wrap; margin: 24px 0; }
.chip { border: 1px solid var(--line); padding: 8px 13px; border-radius: 999px; color: #50636c; }
.chip.active, .chip:hover { border-color: var(--brand); color: var(--brand-dark); background: #effafa; }

.form-card { padding: 30px; }
.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #cbd9de; border-radius: 11px; padding: 12px 13px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(5,150,166,.12); border-color: var(--brand); }
.form-error, .flash, .notice { border-radius: 12px; padding: 13px 15px; margin: 12px 0; }
.form-error, .flash.danger { background: #fff0f0; color: #9c2d2d; border: 1px solid #f4caca; }
.flash.success { background: #eaf9f3; color: #087a57; border: 1px solid #c7eedf; margin-top: 18px; }
.flash.warning, .notice { background: #fff8e8; color: #745614; border: 1px solid #f0dfa9; }

.detail-grid, .ai-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
.detail { padding: 34px; }
.detail h1 { font-size: clamp(32px,4vw,50px); }
.prose { color: #40535c; }
.price { font-size: 26px; font-weight: 850; margin: 25px 0; color: var(--brand-dark); }
.empty { grid-column: 1/-1; padding: 28px; border: 1px dashed #bdd0d6; border-radius: 16px; color: var(--muted); text-align: center; }

.stats, .dashboard-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.stats > div, .stat { padding: 25px; text-align: center; }
.stats strong, .stat strong { display: block; color: var(--brand-dark); font-size: 34px; }
.stats span, .stat span { color: var(--muted); }
.dashboard-grid { margin: 25px 0 38px; grid-template-columns: repeat(4,1fr); }
.admin-forms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; align-items: start; }
.checkbox { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; }
.checkbox input { width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; margin: 15px 0 34px; }
table { border-collapse: collapse; width: 100%; min-width: 650px; }
th, td { padding: 13px 15px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--soft); font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.table-link { color: var(--brand-dark); font-weight: 800; white-space: nowrap; }
.table-link:hover { text-decoration: underline; }
.management-table { min-width: 1040px; }
.management-table td:first-child { min-width: 220px; }
.management-table td:last-child { min-width: 310px; }
.management-table small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.row-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.consultation-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 28px; align-items: start; }
.consultation-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.consultation-heading h1 { font-size: clamp(32px, 4vw, 50px); }
.consultation-heading .status { flex: 0 0 auto; margin-top: 7px; }
.consultation-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 28px 0; }
.consultation-meta div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.consultation-meta dt { color: var(--muted); font-size: 12px; font-weight: 700; }
.consultation-meta dd { margin: 4px 0 0; font-weight: 750; }
.consultation-message, .expert-answer { padding: 18px; border-radius: 14px; margin: 12px 0 26px; }
.consultation-message { background: var(--soft); border: 1px solid var(--line); }
.expert-answer { background: #eaf9f3; border: 1px solid #c7eedf; color: #145b45; }
.consultation-manage { position: sticky; top: 98px; }
.field-help { margin: -5px 0 0; color: var(--muted); font-size: 13px; }

.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); }
.footer-grid { display: flex; justify-content: space-between; gap: 30px; }

@media (max-width: 900px) {
    .nav { display: none; }
    .hero { padding-top: 58px; }
    .hero-grid, .detail-grid, .ai-layout, .admin-forms, .consultation-layout { grid-template-columns: 1fr; }
    .consultation-manage { position: static; }
    .grid.three { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 600px) {
    .container { width: min(100% - 22px, 1160px); }
    .topbar { min-height: 64px; gap: 12px; }
    .brand { font-size: 21px; margin-right: auto; }
    .auth-links > a:first-child { display: none; }
    .hero { padding: 45px 0; }
    h1 { font-size: 39px; letter-spacing: -1.3px; }
    .grid.three, .stats, .dashboard-grid { grid-template-columns: 1fr; }
    .consultation-heading { display: block; }
    .consultation-meta { grid-template-columns: 1fr; }
    .section { padding: 48px 0; }
    .footer-grid { flex-direction: column; }
}
