/* ═══════════════════════════════════════════════════════════════════════════
   claymorphism.css — Claymorphism UI Design System
   Soft, puffy, rounded UI elements with dual soft shadows.
   Color palette: pastel accents on off-white/light-gray (#F2F4F8) background.
   Font: Poppins (Google Fonts)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ────────────────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --clay-bg-body: #F2F4F8;
    --clay-bg-card: #FFFFFF;

    /* Shadows — extruded (card/button) */
    --clay-shadow-extruded-light: 8px 8px 16px #d1d4da, -8px -8px 16px #ffffff;
    --clay-shadow-extruded-hover: 6px 6px 12px #d1d4da, -6px -6px 12px #ffffff;
    --clay-shadow-extruded-active: 4px 4px 8px #d1d4da, -4px -4px 8px #ffffff;

    /* Shadows — inset (input fields) */
    --clay-shadow-inset: inset 4px 4px 8px #d1d4da, inset -4px -4px 8px #ffffff;
    --clay-shadow-inset-focus: inset 3px 3px 6px #d1d4da, inset -3px -3px 6px #ffffff;

    /* Accent colors */
    --clay-accent-primary: #A6C8FF;
    --clay-accent-primary-hover: #8fb8f5;
    --clay-accent-primary-active: #7aa8eb;
    --clay-accent-text: #4a5568;
    --clay-accent-error: #f28b82;
    --clay-accent-error-bg: #fce8e6;

    /* Typography */
    --clay-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --clay-font-size-sm: 0.875rem;
    --clay-font-size-md: 1rem;
    --clay-font-size-lg: 1.25rem;
    --clay-font-size-xl: 1.75rem;

    /* Spacing */
    --clay-radius: 20px;
    --clay-radius-sm: 12px;
    --clay-padding-card: 2.5rem;
    --clay-padding-field: 0.75rem 1.25rem;

    /* Transitions */
    --clay-transition: 0.2s ease-in-out;
}

/* ── Base Reset ────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--clay-font-family);
    background-color: var(--clay-bg-body);
    color: var(--clay-accent-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Login Page Specific ───────────────────────────────────────────────── */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--clay-bg-body);
}

/* ── Card Wrapper ──────────────────────────────────────────────────────── */
.clay-card-wrapper {
    width: 100%;
    max-width: 420px;
}

/* ── Clay Card ──────────────────────────────────────────────────────────── */
.clay-card {
    background: var(--clay-bg-card);
    border-radius: var(--clay-radius);
    padding: var(--clay-padding-card);
    box-shadow: var(--clay-shadow-extruded-light);
    transition: box-shadow var(--clay-transition);
}

.clay-card--login {
    text-align: center;
}

/* ── Logo ───────────────────────────────────────────────────────────────── */
.login-logo {
    margin-bottom: 1.5rem;
}

.login-logo-img {
    max-width: 100px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-extruded-light);
    padding: 0.75rem;
    background: var(--clay-bg-card);
}

/* ── Card Title & Subtitle ─────────────────────────────────────────────── */
.clay-card-title {
    font-size: var(--clay-font-size-xl);
    font-weight: 600;
    color: var(--clay-accent-text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.clay-card-subtitle {
    font-size: var(--clay-font-size-sm);
    color: #6b7280;
    margin-bottom: 2rem;
}

/* ── Alert / Error Message ─────────────────────────────────────────────── */
.clay-alert {
    border-radius: var(--clay-radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    text-align: left;
}

.clay-alert--error {
    background: var(--clay-accent-error-bg);
    color: #c62828;
    box-shadow: var(--clay-shadow-inset);
}

.clay-alert-message {
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    line-height: 1.4;
}

.clay-alert-message + .clay-alert-message {
    margin-top: 0.25rem;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.clay-form {
    text-align: left;
}

/* ── Field Group ────────────────────────────────────────────────────────── */
.clay-field {
    margin-bottom: 1.25rem;
}

.clay-label {
    display: block;
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--clay-accent-text);
}

/* ── Input — Claymorphism Inset ───────────────────────────────────────── */
.clay-input {
    display: block;
    width: 100%;
    padding: var(--clay-padding-field);
    font-family: var(--clay-font-family);
    font-size: var(--clay-font-size-md);
    color: var(--clay-accent-text);
    background: var(--clay-bg-body);
    border: none;
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-inset);
    outline: none;
    transition: box-shadow var(--clay-transition);
}

.clay-input::placeholder {
    color: #a0aec0;
    font-weight: 300;
}

.clay-input:focus {
    box-shadow: var(--clay-shadow-inset-focus);
}

.clay-input.input-validation-error {
    box-shadow: inset 4px 4px 8px #d1d4da, inset -4px -4px 8px #ffffff, 0 0 0 2px var(--clay-accent-error);
}

/* ── Validation Message ─────────────────────────────────────────────────── */
.clay-validation {
    display: block;
    font-size: 0.75rem;
    color: #c62828;
    margin-top: 0.3rem;
    font-weight: 500;
}

/* ── Checkbox ───────────────────────────────────────────────────────────── */
.clay-field--checkbox {
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.clay-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--clay-font-size-sm);
    cursor: pointer;
    user-select: none;
}

.clay-checkbox {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--clay-accent-primary);
    cursor: pointer;
}

/* ── Primary Button — Claymorphism Extruded ────────────────────────────── */
.clay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--clay-font-family);
    font-size: var(--clay-font-size-md);
    font-weight: 600;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: var(--clay-radius);
    cursor: pointer;
    transition: all var(--clay-transition);
    text-decoration: none;
}

.clay-btn--primary {
    background: var(--clay-accent-primary);
    color: #1a202c;
    box-shadow: var(--clay-shadow-extruded-light);
}

.clay-btn--primary:hover {
    background: var(--clay-accent-primary-hover);
    box-shadow: var(--clay-shadow-extruded-hover);
    transform: translateY(-1px);
}

.clay-btn--primary:active {
    background: var(--clay-accent-primary-active);
    box-shadow: var(--clay-shadow-extruded-active);
    transform: translateY(1px);
}

.clay-btn--full {
    width: 100%;
}

/* ── Card Footer ────────────────────────────────────────────────────────── */
.clay-card-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.clay-link {
    font-size: var(--clay-font-size-sm);
    color: #5a7dbf;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--clay-transition);
}

.clay-link:hover {
    color: var(--clay-accent-primary-hover);
    text-decoration: underline;
}

/* ── Demo Hint (remove in production) ─────────────────────────────────── */
.clay-demo-hint {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: #edf2f7;
    border-radius: var(--clay-radius-sm);
    box-shadow: var(--clay-shadow-inset);
    font-size: 0.75rem;
    color: #4a5568;
}

.clay-demo-hint p {
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT — Sidebar + Topbar
   ═══════════════════════════════════════════════════════════════════════════ */

.dash-body {
    overflow: hidden;
    height: 100vh;
}

.dash-wrapper {
    display: flex;
    height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.dash-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--clay-bg-card);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.04);
    transition: width var(--clay-transition), min-width var(--clay-transition);
    overflow: hidden;
    z-index: 100;
}

.dash-sidebar.collapsed {
    width: 64px;
    min-width: 64px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: var(--clay-radius-sm);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: var(--clay-font-size-lg);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.dash-sidebar.collapsed .sidebar-brand {
    display: none;
}

/* ── Sidebar Nav ────────────────────────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--clay-radius-sm);
    text-decoration: none;
    color: var(--clay-accent-text);
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    transition: all var(--clay-transition);
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    background: rgba(166, 200, 255, 0.15);
}

.sidebar-link.active {
    background: rgba(166, 200, 255, 0.25);
    box-shadow: var(--clay-shadow-inset);
    font-weight: 600;
    color: #3b5a8c;
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.dash-sidebar.collapsed .sidebar-label {
    display: none;
}

/* ── Sidebar Footer (Logout) ────────────────────────────────────────────── */
.sidebar-footer {
    padding: 0.5rem 0.75rem 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.sidebar-logout {
    color: #c62828;
}

.sidebar-logout:hover {
    background: rgba(242, 139, 130, 0.15);
}

/* ── Top Bar ────────────────────────────────────────────────────────────── */
.dash-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dash-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--clay-bg-card);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 50;
    min-height: 60px;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--clay-radius-sm);
    border: none;
    background: none;
    cursor: pointer;
    color: var(--clay-accent-text);
    transition: background var(--clay-transition);
}

.sidebar-toggle:hover {
    background: rgba(166, 200, 255, 0.15);
}

.topbar-title {
    flex: 1;
}

.topbar-title h2 {
    font-size: var(--clay-font-size-lg);
    font-weight: 600;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.clay-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--clay-accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--clay-font-size-sm);
    color: #1a202c;
    box-shadow: var(--clay-shadow-extruded-light);
}

.user-dropdown {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-size: var(--clay-font-size-sm);
    font-weight: 600;
}

.user-role {
    font-size: 0.75rem;
    color: #6b7280;
}

/* ── Dashboard Content Area ─────────────────────────────────────────────── */
.dash-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* ── Summary Cards Row ──────────────────────────────────────────────────── */
.dash-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.clay-stat-card {
    text-align: center;
    padding: 1.5rem 1.25rem;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--clay-radius-sm);
    margin-bottom: 0.75rem;
    box-shadow: var(--clay-shadow-extruded-light);
}

.stat-icon--blue { background: rgba(166, 200, 255, 0.3); color: #3b5a8c; }
.stat-icon--green { background: rgba(168, 230, 180, 0.3); color: #2d6a3f; }
.stat-icon--orange { background: rgba(255, 204, 128, 0.3); color: #8a5d00; }
.stat-icon--purple { background: rgba(200, 180, 255, 0.3); color: #4a2d8a; }

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--clay-accent-text);
}

/* ── Two-column Grid ────────────────────────────────────────────────────── */
.dash-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.card-section-title {
    font-size: var(--clay-font-size-md);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ── Chart Card ─────────────────────────────────────────────────────────── */
.dash-chart-card {
    padding: 1.5rem;
}

.dash-chart-card canvas {
    max-height: 220px;
    width: 100% !important;
}

/* ── Table Card ─────────────────────────────────────────────────────────── */
.dash-table-card {
    padding: 1.5rem;
    overflow: hidden;
}

.clay-table-responsive {
    overflow-x: auto;
}

.clay-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--clay-font-size-sm);
}

.clay-table th {
    text-align: left;
    padding: 0.65rem 0.5rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid rgba(0, 0, 0, 0.04);
    white-space: nowrap;
}

.clay-table td {
    padding: 0.65rem 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.clay-table tbody tr:hover {
    background: rgba(166, 200, 255, 0.06);
}

.clay-table-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem !important;
}

/* ── Pill Badge ─────────────────────────────────────────────────────────── */
.clay-pill {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-inset);
}

.clay-pill--active { background: rgba(168, 230, 180, 0.3); color: #2d6a3f; }
.clay-pill--completed { background: rgba(166, 200, 255, 0.3); color: #3b5a8c; }
.clay-pill--cancelled { background: rgba(242, 139, 130, 0.3); color: #8a2a2a; }
.clay-pill--pending { background: rgba(255, 204, 128, 0.3); color: #8a5d00; }
.clay-pill--processed { background: rgba(168, 230, 180, 0.3); color: #2d6a3f; }
.clay-pill--skipped { background: #e5e7eb; color: #6b7280; }

/* ═══════════════════════════════════════════════════════════════════════════
   RECURRING SALES CREATE FORM
   ═══════════════════════════════════════════════════════════════════════════ */

.clay-card--form-lg {
    max-width: 720px;
    margin: 0 auto;
}

.clay-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* ── Summary Panel ──────────────────────────────────────────────────────── */
.clay-summary-panel {
    background: #edf2f7;
    border-radius: var(--clay-radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--clay-shadow-inset);
}

.summary-title {
    font-size: var(--clay-font-size-sm);
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--clay-accent-text);
}

.summary-subtitle {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: var(--clay-font-size-sm);
}

/* ── Segmented Button Group (Frequency) ────────────────────────────────── */
.clay-segmented-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.clay-segment {
    flex: 1;
    min-width: 100px;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--clay-radius-sm);
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-extruded-light);
    font-family: var(--clay-font-family);
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    color: var(--clay-accent-text);
    cursor: pointer;
    transition: all var(--clay-transition);
}

.clay-segment:hover {
    box-shadow: var(--clay-shadow-extruded-hover);
    transform: translateY(-1px);
}

.clay-segment.active {
    background: var(--clay-accent-primary);
    box-shadow: var(--clay-shadow-inset);
    color: #1a202c;
    font-weight: 600;
    transform: translateY(1px);
}

/* ── Chip Group (Recurrence Count) ──────────────────────────────────────── */
.clay-chip-group {
    display: flex;
    gap: 0.75rem;
}

.clay-chip {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 999px;
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-extruded-light);
    font-family: var(--clay-font-family);
    font-size: var(--clay-font-size-md);
    font-weight: 600;
    color: var(--clay-accent-text);
    cursor: pointer;
    transition: all var(--clay-transition);
}

.clay-chip:hover {
    box-shadow: var(--clay-shadow-extruded-hover);
    transform: translateY(-1px);
}

.clay-chip.active {
    background: var(--clay-accent-primary);
    box-shadow: var(--clay-shadow-inset);
    color: #1a202c;
    transform: translateY(1px);
}

/* ── Schedule List Preview ──────────────────────────────────────────────── */
.schedule-list {
    max-height: 250px;
    overflow-y: auto;
}

.schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    background: var(--clay-bg-card);
    border-radius: 8px;
    box-shadow: var(--clay-shadow-extruded-light);
    font-size: var(--clay-font-size-sm);
}

.schedule-num {
    font-weight: 500;
    color: var(--clay-accent-text);
}

.schedule-date {
    color: #6b7280;
    font-weight: 400;
}

/* ── Form Actions ───────────────────────────────────────────────────────── */
.clay-form-actions {
    margin-top: 1.5rem;
    text-align: right;
}

.clay-btn--lg {
    padding: 0.85rem 2.5rem;
    font-size: var(--clay-font-size-md);
}

/* ── Toast Notification ─────────────────────────────────────────────────── */
.clay-toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--clay-radius-sm);
    margin-bottom: 1.25rem;
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    box-shadow: var(--clay-shadow-extruded-light);
    animation: clay-toast-in 0.3s ease-out;
}

.clay-toast--success {
    background: rgba(168, 230, 180, 0.4);
    color: #2d6a3f;
}

.clay-toast-icon {
    font-size: 1.2rem;
    font-weight: 700;
}

@keyframes clay-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   USER MANAGEMENT — Modal, User Cell, Action Buttons, Toast Container
   ═══════════════════════════════════════════════════════════════════════════ */

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.clay-card--table-page {
    padding: 1.5rem;
}

.clay-table-container {
    overflow-x: auto;
}

/* ── User cell (avatar + name) ─────────────────────────────────────────── */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.clay-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.clay-avatar--lg {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

.user-cell-name {
    font-weight: 500;
}

/* ── Action icon buttons ───────────────────────────────────────────────── */
.action-btns {
    display: flex;
    gap: 0.35rem;
    white-space: nowrap;
}

.clay-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-extruded-light);
    color: var(--clay-accent-text);
    cursor: pointer;
    transition: all var(--clay-transition);
}

.clay-icon-btn:hover {
    background: var(--clay-accent-primary);
    box-shadow: var(--clay-shadow-extruded-hover);
    color: #1a202c;
    transform: translateY(-1px);
}

/* ── Role pill ─────────────────────────────────────────────────────────── */
.clay-pill--role {
    background: rgba(166, 200, 255, 0.2);
    color: #3b5a8c;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.clay-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: clay-fade-in 0.2s ease-out;
}

.clay-modal {
    background: var(--clay-bg-card);
    border-radius: var(--clay-radius);
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    animation: clay-modal-in 0.25s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.clay-modal--sm {
    max-width: 400px;
}

.clay-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.clay-modal-header h3 {
    font-size: var(--clay-font-size-lg);
    font-weight: 600;
}

.clay-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-extruded-light);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--clay-accent-text);
    transition: all var(--clay-transition);
}

.clay-modal-close:hover {
    background: var(--clay-accent-error-bg);
    color: #c62828;
}

.clay-modal-body {
    margin-bottom: 1.5rem;
    font-size: var(--clay-font-size-sm);
    line-height: 1.6;
}

.clay-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ── Danger button ─────────────────────────────────────────────────────── */
.clay-btn--danger {
    background: var(--clay-accent-error);
    color: #fff;
    box-shadow: var(--clay-shadow-extruded-light);
}

.clay-btn--danger:hover {
    background: #e57373;
    box-shadow: var(--clay-shadow-extruded-hover);
    transform: translateY(-1px);
}

/* ── Toast container (fixed position) ──────────────────────────────────── */
.clay-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.clay-toast-container .clay-toast {
    margin-bottom: 0;
}

.clay-toast-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
    padding: 0 0 0 0.5rem;
}

.clay-toast-dismiss:hover {
    opacity: 1;
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes clay-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes clay-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS — Tabs, Toggle Switches, Divider
   ═══════════════════════════════════════════════════════════════════════════ */

.clay-card--settings {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* ── Pill-style tabs ──────────────────────────────────────────────────── */
.clay-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}

.clay-tab {
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 999px;
    background: var(--clay-bg-body);
    box-shadow: var(--clay-shadow-extruded-light);
    font-family: var(--clay-font-family);
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    color: var(--clay-accent-text);
    cursor: pointer;
    transition: all var(--clay-transition);
}

.clay-tab:hover {
    box-shadow: var(--clay-shadow-extruded-hover);
    transform: translateY(-1px);
}

.clay-tab.active {
    background: var(--clay-accent-primary);
    box-shadow: var(--clay-shadow-inset);
    color: #1a202c;
    font-weight: 600;
}

/* ── Tab panes ─────────────────────────────────────────────────────────── */
.clay-tab-pane {
    display: none;
}

.clay-tab-pane.active {
    display: block;
    animation: clay-fade-in 0.2s ease-out;
}

/* ── Toggle switch ─────────────────────────────────────────────────────── */
.clay-field--toggle {
    margin-bottom: 1rem;
}

.clay-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: var(--clay-font-size-sm);
    font-weight: 500;
    cursor: pointer;
}

.clay-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.clay-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.clay-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--clay-bg-body);
    box-shadow: inset 3px 3px 6px #d1d4da, inset -3px -3px 6px #ffffff;
    border-radius: 999px;
    transition: 0.3s;
}

.clay-toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--clay-bg-card);
    border-radius: 50%;
    box-shadow: var(--clay-shadow-extruded-light);
    transition: 0.3s;
}

.clay-toggle input:checked + .clay-toggle-slider {
    background: var(--clay-accent-primary);
}

.clay-toggle input:checked + .clay-toggle-slider::before {
    transform: translateX(22px);
}

/* ── Settings form spacing ─────────────────────────────────────────────── */
.settings-form {
    max-width: 400px;
}

.clay-avatar-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ── Divider ───────────────────────────────────────────────────────────── */
.clay-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DATATABLES — Clay Table Header/Footer Wrappers
   ═══════════════════════════════════════════════════════════════════════════ */

.clay-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.clay-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .dash-sidebar:not(.collapsed) {
        width: 64px;
        min-width: 64px;
    }
    .dash-sidebar:not(.collapsed) .sidebar-label,
    .dash-sidebar:not(.collapsed) .sidebar-brand {
        display: none;
    }
    .dash-sidebar.collapsed {
        width: 0;
        min-width: 0;
    }

    .dash-grid-2col {
        grid-template-columns: 1fr;
    }

    .dash-cards-row {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .clay-segmented-group {
        flex-direction: column;
    }

    .clay-chip-group {
        justify-content: center;
    }

    .user-dropdown {
        display: none;
    }
}

@media (max-width: 480px) {
    .clay-card {
        padding: 1.75rem;
    }

    .clay-card-title {
        font-size: 1.5rem;
    }

    .clay-input {
        padding: 0.65rem 1rem;
    }

    .clay-btn {
        padding: 0.75rem 1.5rem;
    }

    .dash-content {
        padding: 1rem;
    }
}
