.ap-board {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ap-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
}

.ap-toolbar-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.ap-date-label {
    font-weight: 600;
    color: rgb(15 118 110);
}

.ap-date-input,
.ap-select {
    border-radius: 0.6rem;
    border: 1px solid rgb(203 213 225);
    background: #fff;
    padding: 0.4rem 0.65rem;
    font-size: 0.875rem;
}

.ap-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
}

.ap-toolbar-branch {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 14rem;
}

.ap-specs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ap-spec-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ap-spec {
    border: 1px solid rgb(203 213 225);
    background: #fff;
    color: rgb(51 65 85);
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.ap-spec--child {
    font-weight: 600;
    background: rgb(248 250 252);
}

.ap-spec:hover {
    border-color: rgb(45 212 191);
    color: rgb(15 118 110);
}

.ap-spec.is-on {
    border-color: rgb(13 148 136);
    background: rgb(13 148 136);
    color: #fff;
}

.dark .ap-spec {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(226 232 240);
}

.dark .ap-spec--child {
    background: rgb(30 41 59);
}

.dark .ap-spec.is-on {
    background: rgb(13 148 136);
    border-color: rgb(13 148 136);
    color: #fff;
}

.ap-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(71 85 105);
}

.ap-empty {
    border-radius: 1rem;
    border: 1px dashed rgb(203 213 225);
    padding: 2rem 1.25rem;
    text-align: center;
    background: rgb(248 250 252);
}

.ap-empty-title {
    font-weight: 600;
    color: rgb(15 23 42);
}

.ap-empty-hint {
    margin-top: 0.35rem;
    font-size: 0.875rem;
    color: rgb(100 116 139);
}

.ap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    gap: 0.85rem;
    align-items: start;
}

.ap-col {
    border-radius: 1rem;
    border: 1px solid rgb(226 232 240);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.ap-col-head {
    padding: 0.85rem 0.95rem 0.7rem;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
}

.ap-col-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.ap-col-note {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.9;
}

.ap-col-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem;
    max-height: 70vh;
    overflow: auto;
}

.ap-slot {
    display: block;
    width: 100%;
    text-align: left;
    border-radius: 0.7rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid transparent;
}

.ap-slot--free {
    border: 1px dashed rgb(45 212 191);
    background: rgb(240 253 250);
    color: rgb(15 118 110);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ap-slot--free:hover {
    background: rgb(204 251 241);
    border-color: rgb(20 184 166);
}

.ap-slot-time {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.ap-slot-free {
    font-size: 0.8rem;
}

.ap-slot-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: rgb(15 23 42);
}

.ap-slot-service,
.ap-slot-status {
    font-size: 0.75rem;
    color: rgb(71 85 105);
}

.ap-slot--taken {
    background: rgb(248 250 252);
    border-color: rgb(203 213 225);
}

.ap-slot--info {
    background: rgb(239 246 255);
    border-color: rgb(147 197 253);
}

.ap-slot--warning {
    background: rgb(255 251 235);
    border-color: rgb(252 211 77);
}

.ap-slot--success {
    background: rgb(236 253 245);
    border-color: rgb(110 231 183);
}

.ap-slot--danger {
    background: rgb(254 242 242);
    border-color: rgb(252 165 165);
}

.ap-slot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.ap-mini {
    border-radius: 999px;
    border: 1px solid rgb(203 213 225);
    background: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    color: rgb(51 65 85);
}

.ap-mini--primary {
    border-color: rgb(13 148 136);
    color: rgb(13 148 136);
}

.ap-mini--danger {
    border-color: rgb(248 113 113);
    color: rgb(185 28 28);
}

.ap-closed {
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgb(100 116 139);
}

.ap-badge {
    display: inline-flex;
    margin-top: 0.35rem;
    border-radius: 999px;
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
}

.ap-upcoming {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

    .ap-col-body {
        max-height: none;
    }
}

.ds-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ds-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ds-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 16rem;
}

.ds-field > span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
}

.ds-field select,
.ds-search input {
    border: 1px solid rgb(203 213 225);
    border-radius: 0.75rem;
    background: #fff;
    padding: 0.55rem 0.8rem;
    font-size: 0.9rem;
    color: rgb(15 23 42);
}

.ds-empty {
    border: 1px dashed rgb(203 213 225);
    border-radius: 1.1rem;
    padding: 2.4rem 1.25rem;
    text-align: center;
    background: rgb(248 250 252);
}

.ds-empty--panel {
    min-height: 22rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ds-empty-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgb(15 23 42);
}

.ds-empty-hint {
    margin-top: 0.4rem;
    color: rgb(100 116 139);
    font-size: 0.9rem;
}

.ds-shell {
    display: grid;
    grid-template-columns: 19rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.ds-rail,
.ds-main {
    border: 1px solid rgb(226 232 240);
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ds-rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.95rem 1rem 0.35rem;
}

.ds-rail-title {
    font-weight: 800;
    color: rgb(15 23 42);
}

.ds-rail-count {
    font-size: 0.75rem;
    color: rgb(100 116 139);
}

.ds-search {
    position: relative;
    margin: 0.35rem 0.85rem 0.7rem;
}

.ds-search-icon {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: rgb(148 163 184);
}

.ds-search input {
    width: 100%;
    padding-left: 2.15rem;
}

.ds-doctors {
    display: flex;
    flex-direction: column;
    max-height: 38rem;
    overflow: auto;
    padding: 0 0.55rem 0.65rem;
    gap: 0.3rem;
}

.ds-doctor {
    display: flex;
    width: 100%;
    text-align: left;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    padding: 0.55rem 0.6rem;
    background: transparent;
    color: inherit;
}

.ds-doctor:hover {
    background: rgb(240 253 250);
}

.ds-doctor.is-active {
    background: rgb(240 253 250);
    border-color: rgb(94 234 212);
    box-shadow: inset 3px 0 0 rgb(13 148 136);
}

.ds-avatar,
.ds-hero-avatar {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.ds-avatar {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 0.72rem;
    color: rgb(13 148 136);
    background: rgb(204 251 241);
}

.ds-doctor.is-active .ds-avatar {
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.ds-doctor-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.12rem;
}

.ds-doctor-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: rgb(15 23 42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ds-doctor-days {
    font-size: 0.72rem;
    color: rgb(100 116 139);
}

.ds-rail-empty {
    padding: 1.2rem 0.6rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgb(148 163 184);
}

.ds-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 58%, #2dd4bf 100%);
}

.ds-hero-person {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.ds-hero-avatar {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.ds-hero-name {
    font-size: 1.2rem;
    font-weight: 800;
}

.ds-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    opacity: 0.92;
}

.ds-body {
    padding: 1.1rem 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ds-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 900px) {
    .ds-controls {
        grid-template-columns: 1fr 1.4fr;
        align-items: end;
    }
}

.ds-control-label {
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(100 116 139);
}

.ds-chips,
.ds-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ds-chip,
.ds-preset {
    border: 1px solid rgb(203 213 225);
    background: #fff;
    color: rgb(51 65 85);
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.ds-chip.is-on {
    border-color: rgb(13 148 136);
    background: rgb(13 148 136);
    color: #fff;
}

.ds-preset:hover,
.ds-chip:hover:not(.is-on) {
    border-color: rgb(45 212 191);
    color: rgb(15 118 110);
}

.ds-preset--muted {
    color: rgb(148 163 184);
}

.ds-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.ds-day {
    display: flex;
    min-height: 10.5rem;
    flex-direction: column;
    gap: 0.55rem;
    border: 1px solid rgb(226 232 240);
    border-radius: 1rem;
    padding: 0.7rem 0.7rem 0.8rem;
    background: rgb(248 250 252);
}

.ds-day--on {
    border-color: rgb(45 212 191);
    background: linear-gradient(180deg, rgb(240 253 250) 0%, #fff 42%);
    box-shadow: 0 8px 18px rgba(13, 148, 136, 0.08);
}

.ds-day--sun:not(.ds-day--on) {
    background: rgb(254 242 242);
    border-color: rgb(254 202 202);
}

.ds-day-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.ds-day-head input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: rgb(13 148 136);
}

.ds-day-short {
    font-size: 0.95rem;
    font-weight: 800;
    color: rgb(15 23 42);
}

.ds-day-full {
    width: 100%;
    font-size: 0.72rem;
    color: rgb(100 116 139);
}

.ds-times {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.ds-times label {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.ds-times span {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgb(148 163 184);
}

.ds-times input[type='time'] {
    width: 100%;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.6rem;
    padding: 0.38rem 0.45rem;
    font-size: 0.88rem;
    background: #fff;
    color: rgb(15 23 42);
}

.ds-duration {
    margin-top: auto;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgb(13 148 136);
}

.ds-day-off {
    margin-top: auto;
    font-size: 0.8rem;
    color: rgb(148 163 184);
}

.dark .ds-field > span,
.dark .ds-control-label,
.dark .ds-times span,
.dark .ds-doctor-days,
.dark .ds-rail-count {
    color: rgb(148 163 184);
}

.dark .ds-rail,
.dark .ds-main,
.dark .ds-field select,
.dark .ds-search input,
.dark .ds-times input[type='time'],
.dark .ds-chip,
.dark .ds-preset {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
    color: rgb(226 232 240);
}

.dark .ds-empty {
    background: rgb(15 23 42);
    border-color: rgb(51 65 85);
}

.dark .ds-empty-title,
.dark .ds-rail-title,
.dark .ds-doctor-name,
.dark .ds-day-short {
    color: rgb(241 245 249);
}

.dark .ds-doctor:hover,
.dark .ds-doctor.is-active {
    background: rgb(19 78 74);
}

.dark .ds-avatar {
    background: rgb(19 78 74);
    color: rgb(94 234 212);
}

.dark .ds-day {
    background: rgb(30 41 59);
    border-color: rgb(51 65 85);
}

.dark .ds-day--on {
    background: linear-gradient(180deg, rgb(19 78 74) 0%, rgb(15 23 42) 50%);
    border-color: rgb(45 212 191);
}

.dark .ds-day--sun:not(.ds-day--on) {
    background: rgb(69 10 10);
    border-color: rgb(127 29 29);
}

.dark .ds-chip.is-on {
    background: rgb(13 148 136);
    border-color: rgb(13 148 136);
    color: #fff;
}

@media (max-width: 1100px) {
    .ds-week {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ds-day {
        min-height: 0;
    }
}

@media (max-width: 860px) {
    .ds-shell {
        grid-template-columns: 1fr;
    }

    .ds-doctors {
        max-height: 14rem;
    }

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