/* Civadelia Design V2: RevenueCat-inspired restrained colour and hierarchy, Cloudflare-inspired operations.
   Overrides are deliberately scoped to authenticated workspace shell; no public pages affected. */
html[data-civa-theme="light"] { color-scheme:light; }
html[data-civa-theme="dark"] { color-scheme:dark; }
body.co-ui-v1 .co-app-shell { --civa-v2-accent:var(--brand-text); --civa-v2-text:var(--text); --civa-v2-muted:var(--text-muted); --civa-v2-surface:var(--surface); --civa-v2-bg:var(--bg); --civa-v2-border:var(--border); }
body.co-ui-v1 .co-app-shell .co-user-avatar { background:#edf0f3 !important;color:#303640 !important;border:1px solid #dce1e7 !important;box-shadow:none !important; }
body.co-ui-v1 .co-app-shell .co-page { max-width:1280px; }
body.co-ui-v1 .co-app-shell .co-page-header h1 { font-size:clamp(24px,2vw,30px) !important;line-height:1.16;letter-spacing:-.025em; }
body.co-ui-v1 .co-app-shell .co-panel { border-radius:11px; }
body.co-ui-v1 .co-app-shell .co-panel-head { min-height:48px;align-items:center; }
body.co-ui-v1 .co-app-shell .co-panel-head h2 { font-size:15px;line-height:1.3; }
body.co-ui-v1 .co-app-shell .co-module-grid.civa-v2-operations-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
body.co-ui-v1 .co-app-shell .civa-v2-operations-grid > a.civa-v2-operation-card {min-height:106px;padding:17px !important;display:flex;align-items:flex-start;gap:12px;border:1px solid var(--civa-v2-border);border-radius:10px;background:var(--civa-v2-surface) !important;color:var(--civa-v2-text) !important;text-decoration:none;box-shadow:none !important;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-card .co-action-icon {margin:0 !important;flex:0 0 32px;display:grid;place-items:center;width:32px;height:32px;border-radius:8px;background:#f3f4f7;color:#818c9c;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-copy {display:flex;flex-direction:column;gap:6px;min-width:0;flex:1;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-copy strong {font-size:13px;color:var(--civa-v2-text);font-weight:680;line-height:1.35;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-copy small {font-size:12px;color:var(--civa-v2-muted);line-height:1.5;font-weight:400;}
body.co-ui-v1 .co-app-shell .civa-v2-card-arrow {width:13px;height:13px;flex:0 0 13px;color:var(--civa-v2-muted);margin-top:3px;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-card:hover {border-color:#c7ced8 !important;background:#fafbfc !important;transform:none !important;}
body.co-ui-v1 .co-app-shell .civa-v2-operation-card:focus-visible,body.co-ui-v1 .co-app-shell .civa-v2-recent-card:focus-visible {outline:2px solid var(--civa-v2-accent);outline-offset:2px;}
body.co-ui-v1 .co-app-shell .civa-v2-recents {margin-bottom:18px;}
body.co-ui-v1 .co-app-shell .civa-v2-recent-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;}
body.co-ui-v1 .co-app-shell .civa-v2-recent-card {text-decoration:none;display:flex;flex-direction:column;gap:6px;border:1px solid var(--civa-v2-border);background:var(--civa-v2-surface);border-radius:9px;padding:13px 15px;min-height:64px;}
body.co-ui-v1 .co-app-shell .civa-v2-recent-card strong {color:var(--civa-v2-text);font-size:13px;}
body.co-ui-v1 .co-app-shell .civa-v2-recent-card small {color:var(--civa-v2-muted);font-size:var(--fs-xs);}
body.co-ui-v1 .co-app-shell .civa-v2-recents-empty {margin:0;color:var(--civa-v2-muted);font-size:13px;}
body.co-ui-v1 .co-app-shell .civa-v2-view-all {font-size:12px;}
body.co-ui-v1 .civa-nav-refresh .co-side-nav a {font-size:12.5px !important;}
body.co-ui-v1 .civa-nav-refresh .civa-operation-links > a {font-size:12px !important;}

/* Cloudflare-style management / rules layout. Preserve existing controls and workflows. */
body.co-ui-v1 .civa-nav-refresh .cg-page {--cg-green:var(--civa-v2-accent);--cg-ink:var(--civa-v2-text);--cg-muted:var(--civa-v2-muted);--cg-border:var(--civa-v2-border);--cg-pale:var(--surface-2);max-width:1280px;padding:25px 16px 56px;}
body.co-ui-v1 .civa-nav-refresh .cg-hero {background:#fff;border-color:var(--civa-v2-border);border-radius:12px;padding:24px 27px;box-shadow:none;}
body.co-ui-v1 .civa-nav-refresh .cg-hero h1 {font-size:27px;font-weight:720;letter-spacing:-.025em;}
body.co-ui-v1 .civa-nav-refresh .cg-status {background:#f1f3f5;color:#4a5360;}
body.co-ui-v1 .civa-nav-refresh .cg-tabs {gap:6px;padding-top:17px;margin-bottom:18px;}
body.co-ui-v1 .civa-nav-refresh .cg-tabs a {font-size:13px;padding:11px 12px;}
body.co-ui-v1 .civa-nav-refresh .cg-tabs a.active {background:transparent;color:var(--civa-v2-accent);border-color:var(--civa-v2-accent);}
body.co-ui-v1 .civa-nav-refresh .cg-panel,body.co-ui-v1 .civa-nav-refresh .cg-card {box-shadow:none;border-radius:11px;padding:24px;}
body.co-ui-v1 .civa-nav-refresh .cg-narrow {max-width:920px;}
body.co-ui-v1 .civa-nav-refresh .cg-form label {font-size:13px;line-height:1.5;gap:7px;}
body.co-ui-v1 .civa-nav-refresh .cg-form small,body.co-ui-v1 .civa-nav-refresh .cg-panel small {font-size:12px;}
body.co-ui-v1 .civa-nav-refresh .cg-form input:not([type="checkbox"]),body.co-ui-v1 .civa-nav-refresh .cg-form select,body.co-ui-v1 .civa-nav-refresh .cg-form textarea {min-height:42px;border-radius:8px;font-size:14px;}
body.co-ui-v1 .civa-nav-refresh .cg-button {min-height:38px;font-size:12.5px;padding:9px 13px;}
body.co-ui-v1 .civa-nav-refresh .cg-table th {font-size:var(--fs-xs);}
body.co-ui-v1 .civa-nav-refresh .cg-table td {font-size:12.5px;}

/* Accessible iOS-like theme control inside account menu. */
body.co-ui-v1 .co-user-popover .civa-v2-preferences-separator {height:1px;background:var(--civa-v2-border);margin:7px 0;}
body.co-ui-v1 .co-user-popover .civa-v2-theme-row {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px;min-height:48px;}
body.co-ui-v1 .co-user-popover .civa-v2-theme-label {font-size:13px;font-weight:600;color:var(--civa-v2-text);}
body.co-ui-v1 .co-user-popover .civa-v2-theme-switch {position:relative;display:inline-flex;align-items:center;width:43px;height:25px;flex:0 0 43px;padding:3px;border:0;border-radius:999px;background:#cbd2da;cursor:pointer;transition:background .2s;}
body.co-ui-v1 .co-user-popover .civa-v2-theme-switch[aria-checked="true"] {background:var(--brand);}
body.co-ui-v1 .co-user-popover .civa-v2-theme-thumb {display:block;background:#fff;width:19px;height:19px;border-radius:999px;box-shadow:0 1px 3px rgba(0,0,0,.2);transform:translateX(0);transition:transform .2s;}
body.co-ui-v1 .co-user-popover .civa-v2-theme-switch[aria-checked="true"] .civa-v2-theme-thumb {transform:translateX(18px);}
body.co-ui-v1 .co-user-popover .civa-v2-theme-switch:focus-visible {outline:2px solid var(--brand-text);outline-offset:3px;}
@media(prefers-reduced-motion:reduce) {body.co-ui-v1 .co-user-popover .civa-v2-theme-switch,body.co-ui-v1 .co-user-popover .civa-v2-theme-thumb {transition:none;}}

/* Dark mode is shared across student, lecturer and staff authenticated workspaces. */
html[data-civa-theme="dark"] body.co-ui-v1 {background:#111318;color:#e8ebf0;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell {--co-bg:var(--bg);--co-surface-soft:var(--surface-2);--co-border:var(--border);--co-heading:var(--text);--co-ink:var(--text);--co-primary:var(--brand-text);--co-primary-soft:var(--brand-soft);--civa-v2-accent:var(--brand-text);--civa-v2-text:var(--text);--civa-v2-muted:var(--text-muted);--civa-v2-surface:var(--surface);--civa-v2-bg:var(--bg);--civa-v2-border:var(--border);--civ-v3-shell-bg:var(--bg);--civ-v3-text:var(--text);--civ-v3-border:var(--border);--civ-v3-soft:var(--surface-2); color:#e7eaf0;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-sidebar,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-sidebar-brand,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-sidebar-footer {background:#171b22 !important;border-color:#343942 !important;color:#ebedf2 !important;box-shadow:none !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-side-nav a {color:#bac2cd !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-side-nav a .co-icon,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-operation-group > summary > .co-icon {color:#9fa9b7 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-side-nav a:hover,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-operation-group > summary:hover {background:#252a33 !important;color:#f1f3f6 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-side-nav a.is-active,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-operation-group[open] > summary {background:var(--brand-soft) !important;color:var(--brand-text) !important;box-shadow:none !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-operations-section,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-operation-links {border-color:#343943 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-nav-label,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-brand-copy small {color:#9ea8b3 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-brand-copy strong,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-context-title strong {color:#f0f2f6 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-app-frame,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-main {background:#111318 !important;color:#e7eaf0 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-topbar {background:#1b1f26 !important;border-color:#343943 !important;box-shadow:none !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-page-header h1,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell h1,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell h2,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell h3 {color:#f0f2f5 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell p,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell small,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-context-title small {color:#aeb8c3;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-panel,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-stat,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-card,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-popover {background:#20242b !important;border-color:#363c45 !important;box-shadow:none !important;color:#e8ebf0 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-panel-head,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-footer {background:#20242b !important;border-color:#363c45 !important;color:#b9c2cc !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-tenant-card,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-active-tenant,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-search-wrap {background:#252a32 !important;border-color:#393f4a !important;color:#e7eaf0 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-tenant-card-copy strong,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-active-tenant-copy strong {color:#f0f2f5 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-user-avatar {background:#333942 !important;color:#f0f2f5 !important;border-color:#464e59 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-module-grid.civa-v2-operations-grid > a.civa-v2-operation-card,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-v2-recent-card {background:#242931 !important;border-color:#3a414c !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-v2-operation-card:hover {background:#303640 !important;border-color:#57606f !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .civa-v2-operation-card .co-action-icon {background:#303640;color:#b0b9c6;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-user-popover .civa-v2-theme-label {color:#f0f2f5;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell input:not([type="checkbox"]):not([type="radio"]),html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell select,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell textarea {background:#252a32 !important;color:#e8ecf2 !important;border-color:#47505c !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell input::placeholder,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell textarea::placeholder {color:#96a2b1 !important;opacity:1;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-btn:not(.primary),html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-icon-btn {background:#2b313a !important;color:#e8ecf2 !important;border-color:#444c59 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-btn.primary {background:var(--brand) !important;color:var(--on-brand) !important;border-color:var(--brand) !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell table {color:#e7eaf0;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell th {background:#2b3038 !important;color:#d5dae2 !important;border-color:#3e4650 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell td {border-color:#343b45 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell tr:nth-child(even) td {background:#242830;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-page {--cg-green:var(--brand-text);--cg-ink:var(--text);--cg-muted:var(--text-muted);--cg-border:var(--border);--cg-pale:var(--surface-2);color:#e8ebef;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-hero,html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-panel,html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-card,html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-callout {background:#20242b !important;border-color:#3c444e !important;color:#e8ebf0;box-shadow:none;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-status {background:#303741;color:#d5dce5;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-tabs a {color:#abb5c0;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-tabs a.active {color:var(--brand-text);border-color:color-mix(in srgb, var(--brand-text) 45%, transparent);background:transparent;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-button {background:#292f39;color:var(--brand-text);border-color:#606772;}
html[data-civa-theme="dark"] body.co-ui-v1 .civa-nav-refresh .cg-button.primary {background:var(--brand);color:var(--on-brand);border-color:var(--brand);}
@media(max-width:1080px){body.co-ui-v1 .co-app-shell .co-module-grid.civa-v2-operations-grid {grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:700px){body.co-ui-v1 .co-app-shell .co-module-grid.civa-v2-operations-grid,body.co-ui-v1 .co-app-shell .civa-v2-recent-grid {grid-template-columns:1fr;}body.co-ui-v1 .civa-nav-refresh .cg-page {padding:16px 12px 50px;}}
/* Consistent internal operation fields, tables, and tabular actions (visual only). */
body.co-ui-v1 .civa-nav-refresh .co-panel input:not([type="checkbox"]):not([type="radio"]),body.co-ui-v1 .civa-nav-refresh .co-panel select,body.co-ui-v1 .civa-nav-refresh .co-panel textarea {border-radius:8px;min-height:40px;font-size:13px;}
body.co-ui-v1 .civa-nav-refresh .co-panel label {line-height:1.45;}
body.co-ui-v1 .civa-nav-refresh .co-panel table {width:100%;border-collapse:collapse;}
body.co-ui-v1 .civa-nav-refresh .co-panel th {font-size:var(--fs-xs);font-weight:700;letter-spacing:.02em;}
body.co-ui-v1 .civa-nav-refresh .co-panel td {font-size:12.5px;}
body.co-ui-v1 .civa-nav-refresh .co-panel a:focus-visible,body.co-ui-v1 .civa-nav-refresh .cg-panel input:focus-visible {outline:2px solid var(--civa-v2-accent);outline-offset:2px;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-user-popover a,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-user-popover button:not(.civa-v2-theme-switch) {color:#e7ebf0 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-user-popover a:hover {background:#303640 !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .co-panel label,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-page label {color:#e1e6ed !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-preview-live-card,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-preview-live-grid>div,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-band-sheet-rules>div {background:#272c34 !important;border-color:#3c444e !important;}
html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-band-sheet td,html[data-civa-theme="dark"] body.co-ui-v1 .co-app-shell .cg-band-sheet th {border-color:#3b434d !important;}
