/* ==========================================================================
   Utility Classes
   Token-based utility classes for replacing inline styles.
   Uses design tokens from _theme_variables.html.
   ========================================================================== */

/* --- Display --- */
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* --- Flexbox --- */
.flex-1 { flex: 1; }
.flex-auto { flex: 0 0 auto; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.align-end { align-items: flex-end; }
.align-start { align-items: flex-start; align-self: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }       /* 4px */
.gap-2 { gap: var(--space-2); }       /* 8px */
.gap-3 { gap: var(--space-3); }       /* 12px */
.gap-4 { gap: var(--space-4); }       /* 16px */

/* --- Width / Height --- */
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.max-h-100 { max-height: 100%; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-scroll { overflow: scroll; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }
.text-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Text Alignment --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* --- Font Size (token-based) --- */
.text-2xs { font-size: var(--text-2xs); }   /* 10px */
.text-xs { font-size: var(--text-xs); }     /* 12px */
.text-sm { font-size: var(--text-sm); }     /* 13px */
.text-base { font-size: var(--text-base); } /* 14px */
.text-md { font-size: var(--text-md); }     /* 16px */
.text-lg { font-size: var(--text-lg); }     /* 18px */
.text-xl { font-size: var(--text-xl); }     /* 20px */
.text-2xl { font-size: var(--text-2xl); }   /* 24px */
.text-3xl { font-size: var(--text-3xl); }   /* 32px */

/* --- Font Weight --- */
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-bold { font-weight: var(--font-weight-bold); }

/* --- Text Color --- */
.color-text { color: var(--color-text); }
.color-text-secondary { color: var(--color-text-secondary); }
.color-text-muted { color: var(--color-text-muted); }
.color-accent { color: var(--color-accent); }
.color-danger { color: var(--color-danger); }
.color-success { color: var(--color-success); }

/* --- Margin (token-based) --- */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

.mt-1 { margin-top: var(--space-1); }       /* 4px */
.mt-2 { margin-top: var(--space-2); }       /* 8px */
.mt-3 { margin-top: var(--space-3); }       /* 12px */
.mt-4 { margin-top: var(--space-4); }       /* 16px */
.mt-5 { margin-top: var(--space-5); }       /* 20px */

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }    /* 24px */
.mb-8 { margin-bottom: var(--space-8); }    /* 32px */

.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-5 { margin-left: var(--space-5); }

.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }

/* --- Padding (token-based) --- */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.pt-2 { padding-top: var(--space-2); }
.pb-2 { padding-bottom: var(--space-2); }
.px-3 { padding-left: var(--space-3); padding-right: var(--space-3); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }

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

/* --- Border Radius --- */
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }

/* --- Background --- */
.bg-surface { background: var(--color-surface); }

/* --- Sync provider card (right_column.html) --- */
.sync-provider-card {
    margin-bottom: var(--space-4);
    padding: var(--space-3);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.sync-provider-card--disabled {
    opacity: 0.6;
}

.sync-provider-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.sync-provider-header--no-mb {
    margin-bottom: 0;
}

.sync-provider-icon--dropbox { color: #0061FF; }
.sync-provider-icon--gdrive { color: #4285F4; }
.sync-provider-icon--onedrive { color: #0078D4; }

.sync-provider-name {
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.sync-provider-status {
    margin-left: auto;
    font-size: var(--text-2xs);
}

.sync-provider-controls {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.sync-provider-folder {
    color: #aaa;
    font-size: var(--text-xs);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-provider-btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-2xs);
}

.sync-provider-btn--danger {
    background: var(--color-danger);
    color: white;
}

.sync-provider-label {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-2xs);
    color: var(--color-text-muted);
}

.sync-provider-hint {
    color: #888;
    font-size: var(--text-2xs);
}

/* --- P21 Data page classes --- */
.p21-description {
    color: var(--color-text-muted);
    margin-bottom: var(--space-6);
}

.p21-workspace-label {
    color: var(--color-text);
    margin-right: var(--space-2);
}

.p21-workspace-select {
    max-width: 300px;
    display: inline-block;
}

.p21-upload-card {
    background: var(--color-surface);
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-8);
}

.p21-section-title {
    margin-bottom: var(--space-4);
    color: var(--color-text);
}

.p21-form-row {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: flex-end;
}

.p21-form-field {
    flex: 1;
    min-width: 200px;
}

.p21-form-label {
    display: block;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
    font-size: 0.9em;
}

.p21-batch-count {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-normal);
    font-size: 0.9em;
}

.p21-loading {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-muted);
}

.p21-empty-state {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-muted);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
}

.p21-empty-icon {
    font-size: 2em;
    margin-bottom: var(--space-4);
    display: block;
}

.p21-cases-modal {
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.p21-edit-modal {
    max-width: 500px;
}

.p21-form-group {
    margin-bottom: var(--space-4);
}

.p21-form-group label {
    display: block;
    margin-bottom: var(--space-1);
}

.p21-pagination {
    margin-top: var(--space-4);
    text-align: center;
}

.p21-pagination--top {
    margin-bottom: var(--space-4);
    margin-top: 0;
}

.p21-pagination-info {
    margin: 0 var(--space-4);
    color: var(--color-text);
}

.p21-loading-sm {
    text-align: center;
    padding: var(--space-8);
}

/* --- Admin page header (repeated pattern) --- */
.admin-page-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.admin-page-header h1 {
    margin: 0;
}

/* --- Workflow report styles (admin_dashboard_workflows.html JS) --- */
.wf-report-status-icon {
    margin-right: var(--space-2);
}

.wf-report-details {
    margin: var(--space-1\.5) 0;
}

.wf-report-details summary {
    cursor: pointer;
}

.wf-report-pre {
    background: var(--color-surface);
    padding: var(--space-1\.5);
    overflow-x: auto;
}

/* --- Logo branding spans --- */
.logo-part-accent { color: var(--color-accent); }
.logo-part-text { color: var(--color-text); }
.logo-version {
    color: var(--color-text-secondary);
    font-size: medium;
    cursor: pointer;
    margin-left: var(--space-1);
}

/* --- Auth page description text --- */
.auth-description {
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: var(--space-8);
}

/* --- LLM Chat container --- */
.llmchat-container {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* --- Reactflow controls --- */
.reactflow-controls-overlay {
    position: absolute;
    top: var(--space-2\.5);
    left: var(--space-2\.5);
    z-index: 1000;
}

/* --- Workflow list/creator page --- */
.wf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2\.5) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.wf-viewer-title {
    margin: 0;
    color: var(--color-text-secondary);
}

.wf-creator-grid {
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 0.1% 1fr;
}

/* --- Organization dashboard grouper preview label --- */
.grouper-workspace-label {
    color: var(--color-text-muted);
    margin-right: var(--space-2);
    font-size: 0.9em;
}