* {
    box-sizing: border-box;
}

body {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    margin: 0;
    color: #18221f;
    background: #f4f5f2;
    font-family: Inter, system-ui, sans-serif;
}

.auth-main {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.login-card {
    width: min(100%, 430px);
    padding: 28px;
    border: 1px solid #e0e4dc;
    border-radius: 8px;
    background: #fff;
}

.installer-card {
    width: min(100%, 820px);
}

.installer-card h2 {
    margin: 14px 0 0;
    font-size: 16px;
}

.login-card h1 {
    margin: 0 0 22px;
}

.login-card form {
    display: grid;
    gap: 16px;
}

.login-kicker {
    margin: 0 0 8px;
    color: #176b5d;
    font-size: 13px;
    font-weight: 900;
}

.login-note {
    margin: 18px 0 0;
    color: #66736e;
    font-size: 13px;
    line-height: 1.5;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: #16251f;
}

.panel-brand {
    display: block;
    margin-bottom: 28px;
    color: #fff;
    font-size: 18px;
    font-weight: 850;
    text-decoration: none;
}

.sidebar nav {
    display: grid;
    gap: 6px;
}

.sidebar a {
    padding: 12px 14px;
    border-radius: 7px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}

.sidebar a.active,
.sidebar a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-main {
    min-width: 0;
    padding: 28px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-topbar p {
    margin: 0 0 6px;
    color: #66736e;
    font-size: 13px;
    font-weight: 800;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 28px;
}

.notice {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #b8dccd;
    border-radius: 7px;
    color: #116348;
    background: #e8f7f0;
    font-weight: 750;
}

.notice.danger {
    border-color: #f1c3bd;
    color: #9d2b1b;
    background: #fff0ee;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-grid article,
.admin-panel {
    border: 1px solid #e0e4dc;
    border-radius: 8px;
    background: #fff;
}

.metric-grid article {
    padding: 18px;
}

.metric-grid span {
    display: block;
    margin-bottom: 10px;
    color: #69746f;
    font-size: 13px;
    font-weight: 800;
}

.metric-grid strong {
    font-size: 22px;
}

.admin-panel {
    margin-bottom: 18px;
    padding: 22px;
}

.admin-panel h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.admin-panel p {
    max-width: 760px;
    color: #66736e;
    line-height: 1.65;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.panel-heading p {
    margin: 6px 0 0;
}

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

label {
    display: grid;
    gap: 7px;
    color: #37423f;
    font-size: 13px;
    font-weight: 850;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d8ded5;
    border-radius: 7px;
    color: #17231f;
    background: #fff;
    font: inherit;
}

textarea {
    resize: vertical;
}

input[type="color"] {
    height: 44px;
    padding: 4px;
}

.switch {
    display: inline-flex;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
}

.switch input {
    width: 18px;
    min-height: 18px;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid #176b5d;
    border-radius: 7px;
    color: #fff;
    background: #176b5d;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    color: #176b5d;
    background: #fff;
}

.button.danger {
    color: #fff;
    background: #b93222;
}

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

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e6e9e2;
    text-align: left;
    font-size: 14px;
}

th {
    color: #66736e;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

td a {
    color: #176b5d;
    font-weight: 850;
    text-decoration: none;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.table-actions form {
    margin: 0;
}

.link-button {
    border: 0;
    padding: 0;
    color: #176b5d;
    background: transparent;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}

.link-button.danger {
    color: #b93222;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.status-pill.ok {
    color: #116348;
    background: #e8f7f0;
}

.status-pill.warn {
    color: #8a5a00;
    background: #fff5d7;
}

.status-pill.error {
    color: #9d2b1b;
    background: #fff0ee;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    padding: 14px 0;
    background: linear-gradient(rgba(244, 245, 242, 0), #f4f5f2 28%);
}

.upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.media-card {
    overflow: hidden;
    border: 1px solid #e0e4dc;
    border-radius: 8px;
    background: #fafbf8;
}

.media-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eef1eb;
}

.media-card div {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.media-card strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card span {
    color: #66736e;
    font-size: 12px;
    font-weight: 800;
}

.media-card a {
    color: #176b5d;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.media-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
}

.media-variants a {
    padding: 4px 7px;
    border-radius: 999px;
    background: #eef5f1;
}

.media-path-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

@media (max-width: 860px) {
    body {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

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

    .admin-main {
        padding: 18px;
    }

    .metric-grid,
    .form-grid,
    .upload-form {
        grid-template-columns: 1fr;
    }
}

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

.logout-form button {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-weight: 850;
    cursor: pointer;
}

.social-list,
.menu-list,
.hours-grid {
    display: grid;
    gap: 12px;
}

.social-row,
.menu-row,
.hours-row {
    display: grid;
    grid-template-columns: 1.2fr 2fr 0.7fr auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e6e9e2;
    border-radius: 8px;
    background: #fafbf8;
}

.hours-row {
    grid-template-columns: 1.2fr 1fr 1fr auto;
}

.menu-row {
    grid-template-columns: 1.2fr 1fr 1.6fr 0.7fr auto;
}

.hours-row strong {
    align-self: center;
}

code {
    padding: 2px 5px;
    border-radius: 4px;
    background: #eef1eb;
}

@media (max-width: 860px) {
    .social-row,
    .menu-row,
    .hours-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}
