@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --background: #faf8f5;
    --surface: #ffffff;
    --surface-soft: #f5efe8;
    --primary: #d89b67;
    --primary-hover: #c9834d;
    --primary-soft: #f4e2d2;
    --secondary: #8db7c8;
    --secondary-soft: #e5f1f5;
    --text-primary: #2f2b28;
    --text-secondary: #6f6a64;
    --border: #ece7e1;
    --success: #72b986;
    --danger: #e56d6d;
    --warning: #e8b767;
    --info: #67b7e6;
    --shadow-card: 0 8px 24px rgba(47, 43, 40, .06);
    --shadow-float: 0 24px 70px rgba(47, 43, 40, .14);
    --radius-card: 24px;
    --radius-control: 16px;
    --font-heading: Manrope, Inter, ui-sans-serif, system-ui, sans-serif;
    --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --transition: 260ms ease-out;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text-primary); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
body.is-locked { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
h1, h2, h3, h4, p { overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--font-heading); }
::selection { background: var(--primary-soft); color: var(--text-primary); }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
    outline: 3px solid rgba(103, 183, 230, .46);
    outline-offset: 3px;
}

.button {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.2;
    transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition), color var(--transition);
}
.button:hover { transform: translateY(-2px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 24px rgba(216, 155, 103, .24); }
.button-primary:hover { background: var(--primary-hover); box-shadow: 0 14px 30px rgba(201, 131, 77, .28); }
.button-secondary { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.button-secondary:hover { border-color: var(--primary); color: var(--primary-hover); }
.button-ghost { background: transparent; color: var(--text-secondary); }
.button-ghost:hover { background: var(--surface-soft); color: var(--text-primary); }
.button-danger { background: #fff2f2; color: #b94b4b; }
.button-small { min-height: 38px; padding: 8px 13px; border-radius: 12px; font-size: .82rem; }
.button-icon { width: 44px; min-height: 44px; padding: 0; border-radius: 14px; }

.ui-card, .content-card, .hero-card {
    background: var(--surface);
    border: 1px solid rgba(236, 231, 225, .9);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
}
.ui-badge, .status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1;
}
.ui-badge-neutral, .status-muted { background: var(--surface-soft); color: var(--text-secondary); }
.ui-badge-success, .status-active { background: #e9f7ed; color: #3d8352; }
.ui-badge-info { background: var(--secondary-soft); color: #42798f; }
.ui-badge-warning { background: #fff5df; color: #9b6e20; }

.field, .form-grid label { display: grid; align-content: start; gap: 8px; color: var(--text-primary); font-size: .88rem; font-weight: 650; }
.field-label { font-weight: 650; }
input, textarea, select, .field-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    outline: none;
    background: #fff;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #a09b96; }
input:hover, textarea:hover, select:hover { border-color: #ddd3c9; }
input:focus, textarea:focus, select:focus { border-color: var(--secondary); box-shadow: 0 0 0 4px rgba(141, 183, 200, .17); }
select:disabled, input:disabled { opacity: .58; cursor: not-allowed; background: var(--surface-soft); }
.field-hint, .subtle { color: var(--text-secondary); font-size: .8rem; font-weight: 450; line-height: 1.55; }
.checkbox-label { display: flex !important; align-items: center; gap: 10px !important; }
.checkbox-label input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--primary); }
.checkbox-label input[type="hidden"] { display: none; }

.flash { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 14px 16px; border: 1px solid transparent; border-radius: var(--radius-control); line-height: 1.55; }
.flash-success { background: #edf8f0; border-color: #d7eddd; color: #36784a; }
.flash-error { background: #fff1f1; border-color: #f7d7d7; color: #a74444; }
.flash ul { margin: 6px 0 0; padding-left: 20px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 14px; color: var(--text-secondary); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 16px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: var(--text-secondary); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(47, 43, 40, .44); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal-card { width: min(100%, 640px); max-height: calc(100vh - 40px); overflow: auto; padding: 24px; border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-float); animation: modalIn 250ms ease-out; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-heading h2 { margin: 0; font-size: 1.35rem; }
.modal-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--surface-soft); cursor: pointer; font-size: 1.5rem; line-height: 1; }
@keyframes modalIn { from { transform: translateY(12px) scale(.98); opacity: 0; } }

.ui-drawer { position: fixed; top: 0; right: 0; z-index: 110; width: min(420px, 92vw); height: 100dvh; padding: 24px; transform: translateX(102%); background: var(--surface); box-shadow: var(--shadow-float); transition: transform var(--transition); }
.ui-drawer.is-open { transform: translateX(0); }
.ui-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ui-drawer-head button { border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; }

.ui-skeleton { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-soft), #fff, var(--surface-soft)); background-size: 220% 100%; animation: skeleton 1.4s linear infinite; }
@keyframes skeleton { to { background-position: -220% 0; } }
.ui-tabs { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: var(--surface-soft); }
.ui-accordion { border-bottom: 1px solid var(--border); }
.ui-accordion summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 0; cursor: pointer; list-style: none; font-family: var(--font-heading); font-weight: 700; }
.ui-accordion summary::-webkit-details-marker { display: none; }
.ui-accordion summary svg { width: 18px; transition: transform var(--transition); }
.ui-accordion[open] summary svg { transform: rotate(45deg); }
.ui-accordion-body { padding: 0 36px 22px 0; color: var(--text-secondary); line-height: 1.75; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
