/* =============================
   HEADER / SUMMARY
================================ */

.cabinet-index-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.cabinet-index-title {
    font-size: 18px;
    font-weight: 600;
}

.cabinet-index-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.cabinet-index-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.cabinet-index-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 4px 10px;
    background: #eef2ff;
    border: 1px solid #e0e7ff;
    font-size: 11px;
    color: #4b5563;
}

.cabinet-index-chip-label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    color: #9ca3af;
}

.cabinet-index-chip-value {
    font-weight: 500;
    color: #111827;
}

/* =============================
   SUMMARY CARD (SHIFTS)
================================ */

.cabinet-index-summary-card {
    position: relative;
}

.cabinet-index-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.cabinet-index-summary-item {
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 8px 10px;
}

.cabinet-index-summary-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 2px;
}

.cabinet-index-summary-value {
    font-size: 15px;
    font-weight: 600;
}

/* =============================
   TOOLBAR (SEARCH + FILTER)
   (поки що запас, якщо захочеш додати пошук)
================================ */

.cabinet-index-toolbar {
    border-radius: 12px;
}

.cabinet-index-toolbar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cabinet-index-search {
    flex: 1 1 260px;
}

.cabinet-index-search-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.cabinet-index-search-input-wrap input {
    font-size: 13px;
}

.cabinet-index-filters {
    flex: 0 0 auto;
}

/* toggle */

.cabinet-index-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.cabinet-index-toggle input {
    display: none;
}

.cabinet-index-toggle-indicator {
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: #e5e7eb;
    position: relative;
    transition: background 0.15s ease;
}

.cabinet-index-toggle-indicator::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.15s ease;
}

.cabinet-index-toggle input:checked + .cabinet-index-toggle-indicator {
    background: #2563eb;
}

.cabinet-index-toggle input:checked + .cabinet-index-toggle-indicator::before {
    transform: translateX(14px);
}

.cabinet-index-toggle-label {
    font-size: 12px;
    color: #374151;
}

/* =============================
   TABLE (DESKTOP / TABLET)
================================ */

.cabinet-index-table-card {
    overflow: hidden;
}

.cabinet-index-table-header {
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.cabinet-index-table-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.cabinet-index-table-hint {
    font-size: 11px;
    color: #9ca3af;
    text-align: right;
}

.cabinet-index-table-wrapper {
    max-height: 70vh;
    overflow-y: auto;
}

.cabinet-index-table {
    border-collapse: separate;
    border-spacing: 0;
}

.cabinet-index-table thead tr {
    background: #f8fafc;
}

.cabinet-index-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    padding-top: 8px;
    padding-bottom: 8px;
}

.cabinet-index-table tbody td {
    font-size: 13px;
    vertical-align: middle;
    border-top: 1px solid #e5e7eb;
}

/* Зебра */

.cabinet-index-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.cabinet-index-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

/* Hover */

.cabinet-index-table tbody tr:hover {
    background-color: #e5f3ff;
}

/* Назва кабінету + slug */

.cabinet-index-name-main {
    font-weight: 600;
}

.cabinet-index-name-slug {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 2px 6px;
}

/* Тімліди */

.cabinet-index-teamleads-cell {
    min-width: 160px;
}

.cabinet-index-teamlead-badge {
    font-size: 11px;
    margin-right: 4px;
    margin-bottom: 3px;
}

/* Оператори (зміни) */

.cabinet-index-shift-cell {
    min-width: 150px;
}

.cabinet-index-shift-inner {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.cabinet-index-operator-name {
    font-size: 13px;
    font-weight: 500;
}

.cabinet-index-operator-tag {
    font-size: 11px;
    color: #6b7280;
}

/* ІНДИКАТОРИ ЗМІНИ (крапка) */

.cabinet-index-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    margin-top: 4px;
}

/* по замовчуванню підлаштовується через клас комірки */
.cabinet-index-shift-cell.has-operator .cabinet-index-dot {
    background: #16a34a;
}

.cabinet-index-shift-cell.no-operator .cabinet-index-dot {
    background: #d1d5db;
}

/* для легенди у підказці */
.cabinet-index-dot.demo-dot-filled {
    background: #16a34a;
}

.cabinet-index-dot.demo-dot-empty {
    background: #d1d5db;
}

/* Дії */

.cabinet-index-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* =============================
   MOBILE CARDS
================================ */

.cabinet-index-mobile-list {
    display: none; /* по замовчуванню приховано, показуємо тільки на мобайлі */
    margin-top: 10px;
}

.cabinet-index-mobile-card {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: radial-gradient(circle at top left, #eef2ff 0, #ffffff 50%, #f9fafb 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.cabinet-index-mobile-card + .cabinet-index-mobile-card {
    margin-top: 8px;
}

.cabinet-index-mobile-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 8px;
}

.cabinet-index-mobile-name {
    margin-bottom: 4px;
}

.cabinet-index-mobile-teamleads {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cabinet-index-mobile-head-actions .btn {
    font-size: 11px;
    padding: 4px 8px;
    white-space: nowrap;
}

.cabinet-index-mobile-body {
    border-top: 1px dashed #e5e7eb;
    padding-top: 6px;
    margin-top: 4px;
}

.cabinet-index-mobile-shift-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px;
    padding: 4px 0;
}

.cabinet-index-mobile-shift-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    min-width: 64px;
}

.cabinet-index-mobile-shift-value {
    flex: 1;
    border-radius: 8px;
    padding: 4px 6px;
    background: #f9fafb;
}

.cabinet-index-mobile-shift-value.has-operator {
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
}

.cabinet-index-mobile-shift-value.no-operator {
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
}

.cabinet-index-mobile-footer {
    margin-top: 8px;
}

/* =============================
   ADAPTIVE
================================ */

@media (max-width: 1199.98px) {
    .cabinet-index-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .cabinet-index-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .cabinet-index-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cabinet-index-summary-grid {
        grid-template-columns: 1fr;
    }

    .cabinet-index-table-wrapper {
        max-height: none;
    }

    .cabinet-index-toolbar-row {
        flex-direction: column;
        align-items: stretch;
    }

    .cabinet-index-table-hint {
        text-align: left;
        margin-top: 4px;
    }

    /* Головне: на телефоні показуємо карточки, ховаємо таблицю */
    .cabinet-index-table-card {
        display: none;
    }

    .cabinet-index-mobile-list {
        display: block;
    }

    .cabinet-index-summary-card {
        padding: 10px 12px !important;
    }
}

@media (max-width: 575.98px) {
    .cabinet-index-table tbody td {
        font-size: 12px;
    }

    .cabinet-index-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cabinet-index-chip {
        padding: 3px 8px;
    }

    .cabinet-index-title {
        font-size: 16px;
    }
}
