/* ============================================================
   Riptide Application Manager — Design System
   Aligned with Riptide Auth visual standards.
   Shoelace + HTMX, no Bootstrap dependency.
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------- */
:root {
    /* Brand */
    --riptide-blue:      #24567F;
    --riptide-blue-dark: #1C4363;
    --riptide-blue-light:#DCE8F1;

    /* Semantic */
    --color-success:     #10b981;
    --color-success-bg:  #d1fae5;
    --color-success-fg:  #065f46;
    --color-warning:     #f59e0b;
    --color-warning-bg:  #fef3c7;
    --color-warning-fg:  #92400e;
    --color-danger:      #ef4444;
    --color-danger-bg:   #fee2e2;
    --color-danger-fg:   #991b1b;
    --color-info-bg:     #DCE8F1;
    --color-info-fg:     #1C4363;

    /* Neutral */
    --color-bg:          #f4f6f8;
    --color-surface:     #ffffff;
    --color-border:      #dde3e9;
    --color-text:        #576a7c;
    --color-text-bold:   #212121;
    --color-text-muted:  #7b8d9e;
    --color-text-faint:  #a3b1be;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', Consolas, monospace;

    /* Layout */
    --container-max: 1400px;
    --radius:        0.5rem;
    --radius-lg:     0.75rem;
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow:        0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:     0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

    /* Shoelace overrides */
    --sl-color-primary-50:  #EDF3F7;
    --sl-color-primary-100: #DCE8F1;
    --sl-color-primary-200: #B0C9DB;
    --sl-color-primary-300: #7DA7C2;
    --sl-color-primary-400: #4F82A1;
    --sl-color-primary-500: #24567F;
    --sl-color-primary-600: #1C4363;
    --sl-color-primary-700: #16344D;
    --sl-color-primary-800: #112839;
    --sl-color-primary-900: #212121;
    --sl-color-primary-950: #151515;
    --sl-color-danger-600:  #ef4444;
    --sl-color-warning-600: #f59e0b;
    --sl-font-sans: var(--font-sans);
    --sl-border-radius-medium: var(--radius);
}

/* ----------------------------------------------------------
   2. Base & Reset
   ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--riptide-blue); text-decoration: none; }
a:hover { color: var(--riptide-blue-dark); text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-bg);
    padding: 0.125em 0.375em;
    border-radius: 0.25rem;
}

/* ----------------------------------------------------------
   3. Layout
   ---------------------------------------------------------- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* ----------------------------------------------------------
   4. App Header — Riptide Auth blue bar
   ---------------------------------------------------------- */
.app-header {
    background: var(--riptide-blue);
    color: #ffffff;
    padding: 0;
}

.header-inner {
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 56px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}
.header-brand:hover { color: #ffffff; text-decoration: none; }
.header-brand sl-icon { font-size: 1.25rem; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    text-decoration: none;
}
.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}
.nav-item sl-icon { font-size: 1rem; }
.nav-exit { margin-left: auto; }

/* ----------------------------------------------------------
   5. Footer
   ---------------------------------------------------------- */
.app-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* ----------------------------------------------------------
   6. Page Header
   ---------------------------------------------------------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--color-border);
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-bold);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header .text-muted {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-top: 0.125rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* ----------------------------------------------------------
   7. Cards — Riptide Auth pattern
   ---------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-bold);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

/* Navigation cards — Riptide Auth admin grid */
.nav-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.nav-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.15s;
}
.nav-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.nav-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.nav-card-icon sl-icon {
    font-size: 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
}
.nav-card-icon.blue    { background: var(--riptide-blue);     color: #fff; }
.nav-card-icon.green   { background: var(--color-success);     color: #fff; }
.nav-card-icon.purple  { background: #0891b2;                  color: #fff; }
.nav-card-icon.orange  { background: #ea580c;                  color: #fff; }
.nav-card-icon.teal    { background: #0d9488;                  color: #fff; }
.nav-card-icon.slate   { background: #475569;                  color: #fff; }
.nav-card-icon.rose    { background: #e11d48;                  color: #fff; }
.nav-card-icon.amber   { background: var(--color-warning);     color: #fff; }
.nav-card-icon.indigo  { background: #4f46e5;                  color: #fff; }

.nav-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-text-bold);
    margin: 0 0 0.125rem;
}

.nav-card .subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
}

.nav-card p {
    font-size: 0.875rem;
    color: var(--color-text);
    margin: 0 0 1.25rem;
    flex: 1;
    line-height: 1.5;
}

a.nav-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
a.nav-card:hover {
    color: inherit;
    text-decoration: none;
}

.nav-card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--riptide-blue);
    margin-top: auto;
}
a.nav-card:hover .nav-card-action {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   8. Stats Row — compact metric strip
   ---------------------------------------------------------- */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.stat-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: var(--riptide-blue);     color: #fff; }
.stat-icon.green  { background: var(--color-success);     color: #fff; }
.stat-icon.purple { background: #0891b2;                  color: #fff; }
.stat-icon.orange { background: #ea580c;                  color: #fff; }
.stat-icon.teal   { background: #0d9488;                  color: #fff; }
.stat-icon.slate  { background: #475569;                  color: #fff; }

.stat-content { flex: 1; min-width: 0; }
.stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-bold);
    line-height: 1.2;
}

.trend-indicator {
    font-size: 0.75rem;
    margin-left: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    font-weight: 500;
}
.trend-indicator sl-icon { font-size: 0.625rem; }
.trend-up      { color: var(--color-success); }
.trend-down    { color: var(--color-danger); }
.trend-neutral { color: var(--color-text-muted); }

/* Keep old class name as alias for dashboard backward compat */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ----------------------------------------------------------
   9. Data Tables
   ---------------------------------------------------------- */
.data-table {
    width: 100%;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--color-bg);
    border-bottom: 2px solid var(--color-border);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 0.875rem;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }

/* ----------------------------------------------------------
   10. Badges
   ---------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.badge.success,
.badge-success   { background: var(--color-success-bg); color: var(--color-success-fg); }
.badge.warning,
.badge-warning   { background: var(--color-warning-bg); color: var(--color-warning-fg); }
.badge.danger,
.badge.error,
.badge-danger,
.badge-error     { background: var(--color-danger-bg);  color: var(--color-danger-fg); }
.badge.info,
.badge-info      { background: var(--color-info-bg);     color: var(--color-info-fg); }
.badge.secondary,
.badge-secondary { background: #dde3e9;                  color: #475569; }

/* ----------------------------------------------------------
   11. Filters
   ---------------------------------------------------------- */
.filters {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

/* ----------------------------------------------------------
   12. Pagination
   ---------------------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.pagination-info {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* ----------------------------------------------------------
   13. Empty State
   ---------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}
.empty-state > sl-icon {
    font-size: 3.5rem;
    color: var(--color-text-faint);
    margin-bottom: 0.75rem;
}
.empty-state sl-button sl-icon {
    font-size: 1rem;
    margin-bottom: 0;
}
.empty-state h3 {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin: 0;
}
.empty-state p {
    color: var(--color-text-faint);
    margin: 0.375rem 0 1.25rem;
}

/* ----------------------------------------------------------
   14. Forms
   ---------------------------------------------------------- */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
}

.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input::placeholder { color: var(--color-text-faint); }
.form-input:focus {
    border-color: var(--riptide-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--riptide-blue);
    cursor: pointer;
}

.field-validation { font-size: 0.8125rem; display: block; margin-top: 0.25rem; }

/* ----------------------------------------------------------
   14b. Buttons
   ---------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--riptide-blue);
    color: #ffffff;
    border-color: var(--riptide-blue);
}
.btn-primary:hover {
    background: var(--riptide-blue-dark);
    border-color: var(--riptide-blue-dark);
    color: #ffffff;
}
.btn-primary:active { transform: translateY(1px); }

.btn-outline {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-outline:hover {
    background: var(--color-bg);
    border-color: var(--color-text-muted);
    color: var(--color-text-bold);
}

.btn-block { width: 100%; }

/* ----------------------------------------------------------
   14c. Alerts
   ---------------------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success-fg);
    border: 1px solid var(--color-success);
}
.alert-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger-fg);
    border: 1px solid var(--color-danger);
}

/* ----------------------------------------------------------
   15. Action Buttons Row
   ---------------------------------------------------------- */
.action-buttons {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* ----------------------------------------------------------
   15b. Form Layouts
   ---------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-grid dt {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    margin-bottom: 0.25rem;
}

.detail-grid dd {
    margin: 0 0 1rem;
    color: var(--color-text);
}

/* ----------------------------------------------------------
   16. Utilities
   ---------------------------------------------------------- */
.text-muted    { color: var(--color-text-muted); }
.text-danger   { color: var(--color-danger); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }
.text-center   { text-align: center; }
.text-end      { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.p-0  { padding: 0; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 1rem; }
.p-4  { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.d-flex         { display: flex; }
.d-inline-flex  { display: inline-flex; }
.d-none         { display: none; }
.d-block        { display: block; }
.d-grid         { display: grid; }
.flex-column    { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.align-items-center    { align-items: center; }
.align-items-start     { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center  { justify-content: center; }
.justify-content-end     { justify-content: flex-end; }

.w-100  { width: 100%; }
.h-100  { height: 100%; }
.fw-bold   { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fs-small  { font-size: 0.875rem; }
.small     { font-size: 0.875rem; }

/* Alert / flash messages */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success-fg); border: 1px solid var(--color-success); }
.alert-danger  { background: var(--color-danger-bg);  color: var(--color-danger-fg);  border: 1px solid var(--color-danger); }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning-fg); border: 1px solid var(--color-warning); }
.alert-info    { background: var(--color-info-bg);     color: var(--color-info-fg);    border: 1px solid #24567F; }

/* Table styling */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}
.table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-bg);
}
.table tbody tr:hover { background: #f8fafc; }
.table-striped tbody tr:nth-child(even) { background: #f8fafc; }

/* List group */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}
.list-group-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}
.list-group-item:last-child { border-bottom: none; }

/* Grid row/col system replacement */
.row {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}
.col-md-2  { grid-column: span 2; }
.col-md-3  { grid-column: span 3; }
.col-md-4  { grid-column: span 4; }
.col-md-5  { grid-column: span 5; }
.col-md-6  { grid-column: span 6; }
.col-md-7  { grid-column: span 7; }
.col-md-8  { grid-column: span 8; }
.col-md-9  { grid-column: span 9; }
.col-md-10 { grid-column: span 10; }
.col-md-12 { grid-column: span 12; }
.col-lg-3  { grid-column: span 3; }
.col-lg-4  { grid-column: span 4; }
.col-lg-6  { grid-column: span 6; }
.col-lg-8  { grid-column: span 8; }

/* Form controls — native inputs styled to match Shoelace */
.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--riptide-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--color-text);
    font-size: 0.875rem;
}
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.form-text {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Buttons — CSS classes for standard form submits, prefer <sl-button> */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--riptide-blue);
    color: #fff;
    border-color: var(--riptide-blue);
}
.btn-primary:hover { background: var(--riptide-blue-dark); color: #fff; }
.btn-default, .btn-secondary, .btn-outline-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-default:hover, .btn-secondary:hover, .btn-outline-secondary:hover {
    background: var(--color-bg);
}
.btn-danger, .btn-outline-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
}
.btn-danger:hover, .btn-outline-danger:hover { background: #dc2626; }
.btn-warning {
    background: var(--color-warning);
    color: #fff;
    border-color: var(--color-warning);
}
.btn-success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
}
.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8125rem;
}
.btn-lg {
    padding: 0.625rem 1.5rem;
    font-size: 1rem;
}

/* Input group */
.input-group {
    display: flex;
    align-items: stretch;
}
.input-group .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}
.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Tabs (replaced by sl-tab-group) — keep as fallback */
.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.nav-tabs .nav-link {
    padding: 0.5rem 1rem;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}
.nav-tabs .nav-link:hover { color: var(--color-text); }
.nav-tabs .nav-link.active {
    color: var(--riptide-blue);
    border-bottom-color: var(--riptide-blue);
}

/* Responsive grid adjustments */
@media (max-width: 768px) {
    .row { grid-template-columns: 1fr; }
    .col-md-2, .col-md-3, .col-md-4, .col-md-5,
    .col-md-6, .col-md-7, .col-md-8, .col-md-9,
    .col-md-10, .col-md-12,
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8 {
        grid-column: span 1;
    }
}

/* ----------------------------------------------------------
   18. Loading
   ---------------------------------------------------------- */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* ----------------------------------------------------------
   19. Responsive
   ---------------------------------------------------------- */
/* Icon-only navbar at typical screen widths. With ~18 nav items at
 * ~130px each (label + icon + padding), the label-shown footprint is
 * roughly 2400px; collapsing to icons keeps the navbar from overflowing
 * at 1080p (1920px) and 1440p (2560px) viewports. The breakpoint must
 * grow as nav items are added — see _Layout.cshtml. Reverse logic on
 * mobile (≤768px) wraps and re-shows labels, handled below. */
@media (max-width: 1920px) {
    .nav-item > span { display: none; }
    .nav-item { padding: 0.5rem; }
    .nav-item sl-icon { font-size: 1.125rem; }
}

@media (max-width: 1024px) {
    .nav-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    .header-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .nav-exit { margin-left: 0; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .nav-card-grid {
        grid-template-columns: 1fr;
    }

    .stats-strip,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        flex-direction: column;
    }
    .filter-group {
        width: 100%;
        min-width: unset;
    }
    .form-grid,
    .form-grid-3,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}
