:root {
    --sidebar-width: 220px;
    font-family: system-ui, -apple-system, Segoe UI, sans-serif;
    color: #203040;
    background: #f3f5f8;
    font-size: 14px;
    line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: #176a92; text-decoration: none; }
a:hover { text-decoration: underline; }
:where(a, button, input, textarea, select, summary, .table-wrap):focus-visible {
    outline: 2px solid #84bed9;
    outline-offset: 3px;
}
.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    padding: 20px 14px;
    background: #152b3e;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.brand { color: white; font-size: 23px; font-weight: 800; white-space: nowrap; }
.brand span { color: #eaa05c; }
.sidebar-content { display: flex; flex-direction: column; gap: 16px; flex: 1; min-height: 0; }
.sidebar-nav { display: grid; align-content: start; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar-nav a { display: block; padding: 10px; color: #cedae4; border-radius: 6px; overflow-wrap: anywhere; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: #29475e; color: white; text-decoration: none; }
.sidebar-dropdown { min-width: 0; }
.sidebar-dropdown > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 10px; color: #cedae4; font-weight: 400; border-radius: 6px; list-style: none; overflow-wrap: anywhere; }
.sidebar-dropdown > summary::-webkit-details-marker { display: none; }
.sidebar-dropdown > summary::after { content: ""; width: 7px; height: 7px; flex-shrink: 0; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.sidebar-dropdown[open] > summary { margin-bottom: 4px; }
.sidebar-dropdown[open] > summary::after { transform: rotate(225deg); }
.sidebar-dropdown > summary:hover, .sidebar-dropdown > summary.active { background: #29475e; color: white; }
.sidebar-submenu { display: grid; gap: 2px; margin: 0 0 4px 10px; padding-left: 8px; border-left: 1px solid #355166; }
.sidebar-submenu a { padding: 8px 10px; }
.sidebar-signout { margin: 0; flex-shrink: 0; }
.sidebar-signout button { width: 100%; }
.nav-toggle { flex-shrink: 0; }
main { margin-left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); max-width: 1700px; padding: clamp(16px, 2vw, 28px); min-width: 0; }
.page-heading, .toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-heading { margin-bottom: 20px; }
.page-heading > *, .toolbar > * { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.admin-user { color: #687d90; font-size: 13px; }
h1 { font-size: clamp(21px, 2vw, 28px); line-height: 1.25; margin: 4px 0; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.35; margin-top: 0; }
h3 { font-size: 15px; overflow-wrap: anywhere; }
.eyebrow { color: #73879b; font-size: 10px; letter-spacing: 1.5px; font-weight: 700; margin: 0; }
p { line-height: 1.6; overflow-wrap: anywhere; }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    max-width: 100%;
    border: 0;
    border-radius: 6px;
    background: #176a92;
    color: white;
    padding: 9px 14px;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
}
.button:hover { text-decoration: none; }
button.secondary { background: #e8eff4; color: #203f54; }
button.danger-button { background: #b43b42; }
.invoice-delete-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #dce4ed; border-radius: 12px; color: #203040; background: white; box-shadow: 0 20px 60px #152b3e40; overflow-y: auto; }
.invoice-delete-dialog::backdrop { background: #152b3e99; }
.invoice-delete-dialog h2 { margin-bottom: 12px; }
.invoice-delete-dialog p { margin: 0 0 22px; }
.invoice-delete-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; }
.invoice-delete-actions button { min-width: 84px; min-height: 44px; }
[data-invoice-delete-trigger]:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; min-width: 0; font-size: 13px; font-weight: 600; margin-bottom: 14px; overflow-wrap: anywhere; }
input, textarea, select {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
    border: 1px solid #cbd4de;
    background: white;
    color: #203040;
    border-radius: 5px;
    padding: 9px 10px;
    font: inherit;
    margin-top: 6px;
}
input[type=file] { font-size: 13px; }
textarea { resize: vertical; }
small { display: block; color: #6a7b8a; font-weight: 400; margin-top: 5px; overflow-wrap: anywhere; }
.panel { min-width: 0; padding: 18px; background: white; border: 1px solid #e0e6ed; border-radius: 9px; margin-bottom: 16px; box-shadow: 0 3px 12px #152b3e04; overflow-wrap: anywhere; }
.cards, .columns, .content-inputs, .media-grid, #content-fields { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.overview-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards .panel { margin-bottom: 0; }
.cards p { margin: 0 0 5px; }
.columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.content-inputs, #content-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
:where(.cards, .columns, .content-inputs, .media-grid, #content-fields) > * { min-width: 0; }
.stat { font-size: 32px; line-height: 1.2; }
.notice { padding: 12px 16px; background: #e3f4ed; border-radius: 7px; margin-bottom: 16px; overflow-wrap: anywhere; }
.notice ul { margin: 0; padding-left: 20px; }
.error { background: #fde7e7; }
.badge { display: inline-block; padding: 4px 7px; border-radius: 5px; background: #eef3f7; font-size: 11px; }
.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; }
.table-wrap table { min-width: 600px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #e5eaf0; vertical-align: top; overflow-wrap: anywhere; }
th { font-size: 12px; color: #687d90; }
td form { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
td form select { margin: 0; width: auto; min-width: 140px; }
td input[type=number] { width: 80px; }
.media-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.media-grid img { width: 100%; height: 145px; object-fit: contain; background: #f5f7f9; }
.media-grid form, article > form + form { margin-top: 12px; }
.media-replacement { margin-bottom: 14px; }
.media-replacement label { margin-bottom: 6px; }
.media-replacement small { margin-bottom: 10px; }
.setting-image-preview { display: block; width: 100%; height: 145px; object-fit: cover; border: 1px solid #dce4ed; border-radius: 6px; margin-top: 8px; }
.branding-image-preview { object-fit: contain; background: #f5f7f9; }
.favicon-image-preview { height: 64px; }
.team-member-thumbnail { display: block; width: 56px; height: 64px; object-fit: cover; border-radius: 5px; }
.team-member-photo { display: block; width: 160px; max-width: 100%; height: 180px; object-fit: cover; border-radius: 6px; margin: 8px 0 16px; }
.testimonial-photo { display: block; width: 96px; max-width: 100%; height: 96px; object-fit: cover; border-radius: 6px; margin: 8px 0 16px; }
.testimonial-table td { padding: 8px 10px; vertical-align: middle; }
.testimonial-excerpt { margin: 0; max-width: 420px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.testimonial-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.service-table td { padding: 8px 10px; vertical-align: middle; }
.service-thumbnail { display: block; width: 44px; height: 40px; object-fit: contain; border-radius: 5px; background: #f5f7f9; }
.service-photo { display: block; width: 180px; max-width: 100%; height: 135px; object-fit: contain; border-radius: 6px; margin: 8px 0 16px; background: #f5f7f9; }
.service-title { display: block; max-width: 260px; line-height: 1.4; }
.service-excerpt { margin: 0; max-width: 420px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.service-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pre-wrap { white-space: pre-wrap; }
summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 16px; }
fieldset { min-width: 0; border: 1px solid #dce4ed; border-radius: 6px; margin-bottom: 16px; padding: 12px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; margin: 10px 20px 10px 0; }
.check-label input { width: auto; min-height: 0; margin: 0; }
#structured-editor .toolbar { margin-top: 12px; }
#html-source { font: 13px/1.6 Consolas, monospace; }
#content-fields { max-height: 620px; overflow: auto; }
#page-preview { width: 100%; height: min(650px, 75vh); border: 1px solid #dde5ee; background: white; }
.cms-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.cms-pagination p { margin: 0; color: #687d90; font-size: 12px; }
.pagination-links, .pagination-pages { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pagination-step, .pagination-number { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; min-width: 36px; padding: 8px 10px; border: 1px solid #dce4ed; border-radius: 5px; background: white; }
.cms-pagination [aria-disabled=true] { color: #687d90; }
.pagination-number.current { background: #176a92; border-color: #176a92; color: white; }
.pagination-position { display: none; color: #687d90; font-size: 12px; }
.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 16px; background: #152b3e; }
.login main { margin: 0; width: 100%; max-width: 420px; padding: clamp(20px, 5vw, 30px); }
.login button { width: 100%; margin-bottom: 20px; }
@media (max-width: 1200px) {
    .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .admin-sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; max-height: 100vh; max-height: 100dvh; padding: 10px 16px; gap: 12px; z-index: 20; }
    .brand { font-size: 21px; }
    .sidebar-content { flex: 0 1 auto; max-height: calc(100vh - 76px); max-height: calc(100dvh - 76px); overflow-y: auto; }
    .sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: none; overflow-y: visible; }
    .sidebar-dropdown { grid-column: 1 / -1; }
    .sidebar-signout button { width: auto; }
    main { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
    main { padding: 14px; }
    .page-heading { gap: 6px; margin-bottom: 16px; }
    .panel { padding: 14px; margin-bottom: 14px; }
    .cards { gap: 10px; margin-bottom: 14px; }
    .overview-stats { grid-template-columns: minmax(0, 1fr); }
    .columns, .content-inputs, #content-fields { grid-template-columns: minmax(0, 1fr); }
    .toolbar { gap: 10px; }
    button, .button, input, select, .pagination-step { min-height: 44px; }
    .sidebar-dropdown > summary, .sidebar-submenu a { min-height: 44px; }
    input, textarea, select { font-size: 16px; }
    input[type=file] { font-size: 13px; }
    .pagination-pages { display: none; }
    .pagination-position { display: inline; }
    .pagination-links { width: 100%; justify-content: space-between; }
}
@media (max-width: 380px) {
    .sidebar-nav { grid-template-columns: minmax(0, 1fr); }
    .page-heading .admin-user { width: 100%; }
}
