:root {
    --primary: #0c4a6e;
    --secondary: #1d4ed8;
    --accent: #f97316;
    --ink: #0f172a;
    --muted: #475569;
    --line: rgba(15, 23, 42, 0.12);
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --surface-strong: #e0f2fe;
    --panel: #0b1220;
    --panel-soft: #162033;
    --panel-text: #e2e8f0;
    --shadow: 0 22px 60px rgba(2, 6, 23, 0.12);
    --radius: 24px;
    --radius-small: 16px;
    --wrap: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 32%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 42%, #f8fafc 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

.wrap {
    width: min(calc(100% - 2rem), var(--wrap));
    margin: 0 auto;
}

.topbar {
    background: #e0f2fe;
    border-bottom: 1px solid rgba(12, 74, 110, 0.08);
    font-size: 0.88rem;
}

.topbar-inner,
.nav-shell,
.footer-bar,
.admin-toolbar,
.section-heading.with-link,
.table-actions,
.checkbox-row,
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-inner {
    padding: 0.75rem 0;
    color: var(--muted);
    flex-wrap: wrap;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.nav-shell {
    padding: 1rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}

.brand strong,
.hero-copy h1,
.section-heading h2,
.page-hero h1,
.auth-card h1,
.admin-header h1,
.admin-card h2,
.card h3,
.slide-card h2,
.blog-card h2,
.blog-card h3 {
    font-family: 'Space Grotesk', sans-serif;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
}

.brand-mark {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    color: #0f172a;
    font-weight: 700;
}

.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    min-width: 220px;
    padding: 0.85rem;
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
}

.nav-item:hover .nav-dropdown {
    display: grid;
    gap: 0.65rem;
}

.menu-toggle {
    display: none;
}

.button,
.button-ghost,
.inline-link,
.table-actions button,
.table-actions a {
    transition: 180ms ease;
}

.button,
.table-actions button,
.button-small {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.9rem 1.3rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.button-small {
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
}

.button-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(12, 74, 110, 0.16);
    box-shadow: none;
}

.button-full {
    width: 100%;
}

.hero {
    padding: 5rem 0 3rem;
}

.hero-grid,
.split-feature,
.contact-panel,
.footer-grid,
.form-grid.two-up,
.two-column-admin {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.form-grid.three-up,
.cards.cards-3,
.admin-stats,
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.form-grid.four-up,
.cards.cards-4,
.counters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
}

.hero-copy h1,
.page-hero h1,
.auth-card h1 {
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    line-height: 0.98;
    margin: 0.2rem 0 1rem;
}

.hero-text,
.lead,
.slide-card p,
.card p,
.contact-panel p,
.prose p,
.admin-card p {
    color: var(--muted);
    line-height: 1.75;
}

.eyebrow,
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(249, 115, 22, 0.12);
    color: #9a3412;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 0.84rem;
}

.hero-slider {
    position: relative;
    min-height: 360px;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(24px);
    transition: 360ms ease;
}

.slide.is-active {
    opacity: 1;
    transform: translateY(0);
}

.slide-card,
.card,
.counter-card,
.contact-box,
.admin-card,
.auth-card,
.media-card,
.stat-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.slide-card {
    height: 100%;
    padding: 2rem;
    background:
        linear-gradient(135deg, rgba(12, 74, 110, 0.96), rgba(29, 78, 216, 0.88)),
        linear-gradient(45deg, transparent, rgba(255,255,255,0.08));
    color: white;
}

.slide-label {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    font-size: 0.82rem;
    font-weight: 700;
}

.inline-link {
    color: var(--accent);
    font-weight: 800;
}

.section,
.page-hero {
    padding: 4.5rem 0;
}

.page-hero.slim {
    padding: 3.5rem 0 1rem;
}

.section-contrast,
.counter-strip {
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.6), rgba(248, 250, 252, 0.8));
}

.section-heading {
    margin-bottom: 1.6rem;
}

.cards {
    gap: 1.25rem;
}

.card,
.counter-card,
.contact-box,
.admin-card,
.media-card,
.auth-card {
    padding: 1.5rem;
}

.service-card,
.product-card,
.blog-card {
    min-height: 100%;
}

.counter-card {
    text-align: center;
}

.counter-card strong {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.6rem;
    margin-bottom: 0.35rem;
}

.prose {
    max-width: 840px;
}

.prose h2,
.prose h3 {
    font-family: 'Space Grotesk', sans-serif;
    margin-top: 2rem;
}

.site-footer {
    margin-top: 4rem;
    padding: 3rem 0 1.25rem;
    background: var(--panel);
    color: var(--panel-text);
}

.site-footer h3,
.site-footer h4 {
    font-family: 'Space Grotesk', sans-serif;
}

.site-footer ul,
.menu-list,
.stack-list {
    padding: 0;
    list-style: none;
    margin: 0;
}

.site-footer li,
.stack-list li,
.menu-list li {
    margin-bottom: 0.6rem;
    color: rgba(226, 232, 240, 0.82);
}

.footer-bar {
    padding-top: 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(226, 232, 240, 0.14);
    color: rgba(226, 232, 240, 0.76);
}

.admin-body {
    background: linear-gradient(180deg, #edf6ff 0%, #f8fafc 100%);
}

.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: linear-gradient(180deg, #09111e 0%, #162033 100%);
    color: var(--panel-text);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.brand-admin strong,
.brand-admin small {
    color: white;
}

.admin-nav {
    display: grid;
    gap: 0.35rem;
}

.admin-nav a {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    color: rgba(226, 232, 240, 0.85);
}

.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.admin-main {
    padding: 2rem;
}

.admin-header {
    margin-bottom: 1.5rem;
}

.admin-grid {
    display: grid;
    gap: 1.5rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table-actions {
    justify-content: flex-start;
}

.table-actions form {
    margin: 0;
}

.table-actions button {
    padding: 0.65rem 0.9rem;
    box-shadow: none;
}

.stack-form,
.feature-list,
.checkbox-grid,
.menu-block,
.hint-box {
    display: grid;
    gap: 1rem;
}

.stack-form label,
.stack-form label span,
.media-card figcaption {
    display: grid;
    gap: 0.45rem;
}

.stack-form input,
.stack-form textarea,
.stack-form select {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: white;
}

.checkbox-row {
    justify-content: flex-start;
}

.checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flash {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    font-weight: 700;
}

.flash-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.flash-error {
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.auth-card {
    width: min(100%, 560px);
}

.stat-card strong {
    display: block;
    margin-top: 0.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
}

.media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.media-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 18px;
    background: #e2e8f0;
}

.hint-box {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(14, 165, 233, 0.08);
}

.rich-editor-shell {
    display: grid;
    gap: 0.75rem;
}

.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.rich-editor-toolbar button {
    padding: 0.65rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(241, 245, 249, 0.9);
    cursor: pointer;
}

.rich-editor,
.rich-editor-preview {
    min-height: 340px;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: white;
    overflow-wrap: anywhere;
}

.rich-editor:focus {
    outline: 2px solid rgba(29, 78, 216, 0.22);
}

.rich-editor-preview[hidden] {
    display: none;
}

.menu-sortable-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.menu-sortable-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.92);
    cursor: grab;
}

.menu-sortable-item span,
.menu-sortable-item small {
    color: var(--muted);
}

.menu-sortable-item.is-dragging {
    opacity: 0.45;
}

.user-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
}

.role-badge {
    display: inline-flex;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(29, 78, 216, 0.12);
    color: var(--secondary);
    font-weight: 800;
    font-size: 0.78rem;
}

.editor-empty {
    color: var(--muted);
}

@media (max-width: 1024px) {
    .hero-grid,
    .split-feature,
    .contact-panel,
    .footer-grid,
    .form-grid.two-up,
    .form-grid.three-up,
    .form-grid.four-up,
    .cards.cards-3,
    .cards.cards-4,
    .counters,
    .two-column-admin,
    .admin-stats,
    .checkbox-grid,
    .media-grid,
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 1rem;
        right: 1rem;
        padding: 1rem;
        background: white;
        border-radius: 20px;
        box-shadow: var(--shadow);
        border: 1px solid var(--line);
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav.is-open {
        display: flex;
    }

    .user-grid {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: inline-flex;
        padding: 0.75rem 1rem;
        border-radius: 999px;
        border: 1px solid var(--line);
        background: white;
    }

    .nav-shell {
        position: relative;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .topbar-inner,
    .nav-shell,
    .footer-bar,
    .admin-toolbar,
    .hero-actions,
    .section-heading.with-link,
    .table-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero,
    .section,
    .page-hero {
        padding: 3rem 0;
    }

    .hero-copy h1,
    .page-hero h1,
    .auth-card h1 {
        font-size: 2.3rem;
    }

    .admin-main {
        padding: 1rem;
    }

    .rich-editor,
    .rich-editor-preview {
        min-height: 240px;
    }

    .menu-sortable-item {
        flex-direction: column;
        align-items: flex-start;
    }
}