:root {
    --nav: #11161b;
    --nav-2: #1a222a;
    --paper: #f4f7f9;
    --panel: #ffffff;
    --line: #dce3e8;
    --ink: #171b1f;
    --muted: #697680;
    --accent: #1e6fa8;
    --accent-dark: #15527d;
    --accent-soft: #e9f3fa;
    --danger: #a72b2b;
    --success: #176b45;
    --radius: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    padding: 24px 16px;
    background: var(--nav);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.admin-brand {
    padding: 0 10px 22px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.admin-brand h2 {
    margin: 0;
    font-size: 1.3rem;
    letter-spacing: .06em;
}

.admin-brand small {
    color: #9fb1bf;
}

.admin-nav {
    display: grid;
    gap: 4px;
    padding-top: 18px;
}

.admin-nav a,
.logout-form button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #dce6ec;
    text-decoration: none;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.admin-nav a:hover,
.logout-form button:hover {
    background: var(--nav-2);
    color: #fff;
}

.logout-form {
    margin-top: auto;
}

main {
    max-width: 1500px;
    margin-left: 240px;
    padding: 34px;
}

h1, h2, h3 {
    letter-spacing: -0.03em;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
}

.page-head,
.section-head,
.head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.page-head {
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .14em;
}

.muted,
.section-head p {
    color: var(--muted);
}

.panel {
    margin: 18px 0;
    padding: 24px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: 0 1px 0 rgba(20,30,40,.02);
}

.panel h2 {
    margin: 0;
}

.section-head {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.section-head p {
    margin: 5px 0 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 9px;
    background: var(--accent);
    color: #fff !important;
    text-decoration: none;
    font-weight: 750;
    cursor: pointer;
}

.button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: #fff;
    color: var(--ink) !important;
    border: 1px solid var(--line);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.wide {
    grid-column: 1 / -1;
}

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #35404a;
    font-size: .9rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5dc;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 450;
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    resize: vertical;
}

small {
    color: var(--muted);
    font-weight: 450;
}

.service-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.editor-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfd;
}

.editor-card h3 {
    margin: 0;
    color: var(--accent-dark);
}

.save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin: 24px 0 12px;
    padding: 14px 16px;
    border: 1px solid #bfcbd3;
    border-radius: 12px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 16px 40px rgba(20,28,36,.12);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.metrics div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.metrics strong {
    display: block;
    font-size: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.flash,
.errors {
    margin-bottom: 16px;
    padding: 13px 15px;
    border-radius: 9px;
}

.flash {
    background: #e8f6ee;
    color: var(--success);
}

.errors {
    background: #fff0f0;
    color: var(--danger);
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--nav);
}

.login form {
    width: min(420px, 92vw);
    padding: 30px;
    border-radius: 12px;
    background: #fff;
    display: grid;
    gap: 12px;
}

@media (max-width: 900px) {
    aside {
        position: static;
        width: auto;
        min-height: auto;
    }

    .admin-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    main {
        margin: 0;
        padding: 20px;
    }

    .cols,
    .grid,
    .service-editor {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .page-head,
    .section-head,
    .save-bar {
        flex-direction: column;
    }

    .admin-nav {
        grid-template-columns: 1fr;
    }

    .save-bar .button {
        width: 100%;
    }
}

.remember{display:flex;flex-direction:row;align-items:center;gap:8px}.remember input{width:auto}


.nav-group,
.nav-subgroup {
    margin: 0;
}

.nav-group > summary,
.nav-subgroup > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    color: #dce6ec;
    font-weight: 600;
}

.nav-group > summary::-webkit-details-marker,
.nav-subgroup > summary::-webkit-details-marker {
    display: none;
}

.nav-group > summary::after,
.nav-subgroup > summary::after {
    content: "▾";
    float: right;
    color: #86a6bc;
}

.nav-group:not([open]) > summary::after,
.nav-subgroup:not([open]) > summary::after {
    content: "›";
}

.nav-group > summary:hover,
.nav-subgroup > summary:hover {
    background: var(--nav-2);
    color: #fff;
}

.nav-submenu {
    display: grid;
    gap: 2px;
    padding: 4px 0 8px 10px;
    border-left: 1px solid rgba(255,255,255,.10);
    margin-left: 12px;
}

.nav-submenu a {
    padding: 8px 10px;
    font-size: .92rem;
}

.nav-submenu.nested {
    padding-left: 8px;
}

.nav-subgroup > summary {
    padding: 8px 10px;
    font-size: .92rem;
}

.website-page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.website-page-grid.compact {
    margin-top: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.website-page-card {
    display: flex;
    min-height: 130px;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.website-page-grid.compact .website-page-card {
    min-height: 78px;
}

.website-page-card:hover {
    transform: translateY(-2px);
    border-color: #aebdc7;
    box-shadow: 0 12px 26px rgba(20,28,36,.08);
}

.website-page-card strong {
    font-size: 1.12rem;
}

.website-page-card span {
    color: var(--muted);
    line-height: 1.45;
}

.service-links {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.info-box {
    padding: 14px 16px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-dark);
}


/* NOSEY ADMIN SIDEBAR SCROLL CORRECTION */
aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    height: 100vh;
    min-height: 0;
    padding: 24px 16px;
    background: var(--nav);
    color: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-brand {
    flex: 0 0 auto;
}

.admin-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 18px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #4a5965 transparent;
}

.admin-nav::-webkit-scrollbar {
    width: 8px;
}

.admin-nav::-webkit-scrollbar-track {
    background: transparent;
}

.admin-nav::-webkit-scrollbar-thumb {
    background: #4a5965;
    border-radius: 999px;
}

.admin-nav::-webkit-scrollbar-thumb:hover {
    background: #657786;
}

.logout-form {
    flex: 0 0 auto;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,.09);
}

.nav-group,
.nav-subgroup {
    min-width: 0;
}

.nav-submenu {
    min-width: 0;
}

.nav-submenu a,
.nav-group > summary,
.nav-subgroup > summary {
    white-space: normal;
    line-height: 1.35;
}

@media (max-width: 900px) {
    aside {
        position: static;
        width: auto;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .admin-nav {
        overflow: visible;
        max-height: none;
        padding-right: 0;
    }

    .logout-form {
        margin-top: 14px;
    }
}
