/**
 * ICONGYM Trainer Portal Styles
 *
 * @package ICONGYM\Intro
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    --icg-primary: #2563eb;
    --icg-primary-hover: #1d4ed8;
    --icg-secondary: #64748b;
    --icg-secondary-hover: #475569;
    --icg-success: #22c55e;
    --icg-warning: #f59e0b;
    --icg-error: #ef4444;
    --icg-danger: #dc2626;
    --icg-danger-hover: #b91c1c;
    --icg-info: #3b82f6;
    --icg-text: #1e293b;
    --icg-text-light: #64748b;
    --icg-border: #e2e8f0;
    --icg-bg: #f8fafc;
    --icg-white: #ffffff;
    --icg-radius: 6px;
    --icg-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Base Container
   ========================================================================== */
.icg-auth-container,
.icg-portal-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Notices
   ========================================================================== */
.icg-notice {
    padding: 15px 20px;
    border-radius: var(--icg-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
    transition: opacity 0.3s ease;
}

.icg-notice p {
    margin: 0;
}

.icg-notice-error {
    background-color: #fef2f2;
    border-left-color: var(--icg-error);
    color: #991b1b;
}

.icg-notice-success {
    background-color: #f0fdf4;
    border-left-color: var(--icg-success);
    color: #166534;
}

.icg-notice-warning {
    background-color: #fffbeb;
    border-left-color: var(--icg-warning);
    color: #92400e;
}

.icg-notice-info {
    background-color: #eff6ff;
    border-left-color: var(--icg-info);
    color: #1e40af;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.icg-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    border: none;
    border-radius: var(--icg-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.icg-button:hover {
    transform: translateY(-1px);
}

.icg-button:active {
    transform: translateY(0);
}

.icg-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.icg-button-primary {
    background-color: var(--icg-primary);
    color: var(--icg-white);
}

.icg-button-primary:hover {
    background-color: var(--icg-primary-hover);
    color: var(--icg-white);
}

.icg-button-secondary {
    background-color: var(--icg-secondary);
    color: var(--icg-white);
}

.icg-button-secondary:hover {
    background-color: var(--icg-secondary-hover);
    color: var(--icg-white);
}

.icg-slot-reserved {
    padding: 6px 10px;
    border-radius: 6px;
    background: #32a51f;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.icg-slot-not-booked{
  padding:6px 10px;
  border-radius:6px;
  background:#fef9c3; 
  color:#854d0e;
  font-weight:700;
  font-size:13px;
}

.icg-button-danger {
    background-color: var(--icg-danger);
    color: var(--icg-white);
}

.icg-button-danger:hover {
    background-color: var(--icg-danger-hover);
    color: var(--icg-white);
}

.icg-button-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* ==========================================================================
   Auth Tabs
   ========================================================================== */
.icg-auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--icg-border);
    margin-bottom: 25px;
}

.icg-tab-button {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--icg-text-light);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.icg-tab-button:hover {
    color: var(--icg-text);
}

.icg-tab-button.active {
    color: var(--icg-primary);
    border-bottom-color: var(--icg-primary);
}

.icg-tab-content {
    display: none;
}

.icg-tab-content.active {
    display: block;
}

/* CASE 3: the `hidden` attribute must win over `.active` when JS keeps them in sync,
   and hides subview panels. Higher specificity than `.icg-tab-content.active`. */
.icg-auth-container .icg-tab-content[hidden],
.icg-auth-container [hidden] {
    display: none;
}

/* ==========================================================================
   CASE 3 — Password recovery (scoped to the auth container)
   ========================================================================== */
.icg-auth-container .icg-password-recovery-link-wrap {
    margin-top: 14px;
    text-align: center;
}

.icg-auth-container .icg-password-recovery-link {
    display: inline-block;
    padding: 6px 4px;
    font-size: 14px;
    color: var(--icg-text-light);
    text-decoration: underline;
}

.icg-auth-container .icg-password-recovery-link:hover,
.icg-auth-container .icg-password-recovery-link:focus-visible {
    color: var(--icg-primary);
}

.icg-auth-container .icg-password-recovery-heading-wrap {
    margin-bottom: 6px;
}

.icg-auth-container .icg-password-recovery-heading {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--icg-text);
}

.icg-auth-container .icg-password-recovery-description {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--icg-text-light);
}

.icg-auth-container .icg-password-recovery-actions .icg-button {
    width: 100%;
}

.icg-auth-container .icg-password-recovery-back-wrap {
    margin-top: 14px;
    text-align: center;
}

.icg-auth-container .icg-password-recovery-back {
    display: inline-block;
    padding: 10px 4px;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 14px;
    color: var(--icg-text-light);
    text-decoration: none;
}

.icg-auth-container .icg-password-recovery-back:hover,
.icg-auth-container .icg-password-recovery-back:focus-visible {
    color: var(--icg-primary);
    text-decoration: underline;
}

/* Comfortable tap targets for the recovery input on mobile. */
.icg-auth-container .icg-password-recovery-form input[type="text"] {
    min-height: 44px;
}

/* ==========================================================================
   CASE 03 FIX 01 — Custom new-password (reset) panel (scoped to auth container)
   ========================================================================== */
.icg-auth-container .icg-password-reset-heading-wrap {
    margin-bottom: 6px;
}

.icg-auth-container .icg-password-reset-heading {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--icg-text);
}

.icg-auth-container .icg-password-reset-description {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--icg-text-light);
}

.icg-auth-container .icg-password-reset-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--icg-text-light);
}

.icg-auth-container .icg-password-reset-form input[type="password"],
.icg-auth-container .icg-password-reset-form input[type="text"] {
    min-height: 44px;
}

.icg-auth-container .icg-password-reset-actions .icg-button {
    width: 100%;
}

/* Password visibility toggle — secondary, keyboard-accessible, JS-only. */
.icg-auth-container .icg-password-visibility-toggle {
    min-height: 44px;
    padding: 8px 4px;
    font-size: 13px;
    background: none;
    border: none;
    color: var(--icg-text-light);
    text-decoration: underline;
    cursor: pointer;
}

.icg-auth-container .icg-password-visibility-toggle:hover,
.icg-auth-container .icg-password-visibility-toggle:focus-visible {
    color: var(--icg-primary);
}

.icg-auth-container .icg-password-visibility-toggle[hidden] {
    display: none;
}

.icg-auth-container .icg-password-reset-back-wrap {
    margin-top: 14px;
    text-align: center;
}

.icg-auth-container .icg-password-reset-back {
    display: inline-block;
    padding: 10px 4px;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 14px;
    color: var(--icg-text-light);
    text-decoration: none;
}

.icg-auth-container .icg-password-reset-back:hover,
.icg-auth-container .icg-password-reset-back:focus-visible {
    color: var(--icg-primary);
    text-decoration: underline;
}

/* Invalid / expired link panel. */
.icg-auth-container .icg-password-reset-invalid {
    text-align: left;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.icg-form {
    background: var(--icg-white);
    padding: 25px;
    border-radius: var(--icg-radius);
    box-shadow: var(--icg-shadow);
}

.icg-form-group {
    margin-bottom: 20px;
}

.icg-form-group:last-child {
    margin-bottom: 0;
}

.icg-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--icg-text);
    font-size: 14px;
}

.icg-form-group input[type="text"],
.icg-form-group input[type="email"],
.icg-form-group input[type="password"],
.icg-form-group input[type="date"],
.icg-form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--icg-border);
    border-radius: var(--icg-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background-color: var(--icg-white);
}

.icg-form-group input[type="text"]:focus,
.icg-form-group input[type="email"]:focus,
.icg-form-group input[type="password"]:focus,
.icg-form-group input[type="date"]:focus,
.icg-form-group select:focus {
    outline: none;
    border-color: var(--icg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.icg-form-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.icg-form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.icg-form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--icg-text-light);
}

.icg-form-group .required {
    color: var(--icg-error);
}

.icg-form-row {
    display: flex;
    gap: 15px;
}

.icg-form-half {
    flex: 1;
}

.icg-form .icg-button {
    width: 100%;
}

.icg-form-info {
    margin-bottom: 15px;
    color: var(--icg-text-light);
}

.icg-form-info p {
    margin: 0;
}

/* ==========================================================================
   Portal Navigation
   ========================================================================== */
.icg-portal-nav {
    margin-bottom: 25px;
    border-bottom: 1px solid var(--icg-border);
}

.icg-portal-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 5px;
}

.icg-portal-nav li {
    margin: 0;
}

.icg-portal-nav a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--icg-text-light);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.icg-portal-nav a:hover {
    color: var(--icg-text);
}

.icg-portal-nav li.active a {
    color: var(--icg-primary);
    border-bottom-color: var(--icg-primary);
}

/* ==========================================================================
   Portal Content
   ========================================================================== */
.icg-portal-content {
    background: var(--icg-white);
    padding: 25px;
    border-radius: var(--icg-radius);
    box-shadow: var(--icg-shadow);
}

.icg-portal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--icg-text);
    font-size: 22px;
}

.icg-portal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--icg-text);
    font-size: 18px;
}

/* ==========================================================================
   Profile
   ========================================================================== */
.icg-profile-info {
    margin-bottom: 20px;
}

.icg-profile-info p {
    margin: 0 0 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--icg-border);
}

.icg-profile-info p:last-child {
    border-bottom: none;
}

/* ==========================================================================
   Calendar / Slots
   ========================================================================== */
.icg-calendar-container {
    /* Container for all calendar elements */
}

.icg-calendar-messages {
    /* Messages will be inserted here via JS */
}

.icg-slot-form-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--icg-border);
}

.icg-slot-form-section h3 {
    margin-bottom: 20px;
}

.icg-slot-form {
    background: var(--icg-bg);
}

.icg-slots-section h3 {
    margin-bottom: 15px;
}

.icg-slots-list {
    min-height: 100px;
}

.icg-loading {
    text-align: center;
    padding: 30px;
    color: var(--icg-text-light);
}

.icg-no-slots {
    text-align: center;
    padding: 30px;
    color: var(--icg-text-light);
    background: var(--icg-bg);
    border-radius: var(--icg-radius);
}

/* ==========================================================================
   Slots Table
   ========================================================================== */
.icg-slots-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.icg-slots-table th,
.icg-slots-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--icg-border);
}

.icg-slots-table th {
    background-color: var(--icg-bg);
    font-weight: 600;
    color: var(--icg-text);
}

.icg-slots-table tbody tr:hover {
    background-color: var(--icg-bg);
}

.icg-slots-table tbody tr:last-child td {
    border-bottom: none;
}

.icg-slots-table td:last-child {
    text-align: right;
    white-space: nowrap;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 600px) {
    .icg-auth-container,
    .icg-portal-container {
        padding: 15px;
    }

    .icg-form {
        padding: 20px;
    }

    .icg-form-row {
        flex-direction: column;
        gap: 0;
    }

    .icg-portal-nav ul {
        flex-wrap: wrap;
    }

    .icg-portal-nav a {
        padding: 10px 15px;
        font-size: 14px;
    }

    /* Responsive table */
    .icg-slots-table {
        display: block;
    }

    .icg-slots-table thead {
        display: none;
    }

    .icg-slots-table tbody,
    .icg-slots-table tr,
    .icg-slots-table td {
        display: block;
    }

    .icg-slots-table tr {
        margin-bottom: 15px;
        background: var(--icg-bg);
        border-radius: var(--icg-radius);
        padding: 10px;
    }

    .icg-slots-table td {
        padding: 8px 10px;
        border-bottom: none;
        text-align: left !important;
    }

    .icg-slots-table td::before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 4px;
        color: var(--icg-text-light);
        font-size: 12px;
    }

    .icg-slots-table td:last-child {
        padding-top: 10px;
        border-top: 1px solid var(--icg-border);
        margin-top: 5px;
    }
}

/* ==========================================================================
   CASE 2 — Bulk availability range component
   Scoped to component-specific classes only (no generic selectors).
   ========================================================================== */
.icg-slot-range-form {
    background: var(--icg-bg);
}

/* Controls: Data / Nuo / Iki in one grid row on desktop.
   Date is wider than each time boundary. */
.icg-slot-range-controls {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.icg-slot-range-field {
    margin-bottom: 0;
    min-width: 0;
}

.icg-slot-range-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--icg-text);
    font-size: 14px;
}

.icg-slot-range-field input[type="text"],
.icg-slot-range-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--icg-border);
    border-radius: var(--icg-radius);
    box-sizing: border-box;
    background-color: var(--icg-white);
    color: var(--icg-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.icg-slot-range-field input[type="text"]:focus,
.icg-slot-range-field select:focus {
    outline: none;
    border-color: var(--icg-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Quick actions row. */
.icg-slot-range-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.icg-slot-range-actions .icg-button {
    min-height: 44px;
}

/* Legend. */
.icg-slot-preview-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 10px 0;
    font-size: 12px;
    color: var(--icg-text-light);
}

.icg-slot-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--icg-border);
    background: var(--icg-white);
}

.icg-slot-legend-item .icg-slot-status-icon {
    font-size: 12px;
    line-height: 1;
}

/* Selection summary (aria-live). */
.icg-slot-preview-summary {
    margin: 8px 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--icg-text);
    min-height: 20px;
}

.icg-slot-preview-summary:empty {
    margin: 0;
    min-height: 0;
}

/* Preview grid — responsive, compact chips, supports long ranges. */
.icg-slot-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.icg-slot-preview:empty {
    margin-bottom: 0;
}

.icg-slot-preview[aria-busy="true"] {
    opacity: 0.55;
}

.icg-slot-preview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: var(--icg-radius);
    border: 1px solid var(--icg-border);
    border-left-width: 4px;
    background: var(--icg-white);
    font-size: 13px;
    line-height: 1.25;
}

.icg-slot-preview-time {
    font-weight: 600;
    color: var(--icg-text);
    font-variant-numeric: tabular-nums;
}

.icg-slot-preview-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.icg-slot-status-icon {
    display: inline-flex;
    width: 16px;
    justify-content: center;
    flex: 0 0 auto;
}

/* Status colours — always paired with visible text + icon (never colour alone). */
.icg-slot-status-new {
    border-left-color: var(--icg-success);
}
.icg-slot-status-new .icg-slot-preview-status,
.icg-slot-legend-item.icg-slot-status-new {
    color: #166534;
}

.icg-slot-status-reactivate {
    border-left-color: var(--icg-info);
}
.icg-slot-status-reactivate .icg-slot-preview-status,
.icg-slot-legend-item.icg-slot-status-reactivate {
    color: #1e40af;
}

.icg-slot-status-existing {
    border-left-color: var(--icg-secondary);
    background: var(--icg-bg);
}
.icg-slot-status-existing .icg-slot-preview-status,
.icg-slot-legend-item.icg-slot-status-existing {
    color: var(--icg-secondary-hover);
}

.icg-slot-status-locked {
    border-left-color: var(--icg-warning);
    background: #fffbeb;
}
.icg-slot-status-locked .icg-slot-preview-status,
.icg-slot-legend-item.icg-slot-status-locked {
    color: #92400e;
}

.icg-slot-status-past {
    border-left-color: var(--icg-border);
    background: var(--icg-bg);
    opacity: 0.8;
}
.icg-slot-status-past .icg-slot-preview-status {
    color: var(--icg-text-light);
}

/* CASE 02 FIX 01: neutral "checking status" chip shown while the date status loads. */
.icg-slot-status-loading {
    border-left-color: var(--icg-border);
    background: var(--icg-bg);
}
.icg-slot-status-loading .icg-slot-preview-status {
    color: var(--icg-text-light);
}

/* CASE 02 FIX 01: informational boundary/config note. */
.icg-slot-range-note {
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid var(--icg-warning);
    border-radius: var(--icg-radius);
}

.icg-slot-range-note[hidden] {
    display: none;
}

/* ==========================================================================
   CASE 02 FIX 02 — Date-grouped collapsible "Mano laiko tarpai"
   ========================================================================== */
.icg-slot-groups {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.icg-slot-group {
    border: 1px solid var(--icg-border);
    border-radius: var(--icg-radius);
    background: var(--icg-white);
    overflow: hidden;
}

.icg-slot-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: var(--icg-bg);
}

.icg-slot-group.is-open .icg-slot-group-header {
    border-bottom: 1px solid var(--icg-border);
}

.icg-slot-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    min-width: 0;
}

.icg-slot-group-title-text {
    font-weight: 600;
    color: var(--icg-text);
    font-size: 15px;
}

.icg-slot-group-meta {
    font-size: 12px;
    color: var(--icg-text-light);
}

/* Toggle: real button, visible text kept alongside the chevron. */
.icg-slot-group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--icg-primary);
    background: var(--icg-white);
    border: 1px solid var(--icg-border);
    border-radius: var(--icg-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.icg-slot-group-toggle:hover {
    background: #eff6ff;
    border-color: var(--icg-primary);
}

.icg-slot-group-toggle:focus-visible {
    outline: 2px solid var(--icg-primary);
    outline-offset: 2px;
}

/* Chevron: supplementary to the text, never the only state indicator. */
.icg-slot-group-chevron {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

.icg-slot-group.is-open .icg-slot-group-chevron {
    transform: rotate(180deg);
}

.icg-slot-group-panel {
    padding: 6px 14px 12px;
}

.icg-slot-group-panel[hidden] {
    display: none;
}

/* The table inside a group reuses the existing .icg-slots-table styles. */
.icg-slot-group-panel .icg-slots-table {
    margin: 0;
}

/* Mobile: header may stack; toggle stays full-width and easy to tap. */
@media (max-width: 600px) {
    .icg-slot-group-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .icg-slot-group-toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .icg-slot-group-chevron {
        transition: none;
    }
}

/* ==========================================================================
   CASE 02 FIX 03 — Bulk cancellation selection mode
   ========================================================================== */
.icg-slot-selection-controls {
    margin-bottom: 12px;
}

.icg-slot-selection-mode-button {
    min-height: 44px;
}

/* Sticky toolbar: reachable while scrolling a long list, never covering content. */
.icg-slot-selection-toolbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--icg-white);
    border: 1px solid var(--icg-border);
    border-radius: var(--icg-radius);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
}

.icg-slot-selection-toolbar[hidden] {
    display: none;
}

.icg-slot-selection-count {
    font-weight: 600;
    color: var(--icg-text);
    font-size: 15px;
}

.icg-slot-selection-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.icg-slot-selection-actions .icg-button {
    min-height: 44px;
}

/* Per-slot selection control (inside the actions cell). */
.icg-slot-select-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

.icg-slot-select-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--icg-primary);
}

.icg-slot-select-checkbox:focus-visible {
    outline: 2px solid var(--icg-primary);
    outline-offset: 2px;
}

/* Selected row: highlight PLUS a left marker bar (not colour alone). */
.icg-slot-row-selected > td {
    background: #eff6ff;
}

.icg-slot-row-selected > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--icg-primary);
}

/* Group "select all cancellable" subheader. */
.icg-slot-group-subheader {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--icg-border);
    background: var(--icg-white);
}

.icg-slot-group-select-all-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 14px;
    color: var(--icg-text);
    cursor: pointer;
}

.icg-slot-group-select-all-label[aria-disabled="true"] {
    color: var(--icg-text-light);
    cursor: default;
}

.icg-slot-group-select-all {
    width: 20px;
    height: 20px;
    accent-color: var(--icg-primary);
    cursor: pointer;
}

.icg-slot-group-select-empty {
    font-size: 12px;
    color: var(--icg-text-light);
    font-style: italic;
}

/* In selection mode the group header no longer shows a bottom border (subheader does). */
.icg-slot-groups.is-selection-mode .icg-slot-group.is-open .icg-slot-group-header {
    border-bottom: none;
}

/* ----- Confirmation dialog ----- */
.icg-bulk-cancel-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.55);
}

.icg-bulk-cancel-dialog {
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--icg-white);
    border-radius: var(--icg-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 20px;
    box-sizing: border-box;
}

.icg-bulk-cancel-dialog-title {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--icg-text);
}

.icg-bulk-cancel-dialog-desc {
    margin: 0 0 10px;
    color: var(--icg-text);
}

.icg-bulk-cancel-dialog-days {
    margin: 0 0 12px;
    padding-left: 18px;
    color: var(--icg-text-light);
    font-size: 14px;
}

.icg-bulk-cancel-dialog-days li {
    margin-bottom: 2px;
}

.icg-bulk-cancel-dialog-note {
    margin: 0 0 16px;
    font-size: 13px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid var(--icg-warning);
    border-radius: var(--icg-radius);
    padding: 8px 12px;
}

.icg-bulk-cancel-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.icg-bulk-cancel-dialog-actions .icg-button {
    min-height: 44px;
}

/* Mobile: full-width stacked toolbar + dialog actions, safe-area aware. */
@media (max-width: 600px) {
    .icg-slot-selection-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .icg-slot-selection-actions {
        display: flex;
    }
    .icg-slot-selection-actions .icg-button {
        flex: 1 1 auto;
    }
    .icg-slot-selection-mode-button {
        width: 100%;
    }
    .icg-bulk-cancel-dialog-actions {
        flex-direction: column-reverse;
    }
    .icg-bulk-cancel-dialog-actions .icg-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .icg-slot-selection-toolbar {
        box-shadow: none;
    }
}

/* ==========================================================================
   CASE 02 FIX 04 — Overlap / duration-conflict states
   ========================================================================== */

/* Preview chips: overlap + duration conflict (text + icon, not colour alone). */
.icg-slot-status-overlap {
    border-left-color: var(--icg-warning);
    background: #fff7ed;
}
.icg-slot-status-overlap .icg-slot-preview-status {
    color: #9a3412;
}

.icg-slot-status-duration {
    border-left-color: var(--icg-danger);
    background: #fef2f2;
}
.icg-slot-status-duration .icg-slot-preview-status {
    color: #991b1b;
}

/* "Mano laiko tarpai" conflict badges. */
.icg-slot-conflict-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.icg-slot-conflict-overlap {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid var(--icg-warning);
}

.icg-slot-conflict-duration {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid var(--icg-danger);
}

.icg-slot-row-conflict > td:first-child {
    box-shadow: inset 3px 0 0 0 var(--icg-warning);
}

/* Compact warning above the grouped list. */
.icg-slot-conflict-warning {
    margin-bottom: 12px;
}

/* Group-header conflict count. */
.icg-slot-group-conflicts {
    color: #9a3412;
    font-weight: 700;
}

/* Primary submit — full width, comfortable target. */
.icg-slot-range-submit-wrap {
    margin-bottom: 0;
}

.icg-slot-range-form .icg-slot-range-submit {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
}

/* Tablet: controls may wrap into two rows without horizontal overflow. */
@media (max-width: 782px) {
    .icg-slot-range-controls {
        grid-template-columns: 1fr 1fr;
    }
    .icg-slot-range-date {
        grid-column: 1 / -1;
    }
}

/* Mobile: date full width; Nuo/Iki stay two equal columns until very narrow. */
@media (max-width: 480px) {
    .icg-slot-range-controls {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .icg-slot-range-date {
        grid-column: 1 / -1;
    }
    .icg-slot-range-actions .icg-button {
        flex: 1 1 auto;
    }
    .icg-slot-preview {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* Very narrow (approx < 360px): Nuo/Iki may stack. */
@media (max-width: 360px) {
    .icg-slot-range-controls {
        grid-template-columns: 1fr;
    }
    .icg-slot-preview {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==================================================================
   CASE 04 FIX 01: Inline reschedule editor (no modal)
   Component-scoped only; no generic header/footer selectors, no fixed
   positioning, no backdrop, no body modifications. Does not affect
   login, calendar, client booking, profile or admin pages.
   ================================================================== */

/* "Keisti" trigger. */
.icg-booking-reschedule-button {
    cursor: pointer;
}

/* Partial-success (email failed) message reuses the reservations message area. */
.icg-message.icg-message-warning {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* The editor row spans the full table width; overflow stays visible so the
   Flatpickr calendar (appended to <body>) is never clipped. */
.icg-booking-reschedule-row > .icg-booking-reschedule-cell {
    padding: 0;
    overflow: visible;
    background: #f8fafc;
}

/* Subtle highlight on the reservation being edited. */
.icg-booking-row-is-editing > td {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 #2563eb;
}

/* Inline editor card. */
.icg-booking-reschedule-inline {
    box-sizing: border-box;
    width: 100%;
    padding: 18px 20px 20px;
    border: 1px solid #dbe3ec;
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #ffffff;
    overflow: visible;
}

.icg-booking-reschedule-inline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.icg-booking-reschedule-inline-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    color: #1e293b;
}
/* Compact top-right cancel link. */
.icg-booking-reschedule-cancel-link {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 6px 8px;
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
}
.icg-booking-reschedule-cancel-link:hover,
.icg-booking-reschedule-cancel-link:focus {
    color: #0f172a;
    background: #f1f5f9;
}

.icg-booking-reschedule-inline-content {
    display: block;
}

.icg-booking-reschedule-current {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.icg-booking-reschedule-current-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}
.icg-booking-reschedule-current-value {
    font-size: 15px;
    color: #1e293b;
    line-height: 1.4;
}

.icg-booking-reschedule-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.icg-booking-reschedule-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.icg-booking-reschedule-field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.icg-booking-reschedule-date,
.icg-booking-reschedule-time {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
}
.icg-booking-reschedule-date:focus,
.icg-booking-reschedule-time:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}
.icg-booking-reschedule-time:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}
/* Disabled (occupied/current/past/outside-hours) options: not colour-only — the
   label itself carries the state text (e.g. "— Užimta"). */
.icg-booking-reschedule-time option:disabled {
    color: #94a3b8;
}

.icg-booking-reschedule-summary {
    margin: 16px 0 6px;
    padding: 12px 14px;
    background: #eff6ff;
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.45;
}
.icg-booking-reschedule-notice {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}
.icg-booking-reschedule-message {
    margin-top: 12px;
    font-size: 14px;
    color: #b91c1c;
}
.icg-booking-reschedule-message:empty {
    margin-top: 0;
}

.icg-booking-reschedule-inline-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}
.icg-booking-reschedule-inline-actions .icg-btn {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
}
.icg-booking-reschedule-inline-actions .icg-btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}
.icg-booking-reschedule-inline-actions .icg-btn-secondary:hover {
    background: #f1f5f9;
}
.icg-booking-reschedule-inline-actions .icg-btn-primary {
    background: #2563eb;
    color: #ffffff;
}
.icg-booking-reschedule-inline-actions .icg-btn-primary:hover {
    background: #1d4ed8;
}
.icg-booking-reschedule-inline-actions .icg-btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* Mobile: the reservation table stacks; the editor becomes a full-width card too.
   Fields and buttons stack; no fixed width; fits at 320px; no horizontal scroll. */
@media (max-width: 640px) {
    .icg-booking-reschedule-inline {
        padding: 16px;
        border-radius: 10px;
        border-top: 1px solid #dbe3ec;
    }
    .icg-booking-reschedule-fields {
        grid-template-columns: 1fr;
    }
    .icg-booking-reschedule-inline-actions {
        flex-direction: column-reverse;
    }
    .icg-booking-reschedule-inline-actions .icg-btn {
        width: 100%;
    }
}

/* ==================================================================
   CASE 5: Trainer send-invitation page (scoped)
   Does not affect login, calendar, client booking, reservations or admin.
   ================================================================== */

.icg-invite-intro {
    color: #475569;
    margin: 0 0 20px;
    max-width: 640px;
}

.icg-invite-send-form {
    max-width: 720px;
    margin-bottom: 32px;
}
.icg-invite-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.icg-invite-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.icg-invite-field label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}
.icg-invite-field .icg-required {
    color: #dc2626;
}
.icg-invite-field input,
.icg-invite-field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
}
.icg-invite-field input:focus,
.icg-invite-field select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    border-color: #2563eb;
}
.icg-invite-field select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
}
.icg-invite-field select option:disabled {
    color: #94a3b8;
}

.icg-invite-actions {
    margin-top: 16px;
}
.icg-invite-submit {
    min-height: 44px;
    padding: 10px 22px;
    font-size: 15px;
}
.icg-invite-submit[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
}

.icg-invite-message {
    margin-top: 14px;
    font-size: 14px;
    min-height: 1em;
}
.icg-invite-message-success {
    color: #15803d;
}
.icg-invite-message-warning {
    color: #92400e;
}
.icg-invite-message-error {
    color: #b91c1c;
}

/* Recent invitations. */
.icg-invite-recent-title {
    margin: 8px 0 12px;
}
.icg-invite-empty {
    color: #64748b;
}
.icg-invite-recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.icg-invite-recent-table th,
.icg-invite-recent-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.icg-invite-recent-table thead th {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* Status badges (text + colour — never colour alone). */
.icg-invite-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}
.icg-invite-badge-active      { background: #dcfce7; color: #166534; }
.icg-invite-badge-used        { background: #dbeafe; color: #1e40af; }
.icg-invite-badge-expired     { background: #f1f5f9; color: #475569; }
.icg-invite-badge-mail_failed { background: #fee2e2; color: #991b1b; }

/* Mobile: fields stack, button full width, recent table becomes cards. */
@media (max-width: 640px) {
    .icg-invite-fields {
        grid-template-columns: 1fr;
    }
    .icg-invite-submit {
        width: 100%;
    }
    .icg-invite-recent-table,
    .icg-invite-recent-table tbody,
    .icg-invite-recent-table tr,
    .icg-invite-recent-table td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .icg-invite-recent-table thead {
        display: none;
    }
    .icg-invite-recent-table tr {
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 6px 4px;
    }
    .icg-invite-recent-table td {
        border-bottom: 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 12px;
    }
    .icg-invite-recent-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        flex: 0 0 45%;
    }
}
