:root {
    --navy: #302876;
    --navy-2: #443b91;
    --orange: #e8752b;
    --ink: #25233d;
    --muted: #77758b;
    --line: #e7e4f1;
    --canvas: #f7f6fb;
    --white: #fff;
    --shadow: 0 12px 34px rgba(48, 40, 118, .07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--orange); color: white; border: 0; border-radius: 9px; padding: 11px 16px; font: inherit; font-weight: 650; cursor: pointer; transition: .18s ease; }
button:hover, .btn:hover { background: #c85b1c; transform: translateY(-1px); }
input, textarea, select { width: 100%; padding: 11px 13px; border: 1px solid #dedbea; border-radius: 9px; margin: 6px 0 14px; background: white; color: var(--ink); font: inherit; }
input:focus, textarea:focus, select:focus { outline: 3px solid #e8752b22; border-color: var(--orange); }
label { display: block; color: #41405a; font-size: 13px; font-weight: 650; }

.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: linear-gradient(180deg, #29245f, #35306f); color: #e4e2f2; padding: 25px 16px; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 0 19px; background: #fff; border-radius: 12px; color: #302876; font-weight: 750; letter-spacing: .025em; }
.brand img { display: block; width: 206px; height: auto; max-width: 100%; }
.brand .brand-mark-mobile { display: none; }
.nav-label { padding: 12px 12px 7px; color: #c3bdf1; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.side-nav { display: grid; gap: 5px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 9px; color: #d3d0e8; font-size: 14px; }
.side-nav a:hover, .side-nav a.active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-icon { width: 20px; text-align: center; font-size: 17px; color: #c3bdf1; }
.ui-icon { display: block; width: 21px; height: 21px; }
.side-foot { margin-top: auto; padding: 12px 8px 0; }
.profile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 14px 7px 12px; border-top: 1px solid #ffffff20; }
.profile-copy { flex: 1; min-width: 0; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #eeeafd; color: #302876; font-weight: 750; }
.profile-name { font-size: 13px; color: #fff; font-weight: 650; }
.profile-role { font-size: 11px; color: #c3bfdb; text-transform: uppercase; letter-spacing: .08em; }
.profile-name, .profile-role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout button { width: 100%; justify-content: flex-start; background: transparent; color: #d3d0e8; padding: 9px 12px; }
.logout button:hover { background: rgba(255, 255, 255, .09); transform: none; }
.main-area { margin-left: 252px; min-height: 100vh; }
.topbar { height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 4vw, 52px); position: sticky; top: 0; z-index: 3; }
.crumb { font-size: 13px; color: var(--muted); }
.crumb strong { color: var(--ink); }
.top-role { padding: 6px 10px; background: #fff0e4; color: #bf571d; border-radius: 20px; font-size: 11px; font-weight: 750; letter-spacing: .08em; }
.content { max-width: 1440px; margin: 0 auto; padding: 34px clamp(22px, 4vw, 52px) 56px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-actions, .card-actions, .form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-actions { justify-content: flex-end; margin-top: 18px; }
.eyebrow { color: var(--orange); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; margin-bottom: 5px; }
.page-heading h1 { font-size: 28px; line-height: 1.2; margin: 0; color: var(--navy); letter-spacing: -.025em; }
.page-heading p { margin: 7px 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card, article, section, details { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.stat-card { padding: 19px 20px; display: flex; align-items: center; gap: 14px; }
.stat-card .stat-icon { display: grid; flex: 0 0 42px; color: var(--orange); font-size: 20px; }
.stat-card .stat-icon .ui-icon { width: 22px; height: 22px; }
.dashboard-links { margin-top: 28px; }
.dashboard-link-card { display: flex; align-items: center; gap: 14px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.dashboard-link-card > span:nth-child(2) { flex: 1; }
.dashboard-link-card strong, .dashboard-link-card small { display: block; }
.dashboard-link-card strong { color: var(--navy); }
.dashboard-link-card small { color: var(--muted); margin-top: 3px; }
.dashboard-link-card .link-arrow { display: grid; place-items: center; color: var(--orange); }
.dashboard-link-card .link-arrow .ui-icon { width: 21px; height: 21px; }
.dashboard-link-card:hover { border-color: #f0b080; transform: translateY(-1px); }
.table-actions { display: flex; gap: 10px; }
.table-actions a { color: var(--orange); font-weight: 650; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin: 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { color: var(--navy); font-weight: 650; margin: 4px 0 0; }
.delegate-list-panel > .section-head p { margin: 3px 0 0; font-size: 12px; }
.delegate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.delegate-card { padding: 18px; min-width: 0; }
.delegate-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.delegate-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, #fff0e4, #eeeafd); color: var(--navy-2); font-weight: 750; font-size: 17px; }
.delegate-card h3 { margin: 0 0 3px; color: var(--navy); font-size: 17px; overflow-wrap: anywhere; }
.doctor-code { color: var(--muted); font-size: 12px; }
.doctor-code strong { color: var(--orange); margin-left: 3px; letter-spacing: .04em; }
.delegate-info { display: grid; gap: 10px; margin-top: 17px; }
.delegate-info > div { min-width: 0; }
.delegate-info span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.delegate-info strong, .delegate-info a { display: block; color: var(--ink); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.delegate-info a:hover { color: var(--orange); }
.status-confirmed { background: #eeeafd; color: #443b91; }
.status-tentative { background: #fff0e4; color: #bf571d; }
.status-cancelled { background: #f2eeee; color: #8a6262; }
.delegate-edit { margin: 16px -18px -18px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; box-shadow: none; }
.delegate-edit > summary { padding: 13px 18px; font-size: 13px; }
.delegate-edit > form { margin: 0; padding: 0 18px 15px; }
.pagination-wrap { margin-top: 18px; overflow-x: auto; }
.form-modal { width: min(620px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 820px); overflow-y: auto; padding: 0; border: 1px solid #e3e0ee; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 90px rgba(41, 36, 95, .24); }
.form-modal::backdrop { background: rgba(41, 36, 95, .52); backdrop-filter: blur(3px); }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 22px 24px 16px; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--line); }
.modal-head .eyebrow { margin-bottom: 4px; }
.modal-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-close { width: 38px; min-width: 38px; height: 38px; padding: 0; border-radius: 50%; background: #f1eff8; color: #5c5a73; font-size: 23px; line-height: 1; }
.modal-close:hover { color: var(--navy); background: #e5e2f1; }
.form-modal > form { padding: 19px 24px 24px; }
.form-modal .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.delegate-edit-button, .table-edit-button { min-height: 36px; padding: 7px 12px; background: #fff0e4; color: #bf571d; border-radius: 8px; font-size: 12px; }
.delegate-edit-button:hover, .table-edit-button:hover { background: #ffe3d0; }
.add-delegate-panel { padding: 16px 20px; }
.add-delegate-panel .section-head { margin: 0; }
.delegate-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 10px; }
.delegate-card { padding: 12px 14px; border-radius: 12px; }
.delegate-card-top { margin-bottom: 7px; }
.delegate-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
.delegate-card h3 { font-size: 15px; margin-bottom: 1px; }
.doctor-code { font-size: 11px; }
.delegate-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; margin-top: 11px; }
.delegate-info span { font-size: 10px; margin-bottom: 0; }
.delegate-info strong, .delegate-info a { font-size: 12px; line-height: 1.35; }
.delegate-edit { margin: 11px -14px -12px; }
.delegate-edit > summary { padding: 10px 14px; font-size: 12px; }
.delegate-edit > form { padding: 0 14px 12px; }
.stat-icon { width: 42px; height: 42px; border-radius: 12px; background: #fff0e4; color: var(--orange); display: grid; place-items: center; font-size: 20px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; color: var(--navy); font-size: 24px; line-height: 1.25; margin-top: 3px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin: 0 0 15px; }
.section-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 17px; }
.workshop-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.workshop-cover { height: 8px; background: linear-gradient(90deg, #302876, #e8752b); }
.workshop-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.workshop-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 17px; }
.workshop-card p { margin: 0 0 12px; }
.workshop-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; }
.meta-icon { gap: 5px; }
.meta-icon .ui-icon { width: 14px; height: 14px; }
.pill { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 20px; background: #f1eff8; color: #69677c; font-size: 11px; font-weight: 650; }
.pill.active { background: #eeeafd; color: #443b91; }
.pill.inactive { background: #f2eeee; color: #8a6262; }
.workshop-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.workshop-logo { width: 54px; height: 54px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; }
.empty { padding: 36px; text-align: center; color: var(--muted); background: white; border: 1px dashed #d8d5e5; border-radius: 14px; }
.panel { padding: 22px; margin-bottom: 20px; }
.panel h2 { color: var(--navy); font-size: 18px; margin: 0; }
.section-title { color: var(--navy); font-size: 19px; margin: 30px 0 15px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 14px; }
.notice { padding: 13px 16px; background: #fff2e8; border: 1px solid #f4d3bc; color: #9c481d; border-radius: 10px; margin-bottom: 18px; }
.error { background: #fff0ef; border-color: #f5ceca; color: #a53d35; }
.scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
td, th { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eeecf4; white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #77758b; background: #faf9fd; }
tr:last-child td { border-bottom: 0; }
summary { cursor: pointer; font-weight: 650; color: var(--navy); list-style: none; }
summary::-webkit-details-marker { display: none; }
details > summary:after { content: '+'; float: right; color: var(--orange); font-size: 20px; line-height: 1; }
details[open] > summary:after { content: '−'; }
details > summary { padding: 17px 20px; }
details { margin-bottom: 17px; }
details > form, details > .scroll { margin: 0 20px 20px; }
img.logo { width: 76px; height: 76px; object-fit: contain; }
.btn.secondary { background: #eeeafd; color: #302876; }
.btn.secondary:hover { background: #e3e0f5; }
.login-wrap { max-width: 450px; margin: 8vh auto; }
.login-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 34px; box-shadow: var(--shadow); }
.login-brand { display: inline-flex; padding: 4px 0; border-radius: 12px; margin-bottom: 26px; }
.login-brand { display: flex; width: 100%; justify-content: center; align-items: center; }
.login-brand img { display: block; width: 218px; height: auto; max-width: 100%; }
.login-card h1 { color: var(--navy); font-size: 27px; margin: 0; }
.login-card .muted, .muted { color: var(--muted); }
.login-card .muted { margin: 8px 0 24px; }

@media (max-width: 800px) {
    .sidebar { width: 72px; padding: 20px 9px; }
    .brand { justify-content: center; padding: 5px; margin: 0 0 16px; }
    .brand img.brand-logo-full, .brand-copy, .nav-label, .side-nav .nav-text, .profile-copy, .logout-label { display: none; }
    .brand img.brand-mark-mobile { display: block; width: 40px; height: 40px; max-width: none; }
    .side-nav a { justify-content: center; padding: 12px 8px; }
    .nav-icon { font-size: 19px; }
    .profile { justify-content: center; padding: 14px 0; }
    .logout button { justify-content: center; padding: 10px; }
    .main-area { margin-left: 72px; }
    .topbar { height: 62px; padding: 0 18px; }
    .content { padding: 25px 18px 40px; }
    .page-heading h1 { font-size: 24px; }
}
@media (max-width: 520px) {
    .sidebar { width: 58px; padding: 16px 6px; }
    .main-area { margin-left: 58px; }
    .brand { padding-left: 5px; }
    .brand img.brand-mark-mobile { width: 34px; height: 34px; }
    .topbar { padding: 0 13px; }
    .content { padding: 20px 13px 32px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-actions { width: 100%; }
    .page-heading h1 { font-size: 22px; }
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 13px 11px; gap: 9px; }
    .stat-icon { width: 34px; height: 34px; }
    .stat-card strong { font-size: 20px; }
    .grid { grid-template-columns: 1fr; }
    .login-wrap { margin: 5vh auto; }
    .login-card { padding: 25px; }
}

/* Phone-first navigation and touch layout for field users. */
.mobile-brand { display: none; }
@media (max-width: 800px) {
    body { padding-bottom: 0; }
    .sidebar { inset: auto 0 0; width: 100%; height: calc(68px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); flex-direction: row; align-items: stretch; justify-content: center; background: #fff; color: var(--ink); border-top: 1px solid var(--line); box-shadow: 0 -8px 26px rgba(48, 40, 118, .1); }
    .brand, .nav-label { display: none; }
    .side-nav { flex: 1; display: flex; align-items: stretch; justify-content: space-around; gap: 2px; max-width: 520px; }
    .side-nav a { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 8px; color: #667085; font-size: 10px; font-weight: 600; }
    .side-nav a:hover, .side-nav a.active { color: #302876; background: #fff1e7; }
    .side-nav .nav-text { display: block; white-space: nowrap; }
    .nav-icon { display: block; width: auto; font-size: 20px; line-height: 1.15; color: currentColor; }
    .nav-icon .ui-icon { width: 22px; height: 22px; }
    .side-foot { display: flex; flex: 0 0 56px; align-items: center; justify-content: center; margin: 0; padding: 0 0 0 6px; border-left: 1px solid var(--line); }
    .profile { display: none; }
    .logout { width: 100%; height: 100%; }
    .logout button { width: 100%; height: 100%; min-width: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 2px; border-radius: 8px; color: #667085; font-size: 10px; box-shadow: none; }
    .logout button:hover { color: #302876; background: #fff1e7; }
    .logout .nav-icon { font-size: 20px; }
    .logout-label { display: block; white-space: nowrap; }
    .main-area { margin-left: 0; min-height: 100vh; }
    .topbar { height: 64px; padding: 0 22px; }
    .mobile-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); font-size: 15px; }
    .mobile-brand img { width: 30px; height: 30px; }
    .crumb { display: none; }
    .content { padding: 24px 22px calc(92px + env(safe-area-inset-bottom)); }
    input, textarea, select { font-size: 16px; }
    button, .btn { min-height: 44px; }
}
@media (max-width: 520px) {
    .topbar { height: 58px; padding: 0 15px; }
    .content { padding: 20px 15px calc(88px + env(safe-area-inset-bottom)); }
    .page-heading { gap: 12px; margin-bottom: 20px; }
    .page-heading h1 { font-size: 24px; }
    .page-heading p { font-size: 13px; }
    .page-heading > .btn { width: 100%; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; padding: 10px 8px; font-size: 13px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
    .stat-card { min-width: 0; padding: 13px 11px; gap: 8px; border-radius: 12px; }
    .stat-icon { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px; font-size: 17px; }
    .stat-card span { font-size: 10px; }
    .stat-card strong { font-size: 19px; }
    .dashboard-links { grid-template-columns: 1fr; gap: 10px; margin-top: 18px; }
    .dashboard-link-card { padding: 14px; }
    .grid { grid-template-columns: 1fr; gap: 12px; }
    .workshop-body, .panel { padding: 16px; }
    .workshop-actions { align-items: flex-start; flex-direction: column; }
    .card-actions { width: 100%; }
    .card-actions .btn { flex: 1; }
    .fields { grid-template-columns: 1fr; gap: 0; }
    .form-actions { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 2; padding: 10px 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
    .form-actions .btn, .form-actions button { flex: 1; }
    .scroll { -webkit-overflow-scrolling: touch; }
    td, th { padding: 11px 12px; }
    .login-wrap { margin: 3vh auto; }
    .login-card { padding: 23px 19px; }
    .side-nav a { font-size: 9px; }
    .logout button { min-width: 42px; font-size: 9px; }
    .form-modal { width: calc(100vw - 20px); max-height: 88dvh; border-radius: 16px; }
    .modal-head { padding: 17px 17px 13px; gap: 12px; }
    .modal-head h2 { font-size: 18px; }
    .form-modal > form { padding: 15px 17px calc(16px + env(safe-area-inset-bottom)); }
    .form-modal .fields { grid-template-columns: 1fr; gap: 0; }
    .modal-actions { position: sticky; bottom: -16px; padding: 10px 0 0; background: #fff; }
    .modal-actions button { width: 100%; }
}

/* Visual polish */
:root { --indigo-deep: #29245f; --orange-soft: #fff0e4; --surface: #ffffff; --shadow: 0 14px 40px rgba(48, 40, 118, .075); }
body { background: radial-gradient(ellipse at 85% 0%, rgba(232, 117, 43, .08), transparent 34rem), var(--canvas); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #e8752b; outline-offset: 3px; }
.sidebar { background: linear-gradient(165deg, #29245f 0%, #35306f 55%, #29245f 100%); }
.side-nav a { position: relative; transition: color .18s ease, background .18s ease, transform .18s ease; }
.side-nav a.active { background: rgba(255, 255, 255, .09); color: white; }
.side-nav a.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 4px; background: #e8752b; }
.side-nav a:hover { transform: translateX(2px); }
.topbar { background: rgba(255, 255, 255, .88); backdrop-filter: blur(16px); }
.top-role { box-shadow: inset 0 0 0 1px rgba(232, 117, 43, .12); }
.content { animation: content-enter .35s ease-out both; }
@keyframes content-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.dashboard-hero { position: relative; isolation: isolate; overflow: hidden; min-height: 180px; padding: 30px 34px; margin: 0 0 20px; align-items: center; border-radius: 22px; background: linear-gradient(112deg, #29245f 0%, #383276 62%, #a64f39 100%); box-shadow: 0 18px 44px rgba(48, 40, 118, .18); }
.dashboard-hero::after { content: ""; position: absolute; z-index: -1; width: 260px; height: 260px; right: 12%; top: -128px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; box-shadow: 0 0 0 25px rgba(255, 255, 255, .035), 0 0 0 58px rgba(255, 255, 255, .025); }
.dashboard-hero .eyebrow { color: #ffc092; }
.dashboard-hero h1 { color: #fff; font-size: clamp(26px, 3vw, 36px); }
.dashboard-hero p { color: #e6e3f5; }
.hero-orbit { display: grid; place-items: center; width: 88px; height: 88px; margin-right: 9%; border-radius: 26px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); transform: rotate(8deg); box-shadow: 0 12px 25px rgba(32, 25, 78, .18); }
.hero-orbit img { width: 56px; height: 56px; transform: rotate(-8deg); }
.stats { gap: 14px; }
.stat-card { min-height: 98px; border-radius: 16px; box-shadow: 0 8px 24px rgba(48, 40, 118, .045); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
a.stat-card:hover { transform: translateY(-3px); border-color: #e5b99f; box-shadow: 0 15px 32px rgba(48, 40, 118, .1); }
.stat-card .stat-icon { background: linear-gradient(145deg, #fff0e4, #eeeafd); border: 1px solid #eeeafd; border-radius: 14px; }
.dashboard-link-card { border-radius: 16px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.dashboard-link-card:hover { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(48, 40, 118, .1); }
.workshop-card { border-radius: 17px; transition: transform .2s ease, box-shadow .2s ease; }
.workshop-card:hover { transform: translateY(-3px); box-shadow: 0 20px 38px rgba(48, 40, 118, .12); }
.workshop-cover { height: 9px; background: linear-gradient(90deg, #302876 0%, #6b5bb5 52%, #e8752b 100%); }
.workshop-body { padding: 22px; }
.workshop-card h3 { font-size: 18px; }
.pill { border: 1px solid rgba(48, 40, 118, .04); }
.panel, .login-card { border-radius: 18px; }
.panel { box-shadow: 0 10px 30px rgba(48, 40, 118, .05); }
.fields { gap: 10px 16px; }
textarea { min-height: 110px; resize: vertical; }
input, textarea, select { box-shadow: 0 1px 2px rgba(48, 40, 118, .025); }
button, .btn { border-radius: 10px; box-shadow: 0 5px 13px rgba(200, 91, 28, .14); }
.btn.secondary { box-shadow: none; }
.scroll { border-radius: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbf9ff; }
.form-modal { border-radius: 20px; }
.form-modal::backdrop { animation: modal-fade .16s ease-out; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
.login-card { padding: 38px; }
.login-brand { border-radius: 14px; }
.detail-grid > div { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fcfbff; }
details[open] > summary:after { content: '-'; }
@media (max-width: 800px) {
    .dashboard-hero { min-height: 158px; padding: 26px; border-radius: 19px; }
    .hero-orbit { width: 70px; height: 70px; margin-right: 5%; border-radius: 21px; }
    .hero-orbit img { width: 48px; height: 48px; }
    .side-nav a.active::before { display: none; }
    .side-nav a.active { color: #302876; background: #fff1e7; }
    .sidebar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
    .sidebar[data-role="admin"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .side-nav, .side-foot, .logout { display: contents; }
    .side-nav a { width: 100%; min-width: 0; }
    .logout button { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
    .dashboard-hero { min-height: 0; padding: 23px 20px; margin-bottom: 14px; border-radius: 17px; }
    .dashboard-hero h1 { max-width: 75%; font-size: 25px; }
    .dashboard-hero p { max-width: 78%; font-size: 12px; }
    .dashboard-hero .eyebrow { font-size: 9px; letter-spacing: .1em; }
    .hero-orbit { position: absolute; right: -14px; margin: 0; width: 72px; height: 72px; opacity: .8; }
    .hero-orbit img { width: 44px; height: 44px; }
    .stats { gap: 9px; }
    .stat-card { min-height: 82px; }
    .workshop-body { padding: 17px; }
    .login-card { padding: 27px 21px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.delegate-avatar { overflow: hidden; }
.delegate-avatar img { width: 100%; height: 100%; object-fit: cover; }

.delegate-table-photo { display: block; width: 38px; height: 38px; object-fit: cover; border-radius: 10px; }

/* Keep the delegate action clear of the contact details above it. */
.delegate-edit-button { width: 100%; min-height: 40px; margin-top: 16px; padding: 9px 14px; justify-content: center; }
