/* ══════════════════════════════════════════════════════════════
   Shift Templates Tab  (prefix: stt-)
   Self-contained - no dependency on other component CSS.
   ══════════════════════════════════════════════════════════════ */

/* ── Shimmer animation ─────────────────────────────────────── */

@keyframes stt-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Tab header ─────────────────────────────────────────────── */

.stt-tab-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.stt-tab-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.stt-tab-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
}

/* ── Grid ───────────────────────────────────────────────────── */

.stt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    max-width: 100%;
}

/* ── Card ───────────────────────────────────────────────────── */

.stt-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: box-shadow 150ms, border-color 150ms;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.stt-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #D1D5DB;
}

/* Card header */

.stt-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.stt-card-icon {
    width: 36px;
    height: 36px;
    background: #EEF2FF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6366F1;
}

.stt-card-info {
    flex: 1;
    min-width: 0;
}

.stt-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.stt-card-desc {
    font-size: 13px;
    color: #6B7280;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Card details: hours pill + day dots */

.stt-card-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stt-hours-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #EEF2FF;
    color: #6366F1;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    width: fit-content;
}

.stt-days-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.stt-day-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3F4F6;
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stt-day-dot--active {
    background: #EEF2FF;
    color: #6366F1;
}

/* Card actions */

.stt-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.stt-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms, color 150ms;
}

.stt-action-btn--ghost {
    background: #FFFFFF;
    color: #374151;
    border-color: #E5E7EB;
}

.stt-action-btn--ghost:hover { background: #F9FAFB; }

.stt-action-btn--danger {
    background: #FFFFFF;
    color: #EF4444;
    border-color: #FECACA;
}

.stt-action-btn--danger:hover { background: #FEF2F2; }

/* ── Skeleton ───────────────────────────────────────────────── */

.stt-card--skeleton {
    pointer-events: none;
}

.stt-skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: stt-shimmer 1.5s infinite;
    border-radius: 4px;
}

.stt-skeleton--icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
}

.stt-skeleton--line {
    height: 14px;
    margin-bottom: 4px;
}

.stt-skeleton--short {
    width: 55%;
}

.stt-skeleton--pill {
    height: 24px;
    width: 120px;
    border-radius: 20px;
}

.stt-skeleton--dots {
    height: 28px;
    width: 196px;
    border-radius: 20px;
}

.stt-skeleton--actions {
    height: 32px;
    border-radius: 6px;
}

/* ── Empty state ─────────────────────────────────────────────── */

.stt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.stt-empty-icon {
    width: 60px;
    height: 60px;
    background: #EEF2FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #6366F1;
}

.stt-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
}

.stt-empty-text {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 16px 0;
    max-width: 320px;
}

/* ── Modal ───────────────────────────────────────────────────── */

.stt-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.stt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFFFFF;
    border-radius: 12px;
    width: min(540px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.stt-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.stt-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.stt-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6B7280;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 150ms;
    font-family: inherit;
}

.stt-modal-close:hover { color: #111827; }
.stt-modal-close:disabled { opacity: 0.5; cursor: not-allowed; }

.stt-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.stt-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

/* ── Form ────────────────────────────────────────────────────── */

.stt-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stt-form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.stt-form-required {
    color: #EF4444;
}

.stt-form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #FFFFFF;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 150ms;
}

.stt-form-input:focus { border-color: #6366F1; }

.stt-form-error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #EF4444;
    padding: 8px 12px;
    background: #FEF2F2;
    border-radius: 8px;
    border: 1px solid #FECACA;
}

/* ── Rate row ────────────────────────────────────────────────── */

.stt-rate-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
}

.stt-modifier-select {
    width: 160px;
}

.stt-form-hint {
    font-size: 0.75rem;
    color: #9CA3AF;
    font-weight: 400;
}

.stt-form-hint-text {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 4px;
    margin-bottom: 0;
}

/* ── Time row ────────────────────────────────────────────────── */

.stt-time-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stt-time-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stt-time-label {
    font-size: 12px;
    color: #6B7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.stt-time-sep {
    color: #9CA3AF;
    font-size: 16px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ── Day chips (interactive, for modal form) ─────────────────── */

.stt-chips-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stt-chip {
    width: 40px;
    height: 36px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #FFFFFF;
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 150ms;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stt-chip:hover {
    border-color: #6366F1;
    color: #6366F1;
}

.stt-chip.active {
    background: #6366F1;
    border-color: #6366F1;
    color: #FFFFFF;
}

/* ── Spinner ─────────────────────────────────────────────────── */

.stt-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: stt-shimmer 0.6s linear infinite;
    flex-shrink: 0;
}

/* ── Mobile ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .stt-grid { grid-template-columns: 1fr; }
    .stt-modal-body { padding: 16px; }
    .stt-modal-footer { padding: 12px 16px 16px; }
    .stt-modal-header { padding: 16px 16px 12px; }
    .stt-time-row { flex-direction: column; align-items: stretch; }
    .stt-time-sep { display: none; }
}
