/* ==========================================================================
   Frontiva App CSS
   Shared styles for all authenticated app pages
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */
:root {
    --ink: #0a0a0f;
    --paper: #fafaf7;
    --accent: #1a6b4a;
    --accent-hover: #155d3f;
    --accent-light: #e8f5ee;
    --warm: #f5f0e8;
    --muted: #6b6b7b;
    --border: #e2e0d8;

    --danger: #d93025;
    --danger-light: #fce8e6;
    --danger-hover: #c22a1f;
    --warning: #e8a317;
    --warning-light: #fef7e0;
    --success: #1a6b4a;
    --success-light: #e8f5ee;
    --info: #1a73e8;
    --info-light: #e8f0fe;

    --sidebar-width: 240px;
    --header-height: 0px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);

    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}


/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--ink);
}

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -1px; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.75px; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 0.95rem; }
h6 { font-size: 0.85rem; }

p {
    color: var(--muted);
    line-height: 1.7;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: var(--font-body);
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

::selection {
    background: var(--accent-light);
    color: var(--accent);
}


/* --------------------------------------------------------------------------
   3. App Layout (Sidebar + Main)
   -------------------------------------------------------------------------- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.app-content-full {
    flex: 1;
    padding: 40px;
    width: 100%;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    margin-bottom: 8px;
}

.page-header p {
    font-size: 0.95rem;
    color: var(--muted);
}

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-row h1 {
    margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   4. Sidebar Navigation
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--ink);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    padding: 28px 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo .logo {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
}

.sidebar-logo .logo-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    margin-left: 2px;
    vertical-align: super;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    padding: 16px 12px 8px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar-link:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
    color: white;
    background: rgba(26, 107, 74, 0.25);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-link-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .sidebar-link-icon {
    opacity: 1;
}

.sidebar-link-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.sidebar-logout:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
}

/* Mobile hamburger toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--ink);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.2rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
    background: #1a1a24;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-slow);
}

.sidebar-overlay.visible {
    opacity: 1;
}


/* --------------------------------------------------------------------------
   5. Cards
   -------------------------------------------------------------------------- */
.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.card-flat {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.card-header h3 {
    font-size: 1.05rem;
}

.card-body {
    /* default block */
}

.card-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.card-section + .card-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}


/* --------------------------------------------------------------------------
   6. Stats Cards (Dashboard Metrics)
   -------------------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

.stat-card-icon.warning {
    background: var(--warning-light);
}

.stat-card-icon.danger {
    background: var(--danger-light);
}

.stat-card-icon.info {
    background: var(--info-light);
}

.stat-card-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card-label {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 500;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.stat-card-change.positive {
    color: var(--success);
    background: var(--success-light);
}

.stat-card-change.negative {
    color: var(--danger);
    background: var(--danger-light);
}


/* --------------------------------------------------------------------------
   7. Tables (Call Logs, etc.)
   -------------------------------------------------------------------------- */
.table-wrapper {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.table-header h3 {
    font-size: 1.05rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 12px 24px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--ink);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(even) {
    background: rgba(250, 250, 247, 0.5);
}

tbody tr {
    transition: background var(--transition-fast);
}

tbody tr:hover {
    background: var(--accent-light);
}

.table-cell-primary {
    font-weight: 500;
    color: var(--ink);
}

.table-cell-secondary {
    color: var(--muted);
    font-size: 0.82rem;
}

.table-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--muted);
}

.table-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.table-pagination button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.table-pagination button:hover {
    background: var(--paper);
    border-color: var(--accent);
    color: var(--accent);
}

.table-pagination button.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.table-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* --------------------------------------------------------------------------
   8. Status Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-answered,
.badge-completed {
    color: var(--success);
    background: var(--success-light);
}

.badge-answered::before,
.badge-completed::before {
    background: var(--success);
}

.badge-missed {
    color: var(--danger);
    background: var(--danger-light);
}

.badge-missed::before {
    background: var(--danger);
}

.badge-voicemail {
    color: #a16207;
    background: var(--warning-light);
}

.badge-voicemail::before {
    background: var(--warning);
}

.badge-confirmed {
    color: var(--info);
    background: var(--info-light);
}

.badge-confirmed::before {
    background: var(--info);
}

.badge-cancelled {
    color: var(--muted);
    background: #f0f0f0;
}

.badge-cancelled::before {
    background: var(--muted);
}

.badge-pending {
    color: #a16207;
    background: var(--warning-light);
}

.badge-pending::before {
    background: var(--warning);
}

.badge-active {
    color: var(--success);
    background: var(--success-light);
}

.badge-active::before {
    background: var(--success);
}

/* Badges without dots */
.badge-plain {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-plain::before {
    display: none;
}


/* --------------------------------------------------------------------------
   9. Form Styles
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 6px;
}

.form-label-hint {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.8rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--ink);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #b0b0b8;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.1);
}

.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
    background: var(--paper);
    color: var(--muted);
    cursor: not-allowed;
}

.form-input.error,
.form-textarea.error,
.form-select.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.08);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b7b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-error {
    display: block;
    font-size: 0.78rem;
    color: var(--danger);
    margin-top: 4px;
}

.form-help {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.form-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}

.form-checkbox span {
    font-size: 0.9rem;
    color: var(--ink);
    line-height: 1.5;
}

/* Toggle */
.form-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.form-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
    flex-shrink: 0;
}

.form-toggle input {
    display: none;
}

.form-toggle input:checked + .form-toggle-switch {
    background: var(--accent);
}

.form-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.form-toggle input:checked + .form-toggle-switch::after {
    transform: translateX(20px);
}

.form-toggle-label {
    font-size: 0.9rem;
    color: var(--ink);
}


/* --------------------------------------------------------------------------
   10. Buttons
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary */
.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 2px 8px rgba(26, 107, 74, 0.25);
    color: white;
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Secondary (Outlined) */
.btn-secondary {
    background: white;
    color: var(--ink);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--paper);
    border-color: #ccc;
    color: var(--ink);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--paper);
    color: var(--ink);
}

/* Danger */
.btn-danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    box-shadow: 0 2px 8px rgba(217, 48, 37, 0.25);
    color: white;
}

/* Danger Outlined */
.btn-danger-outline {
    background: white;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger-outline:hover {
    background: var(--danger-light);
}

/* Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Icon button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--paper);
    color: var(--ink);
    border-color: #ccc;
}

/* Button group */
.btn-group {
    display: flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}


/* --------------------------------------------------------------------------
   11. Transcript Viewer
   -------------------------------------------------------------------------- */
.transcript-viewer {
    background: var(--ink);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.transcript-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transcript-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transcript-caller {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.transcript-meta {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
}

.transcript-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: #4ade80;
}

.transcript-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
}

.transcript-body {
    padding: 8px 0;
    max-height: 500px;
    overflow-y: auto;
}

.transcript-message {
    padding: 14px 24px;
    transition: background var(--transition-fast);
}

.transcript-message:hover {
    background: rgba(255, 255, 255, 0.03);
}

.transcript-message-speaker {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 4px;
    font-weight: 600;
}

.transcript-message-speaker.ai {
    color: #4ade80;
}

.transcript-message-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.transcript-message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
}

/* Chat-like bubble variant */
.transcript-bubbles .transcript-message {
    display: flex;
    flex-direction: column;
    padding: 6px 24px;
}

.transcript-bubbles .transcript-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 4px;
}

.transcript-bubbles .transcript-bubble.caller {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.transcript-bubbles .transcript-bubble.ai {
    background: rgba(26, 107, 74, 0.3);
    color: rgba(255, 255, 255, 0.9);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.transcript-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.35);
}

/* Custom scrollbar for transcript */
.transcript-body::-webkit-scrollbar {
    width: 6px;
}

.transcript-body::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.transcript-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}


/* --------------------------------------------------------------------------
   12. Toast / Notifications
   -------------------------------------------------------------------------- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 440px;
    pointer-events: auto;
    animation: toast-in 0.3s ease forwards;
    position: relative;
}

.toast.toast-out {
    animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 2px;
    margin: -2px -4px 0 0;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.toast-close:hover {
    opacity: 1;
}

/* Toast variants */
.toast-success {
    border-left: 3px solid var(--success);
}

.toast-success .toast-icon {
    background: var(--success-light);
    color: var(--success);
}

.toast-error {
    border-left: 3px solid var(--danger);
}

.toast-error .toast-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.toast-warning {
    border-left: 3px solid var(--warning);
}

.toast-warning .toast-icon {
    background: var(--warning-light);
    color: #a16207;
}

.toast-info {
    border-left: 3px solid var(--info);
}

.toast-info .toast-icon {
    background: var(--info-light);
    color: var(--info);
}


/* --------------------------------------------------------------------------
   13. Empty States
   -------------------------------------------------------------------------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 64px 32px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--muted);
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 360px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.empty-state .btn {
    margin-top: 4px;
}


/* --------------------------------------------------------------------------
   14. Loading Spinner
   -------------------------------------------------------------------------- */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 16px;
}

.loading-screen p {
    font-size: 0.88rem;
    color: var(--muted);
}

/* Inline loading */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--paper) 25%, #eee 50%, var(--paper) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-heading {
    height: 24px;
    width: 40%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

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


/* --------------------------------------------------------------------------
   15. Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modal-overlay-in 0.2s ease;
}

@keyframes modal-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modal-in 0.25s ease;
}

.modal-lg {
    max-width: 720px;
}

.modal-sm {
    max-width: 400px;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 0;
    gap: 16px;
}

.modal-header h2 {
    font-size: 1.2rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 1.2rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--paper);
    color: var(--ink);
}

.modal-body {
    padding: 20px 28px;
}

.modal-body p {
    font-size: 0.9rem;
    line-height: 1.7;
}

.modal-footer {
    padding: 0 28px 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}


/* --------------------------------------------------------------------------
   16. Responsive (Mobile Sidebar)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .app-content,
    .app-content-full {
        padding: 24px 16px;
        padding-top: 72px;
    }

    .page-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card-value {
        font-size: 1.6rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    /* Horizontal scroll for tables on mobile */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    /* Modal full-width on mobile */
    .modal {
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 20px 20px 0;
    }

    .modal-body {
        padding: 16px 20px;
    }

    .modal-footer {
        padding: 0 20px 20px;
    }

    .toast-container {
        top: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
    }

    /* Transcript viewer adjustments */
    .transcript-bubbles .transcript-bubble {
        max-width: 90%;
    }

    /* Onboarding */
    .onboarding-container {
        padding: 24px 16px;
    }

    .onboarding-card {
        padding: 32px 24px;
    }

    .onboarding-progress-steps {
        gap: 4px;
    }
}

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

    h1 {
        font-size: 1.6rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: var(--radius-sm);
    }

    .btn-group .btn + .btn {
        margin-left: 0;
        margin-top: -1px;
    }
}


/* --------------------------------------------------------------------------
   17. Onboarding (Multi-step Form)
   -------------------------------------------------------------------------- */
.onboarding-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--paper);
    padding: 40px;
}

.onboarding-container {
    width: 100%;
    max-width: 600px;
}

.onboarding-logo {
    text-align: center;
    margin-bottom: 32px;
}

.onboarding-logo .logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.onboarding-progress {
    margin-bottom: 32px;
}

.onboarding-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 16px;
}

.onboarding-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.onboarding-progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.onboarding-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 500;
}

.onboarding-step-indicator.active {
    color: var(--accent);
}

.onboarding-step-indicator.completed {
    color: var(--accent);
}

.onboarding-step-dot {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.onboarding-step-indicator.active .onboarding-step-dot {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

.onboarding-step-indicator.completed .onboarding-step-dot {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.onboarding-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    box-shadow: var(--shadow-sm);
}

.onboarding-card h2 {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.onboarding-card > p {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
}

.onboarding-actions .btn {
    min-width: 120px;
}

.onboarding-skip {
    font-size: 0.85rem;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    transition: color var(--transition-fast);
}

.onboarding-skip:hover {
    color: var(--ink);
}


/* --------------------------------------------------------------------------
   18. Auth Pages (Login / Signup)
   -------------------------------------------------------------------------- */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--paper);
    padding: 40px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 36px;
}

.auth-logo .logo {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow-sm);
}

.auth-card h1 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card > p {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 28px;
}

.auth-card .form-group:last-of-type {
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-footer a {
    font-weight: 500;
}

.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-social-btn:hover {
    background: var(--paper);
    border-color: #ccc;
}

.auth-social-btn img,
.auth-social-btn svg {
    width: 18px;
    height: 18px;
}


/* --------------------------------------------------------------------------
   19. Utility Classes
   -------------------------------------------------------------------------- */

/* Text */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: #a16207; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1.1rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-mono { font-family: var(--font-mono); }
.font-heading { font-family: var(--font-heading); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* Display */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-flex { display: inline-flex; }

/* Width */
.w-full { width: 100%; }
.max-w-sm { max-width: 400px; }
.max-w-md { max-width: 600px; }
.max-w-lg { max-width: 800px; }

/* Borders */
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Backgrounds */
.bg-white { background: white; }
.bg-paper { background: var(--paper); }
.bg-warm { background: var(--warm); }
.bg-accent-light { background: var(--accent-light); }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Visibility helpers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* --------------------------------------------------------------------------
   20. Additional Components
   -------------------------------------------------------------------------- */

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
    margin-bottom: 24px;
}

.tab {
    padding: 12px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--ink);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-flex;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--transition-fast);
}

.dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--ink);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--paper);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: var(--danger-light);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Search input */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--ink);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder {
    color: #b0b0b8;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.1);
}

/* Chip / Tag */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink);
}

.chip-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.chip-remove:hover {
    color: var(--danger);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.72rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Divider */
.divider {
    height: 1px;
    background: var(--border);
    margin: 24px 0;
}

/* Tooltip (CSS only) */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: var(--ink);
    color: white;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* Alert */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.alert-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid rgba(26, 107, 74, 0.15);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
    border: 1px solid rgba(217, 48, 37, 0.15);
}

.alert-warning {
    background: var(--warning-light);
    color: #a16207;
    border: 1px solid rgba(232, 163, 23, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info);
    border: 1px solid rgba(26, 115, 232, 0.15);
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.15rem;
}

.section-header h3 {
    font-size: 1rem;
}


/* --------------------------------------------------------------------------
   21. Animation Utilities
   -------------------------------------------------------------------------- */
.fade-in {
    animation: fade-in 0.3s ease forwards;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slide-up 0.3s ease forwards;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-down {
    animation: slide-down 0.3s ease forwards;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --------------------------------------------------------------------------
   22. Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .sidebar,
    .sidebar-toggle,
    .toast-container,
    .modal-overlay {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .card,
    .stat-card,
    .table-wrapper {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }
}
