:root {
    --orange: #f28c18;
    --orange-dark: #d86f00;
    --ink: #16191d;
    --muted: #68717d;
    --line: #dfe3e8;
    --surface: #ffffff;
    --background: #f4f5f7;
    --success: #19703d;
    --danger: #b42318;
    --warning: #9a6700;
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

.site-header {
    min-height: 72px;
    padding: 0 clamp(20px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: #111317;
    color: #fff;
    box-shadow: 0 2px 16px rgba(0,0,0,.16);
}

.brand { color: var(--orange); font-size: 24px; font-weight: 900; letter-spacing: -.04em; text-decoration: none; text-transform: uppercase; }
.brand span { color: #fff; }
.brand.large { font-size: 34px; margin-bottom: 24px; }
.site-header nav { display: flex; align-items: stretch; align-self: stretch; }
.site-header nav a { display: flex; align-items: center; padding: 0 18px; text-decoration: none; color: #d7d9dc; border-bottom: 3px solid transparent; }
.site-header nav a:hover, .site-header nav a.active { color: #fff; border-bottom-color: var(--orange); }
.menu-toggle { display: none; color: #fff; background: transparent; border: 1px solid #555; border-radius: 7px; padding: 8px 12px; }

.page { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; }
.hero { margin-bottom: 28px; }
.hero h1, .detail-heading h1 { margin: 5px 0 8px; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -.045em; }
.hero p, .detail-heading p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--orange-dark) !important; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.database-hero, .detail-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }

.card, .table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 32px rgba(20,25,32,.06); }
.workshop-form { overflow: hidden; }
.form-section { padding: 34px 38px; border-bottom: 1px solid var(--line); }
.section-title { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 28px; }
.section-title > span { flex: 0 0 32px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #111; font-weight: 900; }
.section-title h2 { margin: 1px 0 3px; font-size: 1.2rem; }
.section-title p { margin: 0; color: var(--muted); font-size: .92rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.field { min-width: 0; }
.field.full { margin-bottom: 24px; }
.field label:not(.choice), .field legend, .login-card label { display: block; margin: 0 0 8px; padding: 0; font-size: .9rem; font-weight: 750; }
.field b, .form-actions b { color: var(--orange-dark); }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }

input[type="text"], input[type="password"], input[type="tel"], input[type="email"], input[type="date"], input[type="search"], select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bfc6ce;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 125px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--orange-dark); box-shadow: 0 0 0 3px rgba(242,140,24,.18); }
input::placeholder, textarea::placeholder { color: #969da5; }
.input-suffix { display: flex; }
.input-suffix input { border-radius: 8px 0 0 8px; }
.input-suffix span { min-width: 46px; display: grid; place-items: center; border: 1px solid #bfc6ce; border-left: 0; border-radius: 0 8px 8px 0; background: #eef0f2; font-weight: 700; }

.choice-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.choice-grid.two-columns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choices-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 9px 12px; border: 1px solid #c9ced4; border-radius: 8px; text-align: center; font-size: .88rem; background: #fafafa; transition: .15s; }
.choice:hover span { border-color: #888f98; }
.choice input:checked + span { color: #1b1308; border-color: var(--orange-dark); background: #fff1df; box-shadow: inset 0 0 0 1px var(--orange-dark); font-weight: 750; }
.choice input:focus-visible + span { outline: 3px solid rgba(242,140,24,.25); outline-offset: 2px; }
.choices-inline .choice span { min-width: 116px; }

.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 38px; background: #fafafa; }
.form-actions p { margin: 0; color: var(--muted); font-size: .87rem; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 18px; border: 0; border-radius: 8px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.primary { color: #17100a; background: var(--orange); box-shadow: 0 4px 13px rgba(216,111,0,.22); }
.button.primary:hover { background: #ff9a23; }
.button.secondary { color: var(--ink); background: #fff; border: 1px solid #bec4ca; }
.button.full { width: 100%; margin-top: 18px; }

.alert { margin-bottom: 22px; padding: 14px 17px; border: 1px solid; border-radius: 9px; }
.alert.success { color: var(--success); background: #edf9f1; border-color: #a9d5b8; }
.alert.error { color: var(--danger); background: #fff1f0; border-color: #f2b8b5; }
.alert.warning { color: var(--warning); background: #fff8dd; border-color: #e4cf80; }

.filters { display: grid; grid-template-columns: minmax(260px, 1fr) 220px auto auto; align-items: end; gap: 16px; padding: 20px; margin-bottom: 20px; }
.reset-link { align-self: center; color: var(--muted); font-size: .9rem; }
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 17px; color: var(--muted); background: #f6f7f8; border-bottom: 1px solid var(--line); font-size: .76rem; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
td { padding: 17px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fffaf4; }
td small { display: block; margin-top: 4px; color: var(--muted); }
.badge { display: inline-block; padding: 5px 9px; color: #754000; background: #fff0dc; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.row-link { color: var(--orange-dark); font-weight: 800; text-decoration: none; }
.empty { padding: 48px 20px; color: var(--muted); text-align: center; }
.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.pagination a { min-width: 38px; height: 38px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 7px; text-decoration: none; }
.pagination a.current { color: #111; background: var(--orange); border-color: var(--orange); font-weight: 800; }

.back-link { display: inline-block; margin-bottom: 22px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.detail-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
.detail-row { margin: 0; padding: 21px 25px; border-bottom: 1px solid var(--line); }
.detail-row:nth-child(odd) { border-right: 1px solid var(--line); }
.detail-row.wide { grid-column: 1 / -1; border-right: 0; }
.detail-row dt { margin-bottom: 7px; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.detail-row dd { margin: 0; font-weight: 620; overflow-wrap: anywhere; }
.muted { color: #959ba2; font-weight: 400; }
.danger-zone { margin-top: 26px; text-align: right; }
.danger-link { padding: 6px; color: var(--danger); background: none; border: 0; text-decoration: underline; cursor: pointer; }

.login-page { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #34383e, #121418 60%); }
.login-card { width: min(430px, 100%); padding: 38px; background: #fff; border-radius: 17px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { margin: 0 0 8px; font-size: 1.8rem; }
.login-card > p { margin: 0 0 25px; color: var(--muted); }
.login-card .hint { margin: 18px 0 0; font-size: .82rem; text-align: center; }

@media (max-width: 900px) {
    .choice-grid, .choice-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
    .site-header { min-height: 64px; position: relative; padding: 0 18px; }
    .menu-toggle { display: block; }
    .site-header nav { display: none; position: absolute; z-index: 10; top: 64px; left: 0; right: 0; align-self: auto; flex-direction: column; padding: 8px; background: #111317; box-shadow: 0 10px 20px rgba(0,0,0,.22); }
    .site-header nav.open { display: flex; }
    .site-header nav a { min-height: 48px; border: 0; border-left: 3px solid transparent; }
    .site-header nav a.active { border-left-color: var(--orange); }
    .page { width: min(100% - 20px, 1160px); padding-top: 28px; }
    .form-section { padding: 27px 20px; }
    .form-grid, .detail-card { grid-template-columns: 1fr; }
    .detail-row, .detail-row:nth-child(odd) { grid-column: auto; border-right: 0; }
    .form-actions { align-items: stretch; flex-direction: column; padding: 22px 20px; }
    .database-hero, .detail-heading { align-items: stretch; flex-direction: column; }
    .filters { grid-template-columns: 1fr; }
    .choice-grid, .choice-grid.two-columns { grid-template-columns: 1fr 1fr; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    td { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 7px 0; border: 0; }
    td::before { content: attr(data-label); color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; }
    td:last-child { display: block; text-align: right; }
}

@media print {
    .site-header, .print-button, .back-link, .danger-zone { display: none !important; }
    body, :root { background: #fff; }
    .page { width: 100%; padding: 0; }
    .detail-card { box-shadow: none; }
}
