/* Buklo workspace theme. Loaded after page-specific styles. */
:root {
    --bg: #f3f6f6;
    --surface: #ffffff;
    --soft: #f7f9f9;
    --text: #071426;
    --muted: #667386;
    --line: #dce4e7;
    --green: #20ae55;
    --green2: #10b8b2;
    --greenDark: #148940;
    --brand-soft: #eaf8f0;
    --teal-soft: #e8f8f7;
    --navy: #071426;
    --orange: #c7602f;
    --red: #d94c4c;
    --blue: #5d88dc;
    --sidebar: 252px;
    --r: 8px;
    --shadow: 0 10px 28px rgba(7, 20, 38, .055);
}

html {
    background: var(--bg);
}

body,
body.has-admin-chrome,
body.has-server-admin-chrome {
    background: var(--bg);
    color: var(--text);
}

.admin-layout,
.dashboard-layout {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    background: var(--bg);
}

.sidebar,
.dashboard-sidebar,
.app-sidebar,
.has-admin-chrome:not(.dashboard-page) > .app-sidebar,
.has-server-admin-chrome > .app-sidebar {
    width: var(--sidebar);
    border-right: 1px solid var(--line);
    background: #ffffff;
    box-shadow: none;
}

.sidebar-logo,
.dashboard-brand,
.app-brand {
    height: 104px;
    min-height: 104px;
    padding: 24px 28px;
    background: #ffffff;
}

.brand-logo--sidebar {
    width: 160px;
    max-height: 54px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    object-position: left center;
}

.sidebar-nav,
.dashboard-nav,
.app-nav {
    gap: 6px;
    padding: 18px 18px;
}

.sidebar-nav__group {
    display: grid;
    gap: 5px;
    margin-bottom: 18px;
}

.sidebar-nav__label {
    padding: 0 15px 7px;
    color: #8a96a5;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-nav__item,
.sidebar-footer__link,
.dashboard-nav__link,
.app-nav-link,
.app-logout {
    min-height: 46px;
    gap: 12px;
    margin: 0;
    padding: 0 15px;
    border: 0;
    border-radius: 8px;
    color: #465367;
    font-size: 14px;
    font-weight: 560;
}

.sidebar-nav__bullet,
.dashboard-nav__link > span:first-child,
.app-nav-icon {
    width: 8px;
    min-width: 8px;
    height: 8px;
    min-height: 8px;
    border-radius: 2px;
    background: #c8d1da;
}

.sidebar-nav__item:hover,
.sidebar-nav__item--active,
.sidebar-footer__link:hover,
.dashboard-nav__link:hover,
.dashboard-nav__link.is-active,
.app-nav-link:hover,
.app-nav-link.active,
.app-logout:hover {
    border: 0;
    background: var(--brand-soft);
    color: var(--greenDark);
    box-shadow: none;
}

.sidebar-nav__item:hover .sidebar-nav__bullet,
.sidebar-nav__item--active .sidebar-nav__bullet,
.dashboard-nav__link:hover > span:first-child,
.dashboard-nav__link.is-active > span:first-child,
.app-nav-link:hover .app-nav-icon,
.app-nav-link.active .app-nav-icon {
    background: var(--green);
}

.sidebar-footer,
.dashboard-sidebar__footer {
    gap: 5px;
    padding: 16px 18px 22px;
    border-top-color: #edf0ef;
}

.sidebar-context {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.sidebar-context__mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: 12px;
    font-weight: 750;
}

.sidebar-context > span:last-child {
    display: grid;
    min-width: 0;
}

.sidebar-context strong {
    overflow: hidden;
    color: var(--navy);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-context small {
    color: var(--muted);
    font-size: 10px;
}

.app-logout {
    margin: auto 18px 22px;
    border-top: 0 !important;
    color: #68716e;
}

.admin-main,
.dashboard-main,
.has-admin-chrome:not(.dashboard-page) .app-content,
.has-server-admin-chrome .app-content {
    width: 100%;
    min-width: 0;
    padding: 0 38px 48px;
}

.workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    margin: 0 -38px 34px;
    padding: 12px 38px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .9);
}

.workspace-toolbar > div {
    display: grid;
    gap: 2px;
}

.workspace-toolbar span,
.workspace-toolbar time {
    color: var(--muted);
    font-size: 12px;
}

.workspace-toolbar strong {
    color: var(--navy);
    font-size: 15px;
    font-weight: 680;
}

.admin-shell,
.page-wrapper,
.page-container {
    max-width: 1500px;
    margin: 0 auto;
}

.admin-page-header {
    align-items: center;
    margin-bottom: 30px;
}

.admin-page-title,
.page-title {
    font-size: 30px;
    font-weight: 650;
}

.admin-page-subtitle {
    max-width: 760px;
    margin-top: 7px;
    color: var(--muted);
}

.page-eyebrow {
    margin: 0 0 7px;
    color: var(--greenDark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.header {
    display: block;
    width: 100%;
    margin-bottom: 24px;
    padding: 0;
    background: transparent;
    color: var(--text);
    box-shadow: none;
    text-align: left;
}

.admin-layout .header,
.dashboard-layout .header {
    display: block;
}

.header h1 {
    color: var(--text);
    font-size: 30px;
    font-weight: 650;
}

.header p {
    margin: 7px 0 0;
    color: var(--muted);
}

.card,
.variant,
.day-card,
.break-card,
.vacation-card,
.working-day,
.item-card {
    border: 1px solid rgba(215, 224, 221, .9);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card {
    margin-bottom: 22px;
    padding: 24px;
}

.card h2,
.card h3,
.tab-header h2,
.item-header h3 {
    color: var(--text);
    font-weight: 620;
}

.dashboard-section {
    margin-bottom: 30px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.section-heading h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 620;
}

.section-heading span {
    color: var(--muted);
    font-size: 13px;
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card,
.stat-card:nth-child(n) {
    position: relative;
    min-height: 142px;
    padding: 22px 20px 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--green);
}

.stat-card:nth-child(even)::before { background: var(--green2); }
.stat-card.stat-cancelled::before { background: var(--red); }

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
}

.stat-number {
    margin: 20px 0 10px;
    color: var(--navy);
    font-size: 32px;
    font-weight: 700;
}

.stat-note {
    color: var(--muted);
    font-size: 12px;
}

.quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.quick-actions .btn {
    justify-content: flex-start;
    min-height: 52px;
    padding: 0 16px;
    position: relative;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
}

.quick-actions .btn::after {
    content: "\2192";
    margin-left: auto;
    color: var(--green);
    font-size: 18px;
}

.quick-actions .btn:hover {
    border-color: #aeb8b5;
    background: #fafcfb;
}

.dashboard-upcoming {
    padding: 24px 26px;
}

.booking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-bottom-color: #edf0ef;
}

.booking-item > div {
    display: grid;
    gap: 3px;
}

.booking-item span,
.booking-item small {
    color: var(--muted);
}

.empty-state {
    margin: 0;
    padding: 26px;
    border: 1px dashed #ccd5d2;
    border-radius: 8px;
    background: var(--soft);
    color: var(--muted);
    text-align: center;
}

.btn,
button,
input[type="submit"] {
    min-height: 40px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #e9eeec;
    color: #28312f;
    font-size: 13px;
    font-weight: 620;
    box-shadow: none;
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    background: #dde5e2;
    box-shadow: none;
}

.btn-primary,
.btn-success,
button[type="submit"] {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.btn-primary:hover,
.btn-success:hover,
button[type="submit"]:hover {
    border-color: var(--greenDark);
    background: var(--greenDark);
}

.btn-secondary,
.btn-outline {
    border-color: var(--line);
    background: #fff;
    color: #4e5855;
}

.btn-danger {
    border-color: #f1cccc;
    background: #fff0f0;
    color: #b83838;
}

input,
select,
textarea {
    min-height: 42px;
    border: 1px solid #d8e0de;
    border-radius: 8px;
    background: #f9fbfa;
    color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(16, 184, 178, .14);
}

.nav-tabs {
    display: flex;
    width: fit-content;
    max-width: 100%;
    gap: 5px;
    margin-bottom: 26px;
    padding: 4px;
    border-radius: 8px;
    background: #e8edeb;
}

.nav-tab {
    min-width: 140px;
    min-height: 38px;
    border-radius: 6px;
}

.nav-tab.active {
    border-color: transparent;
    background: #fff;
    color: var(--text);
    box-shadow: 0 3px 10px rgba(24, 39, 35, .07);
}

.items-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 14px;
}

.item-card {
    min-height: 130px;
    box-shadow: none;
}

.manage-card .item-card:not(.spec-list-card) {
    display: grid;
    min-height: 112px;
    grid-template-columns: minmax(150px, .75fr) minmax(180px, 1.25fr) auto;
    grid-template-rows: auto;
    gap: 16px;
    align-items: center;
}

.manage-card .item-card:not(.spec-list-card) > .item-header {
    display: contents;
}

.manage-card .item-card:not(.spec-list-card) > .item-header h3 {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    margin: 0;
}

.manage-card .item-card:not(.spec-list-card) > .item-details {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-height: 72px;
    margin: 0;
}

.manage-card .item-card:not(.spec-list-card) > .item-header .item-actions {
    grid-column: 3;
    grid-row: 1;
}

.manage-card .item-card:not(.spec-list-card) > .item-header .item-actions,
.manage-card .spec-list-card .item-actions {
    display: flex;
    width: auto;
    flex-wrap: nowrap;
    gap: 7px;
    margin: 0;
}

.manage-card .item-actions .btn {
    width: auto;
    min-width: max-content;
    min-height: 38px;
    padding: 8px 13px;
    white-space: nowrap;
}

.manage-card .item-actions .action-icon-button {
    display: inline-grid;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    place-items: center;
}

.action-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.manage-card .spec-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
}

.manage-card .spec-list-card .item-actions {
    flex: 0 0 auto;
    margin-left: auto;
}

.manage-card .spec-list-card {
    min-height: 100px;
}

#servicesList .items-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

#servicesList .item-card:not(.spec-list-card) {
    min-height: 92px;
    grid-template-columns: minmax(190px, .8fr) minmax(280px, 1.8fr) auto;
    padding: 14px 16px;
}

#servicesList .item-card:not(.spec-list-card) > .item-details {
    min-height: 62px;
    padding: 12px 14px;
}

#servicesList .item-card:not(.spec-list-card) > .item-header .item-actions {
    justify-self: end;
}

#specialistsList .items-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

#specialistsList .spec-list-card {
    width: 100%;
    max-width: none;
    min-height: 84px;
    padding: 14px 16px;
}

.calendar-controls {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.week-calendar,
.month-calendar,
.day-calendar {
    border-color: var(--line);
    border-radius: 8px;
    background: var(--line);
}

.calendar-event,
.month-event {
    border-radius: 6px;
    box-shadow: none;
}

.table-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

table {
    margin: 0;
}

th {
    background: #f5f7f6;
    color: #65706d;
    font-size: 11px;
}

th,
td {
    padding: 13px 12px;
    border-bottom-color: #e9edec;
}

tr:hover {
    background: #fafcfb;
}

.status-badge {
    border-radius: 6px;
}

.modal {
    background: rgba(22, 31, 29, .55);
    backdrop-filter: blur(3px);
}

.modal-content {
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(18, 31, 27, .22);
}

/* Workspace panels and forms */
.admin-page-header,
.tab-header,
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.manage-card {
    padding: 0;
    overflow: hidden;
}

.manage-card .nav-tabs {
    width: 100%;
    margin: 0;
    padding: 10px 18px 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: #fff;
}

.manage-card .nav-tab {
    min-height: 46px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
}

.manage-card .nav-tab.active {
    border-bottom-color: var(--green);
    color: var(--greenDark);
    box-shadow: none;
}

.manage-card .tab-content {
    padding: 24px;
}

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

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 16px;
    align-items: end;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.filters-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
    padding-top: 2px;
}

.form-group {
    display: grid;
    align-content: start;
    gap: 7px;
    margin: 0;
}

.form-group label,
.form-group legend {
    color: #344156;
    font-size: 13px;
    font-weight: 670;
}

.form-group small,
.form-section__heading p {
    color: var(--muted) !important;
    font-size: 12px !important;
    line-height: 1.5;
}

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

.form-grid--two,
.form-grid--profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.new-booking-form,
.company-settings-card {
    max-width: 1080px;
}

.new-booking-form > .form-grid {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.new-booking-form .divider {
    margin: 24px 0;
    border-color: var(--line);
}

.slots-panel {
    min-height: 110px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.company-settings-card > h2,
.privacy-settings > div:first-child {
    margin-bottom: 18px;
}

.privacy-settings {
    display: grid;
    gap: 18px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.settings-actions,
.form-actions,
.specialist-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.modal-content {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    padding: 0;
    overflow: auto;
    background: #fff;
}

#specialistModal .modal-content {
    width: min(920px, calc(100vw - 32px));
}

#serviceModal .modal-content,
#specialistModal .modal-content {
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: var(--r);
}

#serviceForm,
#specialistForm {
    gap: 0;
    padding: 0;
}

#serviceModal .modal-content .modal-header h3,
#specialistModal .modal-content .modal-header h3 {
    margin: 2px 0 0;
    padding: 0;
    border: 0;
    font-size: 21px;
}

#serviceForm > .form-actions,
#specialistForm > .form-actions {
    margin: 0;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
}

#specialistForm {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 16px 22px 0;
}

#specialistForm > .form-accordion {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;
}

#specialistForm > .form-accordion:not([open]) {
    height: 70px;
}

.form-section__summary {
    position: relative;
    display: flex;
    min-height: 68px;
    align-items: center;
    padding: 11px 54px 11px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.form-section__summary::-webkit-details-marker {
    display: none;
}

.form-section__summary::after {
    content: "";
    position: absolute;
    right: 18px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--greenDark);
    border-radius: 50%;
    background:
        linear-gradient(#fff, #fff) center / 12px 2px no-repeat,
        linear-gradient(#fff, #fff) center / 2px 12px no-repeat,
        var(--greenDark);
}

.form-accordion[open] > .form-section__summary::after {
    content: "";
    background:
        linear-gradient(#fff, #fff) center / 12px 2px no-repeat,
        var(--greenDark);
}

.form-section__summary > span {
    display: grid;
    gap: 3px;
    align-content: center;
}

.form-section__summary strong {
    color: var(--navy);
    font-size: 15px;
    font-weight: 680;
}

.form-section__summary small {
    color: var(--muted);
    font-size: 12px;
}

.form-accordion[open] > .form-section__summary {
    border-bottom: 1px solid var(--line);
    background: var(--soft);
}

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

#specialistForm .specialist-admin-settings {
    grid-column: auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

#specialistForm .setting-toggle,
#specialistForm .calendar-access-field {
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

#specialistForm .setting-toggle {
    align-items: center;
}

#specialistForm .setting-toggle input,
#specialistForm .calendar-access-option input {
    flex: 0 0 18px;
    margin: 0;
}

#specialistForm .setting-toggle > span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.calendar-access-heading {
    display: grid;
    gap: 3px;
}

.calendar-access-heading strong {
    color: #344156;
    font-size: 13px;
    font-weight: 670;
}

.calendar-access-heading small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

#specialistForm .calendar-access-list {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px 16px;
    margin-top: 13px;
}

#specialistForm .calendar-access-option {
    display: flex;
    min-height: 34px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 7px 10px;
    border-radius: 6px;
    background: #fff;
    color: #344156;
    cursor: pointer;
}

#specialistForm .calendar-access-option:hover {
    background: #f1f5f4;
}

.photo-editor {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

#specialistForm .specialist-photo-preview {
    display: flex;
    min-width: 0;
    grid-template-columns: none;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    background: transparent;
}

#specialistForm .specialist-photo-preview[style*="display:none"] {
    display: none !important;
}

#specialist_photo_preview {
    width: 84px !important;
    min-width: 84px;
    height: 84px !important;
    margin: 0 !important;
    border-radius: 50%;
    object-fit: cover;
}

.photo-editor__current {
    display: grid;
    gap: 5px;
}

.photo-editor__current small {
    color: var(--muted);
}

.photo-editor__current .btn {
    width: fit-content;
    margin-top: 4px;
}

#specialistForm .specialist-photo-field {
    padding: 0;
    border: 0;
    background: transparent;
}

#specialistForm .specialist-description-field {
    grid-column: auto;
}

#specialistForm > .specialist-form-actions {
    position: sticky;
    z-index: 4;
    bottom: 0;
    margin: 6px -22px 0;
}

.modal-header {
    position: sticky;
    z-index: 5;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
}

.modal-header h2,
.modal-header h3 {
    margin: 2px 0 0;
    color: var(--navy);
    font-size: 21px;
}

.modal-close {
    display: grid;
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.form-section-kicker {
    color: var(--greenDark);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.form-section {
    display: grid;
    gap: 18px;
    margin: 20px 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--soft);
}

.form-section__heading {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.form-section__heading h4,
.form-section__heading p {
    margin: 0;
}

.form-section__heading h4 {
    margin-bottom: 4px;
    color: var(--navy);
    font-size: 15px;
}

.setting-toggle,
.settings-toggle {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: #fff;
}

.calendar-access-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.table-wrap {
    overflow: auto;
}

.table td:first-child,
.table th:first-child {
    padding-left: 18px;
}

.table td:last-child,
.table th:last-child {
    padding-right: 18px;
}

.back-link {
    color: var(--greenDark);
    font-weight: 650;
}

@media (max-width: 920px) {
    :root { --sidebar: 100%; }

    .sidebar,
    .dashboard-sidebar,
    .app-sidebar,
    .has-admin-chrome:not(.dashboard-page) > .app-sidebar,
    .has-server-admin-chrome > .app-sidebar {
        width: 100%;
        border-bottom-color: #e3e8e6;
    }

    .sidebar-logo,
    .dashboard-brand,
    .app-brand {
        height: 68px;
        min-height: 68px;
        justify-content: flex-start;
        padding: 10px 16px;
    }

    .brand-logo--sidebar {
        width: 132px;
        max-height: 44px;
    }

    .sidebar-nav,
    .dashboard-nav,
    .app-nav,
    .sidebar-footer,
    .dashboard-sidebar__footer {
        padding: 9px 10px;
    }

    .sidebar-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }

    .sidebar-nav__group {
        display: contents;
    }

    .sidebar-nav__label,
    .sidebar-context {
        display: none;
    }

    .sidebar-nav__item,
    .sidebar-footer__link,
    .dashboard-nav__link,
    .app-nav-link {
        min-height: 40px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }

    .sidebar-nav__item--active,
    .dashboard-nav__link.is-active,
    .app-nav-link.active {
        border-color: #b8e8ca;
        background: var(--brand-soft);
        color: var(--greenDark);
    }

    .admin-main,
    .dashboard-main,
    .has-admin-chrome:not(.dashboard-page) .app-content,
    .has-server-admin-chrome .app-content {
        padding: 0 12px 34px;
    }

    .workspace-toolbar {
        min-height: 58px;
        margin: 0 -12px 22px;
        padding: 10px 14px;
    }

    .workspace-toolbar time {
        display: none;
    }

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

    .admin-page-header {
        align-items: stretch;
        margin-bottom: 22px;
    }

    .admin-page-title,
    .page-title,
    .header h1 {
        font-size: 25px;
    }

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

    .stat-card,
    .stat-card:nth-child(n) {
        min-height: 126px;
        padding: 16px;
    }

    .booking-item,
    .section-heading {
        align-items: flex-start;
    }

    .booking-item {
        display: grid;
    }

    html,
    body,
    .admin-shell,
    .manage-card,
    .manage-card .tab-content,
    #servicesList,
    #specialistsList,
    #servicesList .items-grid,
    #specialistsList .items-grid {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .manage-card .tab-content {
        padding: 16px;
    }

    #servicesList .item-card:not(.spec-list-card) {
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 12px;
        align-items: center;
        padding: 14px;
    }

    #servicesList .item-card:not(.spec-list-card) > .item-header {
        display: contents;
    }

    #servicesList .item-card:not(.spec-list-card) > .item-header h3 {
        min-width: 0;
        grid-column: 1;
        grid-row: 1;
        overflow-wrap: anywhere;
    }

    #servicesList .item-card:not(.spec-list-card) > .item-header .item-actions {
        width: auto;
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    #servicesList .item-card:not(.spec-list-card) > .item-details {
        width: 100%;
        min-width: 0;
        min-height: 0;
        grid-column: 1 / -1;
        grid-row: 2;
        overflow: hidden;
    }

    #servicesList .item-details p {
        overflow-wrap: anywhere;
    }

    #specialistsList .spec-list-card {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 0;
        padding: 14px;
    }

    #specialistsList .spec-card-header {
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
    }

    #specialistsList .spec-main {
        display: flex;
        width: 100%;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    #specialistsList .spec-main > div:last-child,
    #specialistsList .spec-contact,
    #specialistsList .spec-name {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #specialistsList .spec-list-card .item-actions {
        display: flex;
        width: auto;
        flex-wrap: nowrap;
        justify-self: end;
        margin: 0;
    }
}

@media (max-width: 520px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-tabs {
        width: 100%;
    }

    .nav-tab {
        min-width: 0;
        flex: 1 1 0;
    }

    .admin-page-header,
    .tab-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-page-header > .btn,
    .tab-header > .btn {
        width: 100%;
    }

    .filters-grid,
    .form-grid,
    .form-grid--two,
    .form-grid--profile,
    .calendar-access-list {
        grid-template-columns: 1fr;
    }

    .form-grid__wide {
        grid-column: auto;
    }

    .form-section {
        margin: 12px;
        padding: 16px;
    }

    .modal-header,
    .form-actions,
    .specialist-form-actions {
        padding: 14px 16px;
    }

    .manage-card .tab-content {
        padding: 16px;
    }

    #servicesList .items-grid,
    #specialistsList .items-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .manage-card .item-actions {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
    }

    .manage-card .item-actions .btn {
        flex: 1 1 auto;
    }

    .manage-card .item-actions .action-icon-button {
        flex: 0 0 36px;
    }

    .manage-card .item-card:not(.spec-list-card) {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .manage-card .item-card:not(.spec-list-card) > .item-header h3 {
        grid-column: 1;
        grid-row: 1;
    }

    .manage-card .item-card:not(.spec-list-card) > .item-details {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .manage-card .item-card:not(.spec-list-card) > .item-header .item-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .manage-card .spec-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .manage-card .spec-list-card .item-actions {
        margin-left: 0;
    }

    #specialistForm {
        padding: 10px 10px 0;
    }

    .form-section__summary {
        padding: 12px 48px 12px 14px;
    }

    .form-section__body,
    .photo-editor {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
    }

    #specialistForm > .specialist-form-actions {
        margin: 4px -10px 0;
    }

    .manage-card .tab-content {
        padding: 12px;
    }

    #specialistsList .spec-card-header {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    #specialistsList .spec-list-card .item-actions {
        width: 100%;
        justify-content: flex-end;
        justify-self: stretch;
    }

    #specialistsList .spec-list-card .item-actions .btn-secondary {
        flex: 1 1 auto;
    }
}

.app-brand-row {
    display: contents;
}

.sidebar-menu-toggle {
    display: none;
}

@media (max-width: 920px) {
    [data-mobile-sidebar] {
        position: sticky;
        z-index: 40;
        top: 0;
        display: block;
        width: 100%;
        height: auto;
        overflow: visible;
        border: 0;
        border-bottom: 1px solid var(--line);
        background: #fff;
    }

    [data-mobile-sidebar] .sidebar-logo,
    [data-mobile-sidebar] .app-brand-row {
        display: flex;
        height: 68px;
        min-height: 68px;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        background: #fff;
    }

    [data-mobile-sidebar] .app-brand {
        width: auto;
        height: auto;
        min-height: 0;
        padding: 0;
        background: transparent;
    }

    .sidebar-menu-toggle {
        display: grid;
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 10px;
        place-content: center;
        gap: 4px;
        border: 1px solid #b8e8ca;
        border-radius: 8px;
        background: var(--brand-soft);
        box-shadow: none;
    }

    .sidebar-menu-toggle:hover {
        background: #dff5e8;
        box-shadow: none;
        transform: none;
    }

    .sidebar-menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: var(--greenDark);
        transition: transform .16s ease, opacity .16s ease;
    }

    [data-mobile-sidebar].sidebar--open .sidebar-menu-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    [data-mobile-sidebar].sidebar--open .sidebar-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    [data-mobile-sidebar].sidebar--open .sidebar-menu-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    [data-mobile-sidebar] .sidebar-nav,
    [data-mobile-sidebar] .app-nav,
    [data-mobile-sidebar] .sidebar-footer,
    [data-mobile-sidebar] .app-logout {
        display: none;
    }

    [data-mobile-sidebar].sidebar--open .sidebar-nav,
    [data-mobile-sidebar].sidebar--open .app-nav {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
        max-height: calc(100vh - 190px);
        gap: 4px;
        padding: 8px 12px;
        overflow-y: auto;
        border-top: 1px solid var(--line);
    }

    [data-mobile-sidebar].sidebar--open .sidebar-footer {
        display: grid;
        gap: 4px;
        margin: 0;
        padding: 8px 12px 12px;
        border-top: 1px solid var(--line);
    }

    [data-mobile-sidebar].sidebar--open .app-logout {
        display: flex;
        min-height: 42px;
        margin: 0;
        padding: 0 27px 14px;
    }

    [data-mobile-sidebar] .sidebar-nav__group {
        display: grid;
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
        margin: 0 0 8px;
    }

    [data-mobile-sidebar] .sidebar-nav__item,
    [data-mobile-sidebar] .app-nav-link,
    [data-mobile-sidebar] .sidebar-footer__link {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    [data-mobile-sidebar] .sidebar-nav__label {
        display: block;
        padding: 7px 12px 3px;
    }

    [data-mobile-sidebar] .sidebar-context {
        display: none;
    }
}
