:root {
    --black: #0d0d0d;
    --white: #ffffff;
    --red: #ff4b55;
    --red-dark: #dd343f;
    --red-soft: #fff0f1;
    --ink: #f5f5f5;
    --panel: #1b1b1b;
    --panel-soft: #222222;
    --line: #343434;
    --gray-100: #f4f4f4;
    --gray-200: #e6e6e6;
    --gray-500: #b7b7b7;
    --gray-800: #242424;
    --shadow: 0 26px 72px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--black);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.auth-page {
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
    padding: 24px;
    background:
        radial-gradient(circle at 78% 18%, rgba(255, 75, 85, 0.12), transparent 26%),
        linear-gradient(135deg, #030303 0%, #090909 52%, #170506 100%),
        url("../img/logo.png") center / 520px auto no-repeat;
}

.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 70px 70px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 78%);
    pointer-events: none;
}

.auth-shell {
    width: min(100%, 460px);
    position: relative;
    z-index: 1;
}

.auth-panel,
.dashboard-card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: var(--panel);
    padding: 38px 42px;
    box-shadow: var(--shadow);
}

.auth-panel {
    backdrop-filter: blur(10px);
}

.admin-kicker {
    margin: 0 0 4px;
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 34px;
}

.auth-brand img,
.auth-brand-mark {
    width: 100%;
    height: 86px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.auth-brand img {
    object-fit: contain;
    padding: 0;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--red);
    font-size: 24px;
    font-weight: 800;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    color: var(--ink);
    font-size: 34px;
    line-height: 1.15;
}

h2 {
    margin-bottom: 12px;
    font-size: 24px;
    line-height: 1.2;
}

.dashboard-card p:last-child {
    color: var(--gray-500);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 0;
}

.auth-form label {
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    padding: 10px 14px;
    color: var(--white);
    font: inherit;
}

.auth-form input:focus {
    border-color: var(--red);
    background: #252525;
    outline: 3px solid rgba(255, 75, 85, 0.18);
    outline-offset: 2px;
}

.auth-form button,
.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: var(--red);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.auth-form button {
    margin-top: 20px;
    width: 100%;
}

.auth-form button:hover,
.logout-link:hover {
    background: var(--red-dark);
    box-shadow: 0 12px 24px rgba(255, 75, 85, 0.2);
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.alert {
    margin-top: 20px;
    border: 1px solid rgba(255, 75, 85, 0.36);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 75, 85, 0.12);
    color: #ffd7da;
    line-height: 1.4;
}

.admin-page {
    display: grid;
    grid-template-columns: 244px 1fr;
    background:
        radial-gradient(circle at 90% 12%, rgba(255, 75, 85, 0.08), transparent 24%),
        #0b0b0b;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid var(--line);
    background: #101010;
    padding: 22px 16px;
}

.admin-logo {
    display: flex;
    align-items: center;
    min-height: 68px;
    margin-bottom: 22px;
}

.admin-logo img {
    width: 100%;
    max-height: 62px;
    object-fit: contain;
}

.admin-logo strong {
    color: var(--white);
    font-size: 20px;
}

.admin-menu {
    display: grid;
    gap: 8px;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
    padding: 0 12px;
}

.admin-menu-item:hover,
.admin-menu-item.is-active {
    border-color: rgba(255, 75, 85, 0.28);
    background: rgba(255, 75, 85, 0.1);
    color: var(--white);
}

.admin-layout {
    min-width: 0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(13, 13, 13, 0.82);
    padding: 18px 26px;
}

.admin-header h1 {
    margin: 0;
    font-size: 22px;
}

.logout-link {
    min-width: 76px;
    padding: 0 18px;
}

.admin-main {
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 28px;
}

.admin-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

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

.admin-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: var(--red);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 0 14px;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.admin-button:hover {
    background: var(--red-dark);
    box-shadow: 0 12px 24px rgba(255, 75, 85, 0.18);
    transform: translateY(-1px);
}

.admin-button-secondary {
    border-color: rgba(255, 75, 85, 0.26);
    background: rgba(255, 75, 85, 0.12);
    color: #ffd5d8;
}

.admin-button-secondary:hover {
    background: rgba(255, 75, 85, 0.2);
}

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

.admin-content-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.admin-stat-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 126px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--stat-border, rgba(255, 75, 85, 0.35));
    border-left: 4px solid var(--stat-color, var(--red));
    background:
        linear-gradient(110deg, var(--stat-glow, rgba(255, 75, 85, 0.14)), transparent 56%),
        var(--panel);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.admin-stat-icon {
    display: grid;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    margin-right: 19px;
    place-items: center;
    border: 1px solid var(--stat-border, rgba(255, 75, 85, 0.4));
    border-radius: 10px;
    background: var(--stat-icon-bg, rgba(255, 75, 85, 0.18));
    color: var(--stat-color, var(--red));
    font-size: 29px;
    box-shadow: inset 0 0 22px var(--stat-glow, rgba(255, 75, 85, 0.12));
}

.admin-stat-content {
    min-width: 0;
}

.admin-stat-content span {
    display: block;
    margin-bottom: 7px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 700;
}

.admin-stat-content strong {
    display: block;
    overflow: hidden;
    color: var(--white);
    font-size: 30px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-visits {
    --stat-color: #ff4b55;
    --stat-border: rgba(255, 75, 85, 0.38);
    --stat-icon-bg: rgba(255, 75, 85, 0.18);
    --stat-glow: rgba(255, 75, 85, 0.13);
}

.stat-today {
    --stat-color: #45c98a;
    --stat-border: rgba(69, 201, 138, 0.35);
    --stat-icon-bg: rgba(69, 201, 138, 0.16);
    --stat-glow: rgba(69, 201, 138, 0.11);
}

.stat-period {
    --stat-color: #efad45;
    --stat-border: rgba(239, 173, 69, 0.36);
    --stat-icon-bg: rgba(239, 173, 69, 0.16);
    --stat-glow: rgba(239, 173, 69, 0.11);
}

.stat-services {
    --stat-color: #5598e9;
    --stat-border: rgba(85, 152, 233, 0.36);
    --stat-icon-bg: rgba(85, 152, 233, 0.17);
    --stat-glow: rgba(85, 152, 233, 0.11);
}

.stat-portfolio {
    --stat-color: #d56ee8;
    --stat-border: rgba(213, 110, 232, 0.36);
    --stat-icon-bg: rgba(213, 110, 232, 0.16);
    --stat-glow: rgba(213, 110, 232, 0.11);
}

.admin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20;
    padding: 24px;
}

.admin-modal.is-open {
    display: grid;
    place-items: center;
}

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.admin-modal-panel {
    position: relative;
    width: min(100%, 520px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #242424;
    box-shadow: var(--shadow);
    padding: 0;
}

.admin-modal-large {
    width: min(100%, 920px);
}

.admin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--red);
    padding: 18px 22px;
}

.admin-modal-header h2 {
    margin: 0;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.settings-form {
    display: grid;
    gap: 18px;
}

.settings-section {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: #242424;
    box-shadow: var(--shadow);
}

.settings-section-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #2b2b2b;
    padding: 18px 22px;
}

.settings-section-header h2 {
    margin: 0;
}

.settings-grid {
    padding: 22px;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: rgba(27, 27, 27, 0.94);
    padding: 14px;
    backdrop-filter: blur(12px);
}

.section-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-stack {
    display: grid;
    align-content: start;
    gap: 8px;
}

.repeat-list {
    display: grid;
    gap: 22px;
    padding: 22px;
}

.repeat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 110px 34px;
    gap: 12px;
    align-items: end;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    background: #2a2a2a;
    padding: 14px;
}

.repeat-row-card {
    grid-template-columns: minmax(170px, 1fr) minmax(0, 1fr) minmax(0, 1fr) 92px 34px;
}

.repeat-row > div {
    display: grid;
    gap: 8px;
}

.repeat-remove {
    align-self: end;
}

.icon-select-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.icon-select-row i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 75, 85, 0.28);
    border-radius: 8px;
    color: var(--red);
    font-size: 20px;
}

.settings-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #2e2e2e;
    color: var(--white);
    font: inherit;
    padding: 9px 11px;
}

.settings-form select:focus {
    border-color: var(--red);
    background: #333333;
    outline: 3px solid rgba(255, 75, 85, 0.16);
    outline-offset: 2px;
}

.service-editor {
    display: grid;
    gap: 14px;
    overflow: hidden;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #292929;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    padding: 0 16px 16px;
}

.service-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 -16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #202020;
    padding: 11px 16px;
}

.service-editor-heading {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.service-editor-heading span {
    color: var(--red);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.service-editor-heading strong {
    overflow: hidden;
    color: var(--white);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.service-editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-featured {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    border: 1px solid #484848;
    border-radius: 7px;
    background: #292929;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 0 10px;
}

.service-featured input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.service-featured i {
    color: var(--gray-500);
    font-size: 14px;
}

.service-featured:has(input:checked) {
    border-color: rgba(255, 75, 85, 0.42);
    background: rgba(255, 75, 85, 0.1);
    color: #ffd5d8;
}

.service-featured:has(input:checked) i {
    color: var(--red);
}

.service-featured:has(input:checked) i::before {
    content: "\f586";
}

.service-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border: 1px solid rgba(255, 75, 85, 0.36);
    border-radius: 8px;
    background: rgba(255, 75, 85, 0.1);
    color: #ff8a91;
    cursor: pointer;
    font-size: 14px;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.service-editor .form-grid {
    gap: 10px 12px;
}

.service-editor .form-grid > div {
    gap: 6px;
}

.service-editor label {
    font-size: 12px;
}

.service-editor input,
.service-editor select {
    min-height: 36px;
    padding: 7px 10px;
}

.service-editor textarea {
    min-height: 64px;
    padding: 8px 10px;
}

.service-editor .icon-select-row {
    grid-template-columns: 34px minmax(0, 1fr);
}

.service-editor .icon-select-row i {
    width: 34px;
    height: 34px;
    font-size: 17px;
}

.service-delete:hover {
    border-color: var(--red);
    background: var(--red);
    color: var(--white);
}

.service-detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 7px;
    background: #292929;
    color: #ededed;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    padding: 0 10px;
}

.service-detail-button:hover {
    border-color: rgba(255, 75, 85, 0.55);
    color: var(--red);
}

.service-detail-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

body.modal-open {
    overflow: hidden;
}

.service-detail-modal {
    width: min(100%, 1040px);
}

.modal-kicker {
    display: block;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.service-detail-form {
    gap: 20px;
}

.detail-service-reference {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 75, 85, 0.22);
    border-radius: 8px;
    background: rgba(255, 75, 85, 0.07);
    padding: 12px 14px;
}

.detail-service-reference > i {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 7px;
    background: rgba(255, 75, 85, 0.14);
    color: var(--red);
    font-size: 19px;
}

.detail-service-reference div {
    display: grid;
    gap: 2px;
}

.detail-service-reference span {
    color: var(--gray-500);
    font-size: 11px;
}

.detail-service-reference strong {
    font-size: 15px;
}

.detail-description {
    min-height: 150px;
}

.detail-image-preview img {
    object-fit: cover;
}

.detail-active {
    margin-top: 8px;
}

.detail-items-section {
    display: grid;
    gap: 14px;
}

.detail-items-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.detail-items-header h3 {
    margin: 2px 0 0;
    font-size: 18px;
}

.detail-add-button {
    min-height: 36px;
}

.detail-items-list {
    display: grid;
    gap: 10px;
}

.detail-item-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(180px, 1.3fr) 78px 34px;
    align-items: end;
    gap: 10px;
    border: 1px solid #454545;
    border-radius: 8px;
    background: #2b2b2b;
    padding: 12px;
}

.detail-item-row > div {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.detail-item-row label {
    font-size: 11px;
}

.detail-item-row input,
.detail-item-row select {
    min-height: 36px;
    padding: 7px 9px;
}

.detail-item-delete {
    margin-bottom: 1px;
}

.portfolio-category-list,
.portfolio-project-list {
    gap: 14px;
}

.portfolio-category-row {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 88px 34px 34px;
    align-items: end;
    gap: 10px;
    border: 1px solid #464646;
    border-radius: 8px;
    background: #292929;
    padding: 12px;
}

.portfolio-category-row > div {
    display: grid;
    gap: 6px;
}

.portfolio-category-row label,
.portfolio-project-editor label {
    font-size: 12px;
}

.compact-check {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #242424;
    color: var(--gray-500);
    cursor: pointer;
}

.compact-check input {
    position: absolute;
    width: 1px !important;
    height: 1px !important;
    min-height: 0 !important;
    opacity: 0;
}

.compact-check:has(input:checked) {
    border-color: rgba(255, 75, 85, 0.42);
    background: rgba(255, 75, 85, 0.1);
    color: var(--red);
}

.portfolio-section-note {
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--gray-500);
    font-size: 12px;
    padding: 12px 22px;
}

.portfolio-project-editor {
    overflow: hidden;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #292929;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.portfolio-project-editor .service-editor-header {
    margin: 0;
}

.portfolio-project-body {
    display: block;
    padding: 16px;
}

.portfolio-project-body .form-grid {
    align-content: start;
    gap: 10px 12px;
}

.portfolio-project-body .form-grid > div {
    gap: 6px;
}

.portfolio-project-editor input,
.portfolio-project-editor select {
    min-height: 36px;
    padding: 7px 10px;
}

.portfolio-preview {
    min-height: 190px;
}

.portfolio-preview img {
    height: 190px;
    object-fit: cover;
}

.portfolio-media-form {
    gap: 18px;
}

.portfolio-media-list {
    display: grid;
    gap: 12px;
}

.portfolio-media-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 12px;
    border: 1px solid #464646;
    border-radius: 8px;
    background: #2b2b2b;
    padding: 12px;
}

.portfolio-media-preview {
    min-height: 130px;
}

.portfolio-media-preview img {
    height: 130px;
    object-fit: cover;
    padding: 0;
}

.portfolio-media-fields .form-grid {
    gap: 10px 12px;
}

.portfolio-media-fields .form-grid > div {
    gap: 6px;
}

.portfolio-media-fields label {
    font-size: 11px;
}

.portfolio-media-fields input,
.portfolio-media-fields select {
    min-height: 36px;
    padding: 7px 9px;
}

.portfolio-media-actions {
    display: grid;
    gap: 8px;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 42px;
    border: 1px solid #454545;
    border-radius: 8px;
    background: #242424;
    cursor: pointer;
    padding: 0 14px;
}

.checkbox-field input {
    width: 18px;
    height: 18px;
    min-height: 0;
    accent-color: var(--red);
}

.checkbox-field span {
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
}

.label-help {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-help button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 75, 85, 0.34);
    border-radius: 50%;
    background: rgba(255, 75, 85, 0.12);
    color: #ffd5d8;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.image-field {
    display: grid;
    gap: 8px;
}

.image-preview-box {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 150px;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #2e2e2e;
}

.image-preview-box img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    padding: 10px;
}

.image-preview-wide img {
    height: 260px;
    object-fit: cover;
}

.form-hint {
    margin: -2px 0 0;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.4;
}

.label-muted {
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
}

.admin-form {
    display: grid;
    gap: 10px;
    padding: 22px;
}

.admin-form label {
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.settings-form input,
.settings-form textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid #484848;
    border-radius: 8px;
    background: #2e2e2e;
    color: var(--white);
    font: inherit;
    padding: 9px 11px;
}

.settings-form .checkbox-field input {
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.admin-form textarea,
.settings-form textarea {
    min-height: 82px;
    resize: vertical;
}

.admin-form input:focus,
.admin-form textarea:focus,
.settings-form input:focus,
.settings-form textarea:focus {
    border-color: var(--red);
    background: #333333;
    outline: 3px solid rgba(255, 75, 85, 0.16);
    outline-offset: 2px;
}

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

.form-grid > div {
    display: grid;
    gap: 8px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-divider {
    height: 1px;
    margin: 14px 0 10px;
    background: #424242;
}

.modal-actions {
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3d3d3d;
}

.menu-toggle,
.admin-sidebar-backdrop {
    display: none;
}

@media (max-width: 640px) {
    .admin-content-grid {
        grid-template-columns: 1fr;
    }

    .admin-stat-card {
        min-height: 108px;
        padding: 17px;
    }

    .admin-stat-icon {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
        margin-right: 15px;
        font-size: 25px;
    }

    .auth-page {
        align-items: stretch;
        padding: 18px;
    }

    .auth-panel,
    .dashboard-card {
        padding: 24px;
    }

    h1 {
        font-size: 29px;
    }

    .auth-brand {
        margin-bottom: 24px;
    }

    .admin-header {
        padding: 14px;
    }

    .admin-main {
        padding: 14px;
    }

    .dashboard-card {
        padding: 18px;
    }

    .admin-header h1 {
        font-size: 20px;
    }

    .admin-kicker {
        font-size: 11px;
    }

    .logout-link {
        min-height: 38px;
        min-width: 64px;
        padding: 0 12px;
    }

    .admin-actions {
        width: 100%;
    }

    .admin-actions .admin-button {
        flex: 1 1 0;
    }

    .admin-modal {
        padding: 10px;
    }

    .admin-modal-panel {
        width: 100%;
        max-height: calc(100vh - 20px);
    }

    .admin-modal-header {
        padding: 14px 16px;
    }

    .admin-modal-header h2 {
        font-size: 20px;
    }

    .admin-form {
        padding: 16px;
    }

    .repeat-list {
        padding: 16px;
    }

    .repeat-row,
    .repeat-row-card {
        grid-template-columns: 1fr;
    }

    .repeat-remove {
        width: 100%;
    }

    .section-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .service-editor {
        padding: 0 12px 12px;
    }

    .service-editor-header {
        align-items: flex-start;
        margin: 0 -12px;
        padding: 10px 12px;
    }

    .service-editor-heading strong {
        font-size: 15px;
    }

    .service-editor-actions {
        flex: 0 0 auto;
    }

    .service-featured span {
        display: none;
    }

    .service-featured {
        width: 32px;
        padding: 0;
        justify-content: center;
    }

    .service-detail-button {
        width: 32px;
        padding: 0;
    }

    .service-detail-button span {
        display: none;
    }

    .detail-items-header {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-add-button {
        width: 100%;
    }

    .detail-item-row {
        grid-template-columns: minmax(0, 1fr) 64px 34px;
    }

    .detail-item-row > div {
        grid-column: 1 / -1;
    }

    .detail-item-row .detail-item-order {
        grid-column: 1 / 2;
    }

    .detail-item-delete {
        grid-column: 3;
        align-self: end;
    }
}

@media (max-width: 900px) {
    .detail-item-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    }

    .detail-item-row > div:nth-child(3) {
        grid-column: 1 / 3;
    }

    .detail-item-row .detail-item-order {
        grid-column: 1;
    }

    .detail-item-delete {
        grid-column: 3;
    }

    .admin-page {
        display: block;
        min-height: 100vh;
    }

    .admin-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        width: min(82vw, 260px);
        height: 100vh;
        padding: 18px;
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .menu-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 25;
        background: rgba(0, 0, 0, 0.64);
    }

    .menu-open .admin-sidebar-backdrop {
        display: block;
    }

    .admin-logo {
        min-height: 60px;
        margin-bottom: 18px;
    }

    .admin-logo img {
        max-height: 58px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        width: 40px;
        height: 40px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--panel);
        cursor: pointer;
    }

    .menu-toggle span {
        width: 18px;
        height: 2px;
        border-radius: 999px;
        background: var(--white);
    }

    .admin-welcome {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .portfolio-category-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 74px 34px 34px;
    }

    .portfolio-project-body {
        grid-template-columns: 1fr;
    }

    .portfolio-media-row {
        grid-template-columns: 120px minmax(0, 1fr) 34px;
    }
}

@media (max-width: 640px) {
    .detail-item-row {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .detail-item-row > div,
    .detail-item-row > div:nth-child(3) {
        grid-column: 1 / -1;
    }

    .detail-item-row .detail-item-order {
        grid-column: 1;
    }

    .detail-item-delete {
        grid-column: 2;
    }

    .portfolio-category-row {
        grid-template-columns: minmax(0, 1fr) 34px 34px;
    }

    .portfolio-category-row > div {
        grid-column: 1 / -1;
    }

    .portfolio-category-row > div:nth-of-type(3) {
        grid-column: 1;
    }

    .portfolio-project-body {
        padding: 12px;
    }

    .portfolio-media-row {
        grid-template-columns: minmax(0, 1fr) 34px;
    }

    .portfolio-media-preview,
    .portfolio-media-fields {
        grid-column: 1 / -1;
    }

    .portfolio-media-actions {
        grid-column: 2;
        grid-row: 1;
    }
}
