@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    color-scheme: dark;
    --bg: #080808;
    --surface: #111;
    --surface-raised: #191919;
    --surface-glass: rgba(25, 25, 25, .78);
    --line: rgba(255, 255, 255, .1);
    --line-strong: rgba(255, 255, 255, .19);
    --text: #fff;
    --text-soft: #b7b7b7;
    --muted: #858585;
    --coral: #ff6b00;
    --coral-soft: rgba(255, 107, 0, .14);
    --lime: #ff6b00;
    --lime-soft: rgba(255, 107, 0, .1);
    --green: #fff;
    --danger: #ff9563;
    --font: 'DM Sans', 'Avenir Next', sans-serif;
    --display: 'Manrope', 'Avenir Next', sans-serif;
    --mono: 'DM Mono', monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--text); background: var(--bg); font-family: var(--font); font-size: 14px; letter-spacing: 0; }
body::before { position: fixed; inset: 0; z-index: -1; content: ''; pointer-events: none; background: linear-gradient(125deg, rgba(255, 107, 0, .045), transparent 32%), linear-gradient(315deg, rgba(255, 107, 0, .035), transparent 30%), repeating-linear-gradient(0deg, transparent 0 47px, rgba(255, 255, 255, .017) 48px); }
body.modal-open { overflow: hidden; }
button, input, select, textarea { color: inherit; font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* Shared controls */
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 700; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #171916; background: var(--lime); border-color: var(--lime); }
.button.primary:hover { background: #ff8a32; }
.button.secondary { color: var(--text); background: rgba(255, 255, 255, .055); border-color: var(--line-strong); }
.button.secondary:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); }
.button.ghost { color: var(--text-soft); background: transparent; border-color: var(--line); }
.button.wide { width: 100%; }
.small-button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.icon-button { display: inline-grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 6px; color: var(--text-soft); background: transparent; font-size: 17px; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.icon-button:hover { color: var(--text); background: rgba(255, 255, 255, .08); border-color: var(--line); }
.icon-button.small { width: 27px; height: 27px; font-size: 16px; }
.icon-button.danger-icon:hover { color: var(--danger); background: rgba(255, 107, 0, .1); }
.text-button { padding: 0; border: 0; color: var(--lime); background: none; font-size: 12px; font-weight: 600; }
.text-button:hover { color: var(--text); }
.muted { color: var(--text-soft); line-height: 1.65; }
.eyebrow, .side-label, .stat-label, .detail-label { margin: 0; color: var(--muted); font: 500 10px/1.5 var(--mono); letter-spacing: 0; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--coral); font-size: 12px; }
.notice { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--text-soft); background: rgba(255, 255, 255, .05); line-height: 1.6; }
.notice.success { color: var(--lime); border-color: rgba(255, 107, 0, .25); }
.notice.error { color: var(--danger); border-color: rgba(255, 107, 0, .28); }
.check-label { display: inline-flex; align-items: center; gap: 9px; color: var(--text-soft); font-size: 12px; cursor: pointer; }
.check-label input { width: 15px; height: 15px; margin: 0; accent-color: var(--lime); }

/* Login */
.login-view { display: flex; min-height: 100vh; flex-direction: column; align-items: center; justify-content: center; padding: 46px 22px 26px; animation: appear .45s ease both; }
.login-panel { width: min(100%, 458px); padding: 44px 48px 36px; border: 1px solid var(--line-strong); border-radius: 12px; background: linear-gradient(145deg, rgba(31, 31, 31, .86), rgba(21, 21, 21, .78)); box-shadow: 0 32px 100px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .035); backdrop-filter: blur(22px); }
.login-mark { display: block; width: 108px; height: 139px; margin: -16px auto 5px; object-fit: contain; }
.login-panel .eyebrow { color: var(--coral); }
.login-panel .eyebrow span { padding: 0 5px; color: var(--muted); }
.login-panel h1 { margin: 17px 0 10px; font: 700 34px/1.13 var(--display); }
.login-copy { margin: 0 0 28px; color: var(--text-soft); font-size: 13px; }
.form-stack { display: grid; gap: 17px; }
.form-stack > label, .modal-form > label, .password-form > label { display: grid; gap: 8px; color: var(--text-soft); font-size: 12px; font-weight: 600; }
.form-stack input:not([type="checkbox"]), .modal-form input, .modal-form textarea, .modal-form select, .password-form input { width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; color: var(--text); background: rgba(11, 14, 13, .48); font-size: 13px; transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: #6a6a6a; }
input:focus, textarea:focus, select:focus, [contenteditable="true"]:focus { border-color: rgba(255, 107, 0, .62) !important; box-shadow: 0 0 0 3px rgba(255, 107, 0, .08); outline: none; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 8px; display: grid; width: 31px; height: 31px; place-items: center; transform: translateY(-50%); border: 0; border-radius: 5px; color: var(--muted); background: transparent; }
.password-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.login-options .check-label { font-size: 11px; }
.login-options .text-button { font-size: 11px; }
.login-foot { display: flex; width: min(100%, 458px); justify-content: space-between; margin-top: 20px; color: #5c5c5c; font: 10px var(--mono); }

/* App frame */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; width: 246px; flex-direction: column; padding: 26px 16px 15px; border-right: 1px solid var(--line); background: rgba(18, 18, 18, .84); backdrop-filter: blur(22px); }
.brand-lockup { display: flex; align-items: center; gap: 10px; padding: 0 7px 31px; }
.brand-lockup img { width: 41px; height: 41px; }
.brand-lockup span { display: grid; gap: 2px; }
.brand-lockup strong { font: 700 15px var(--display); }
.brand-lockup small { color: var(--coral); font: 9px var(--mono); }
.side-label { display: block; padding: 0 10px 8px; }
.main-nav, .band-nav { display: grid; gap: 3px; }
.main-nav { margin-bottom: 27px; }
.main-nav button, .settings-link, .band-nav-item { display: flex; min-height: 39px; align-items: center; gap: 11px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; color: #a1a1a1; background: transparent; text-align: left; font-size: 12px; transition: color .15s ease, background .15s ease; }
.main-nav button:hover, .settings-link:hover, .band-nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .045); }
.main-nav button.active, .settings-link.active { color: var(--text); background: rgba(255, 107, 0, .09); border-color: rgba(255, 107, 0, .1); }
.main-nav button.active .nav-icon, .settings-link.active .nav-icon { color: var(--lime); }
.nav-icon { display: inline-grid; width: 18px; place-items: center; color: #8a8a8a; font-size: 16px; }
.bands-nav-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.bands-nav-head .side-label { padding-bottom: 8px; }
.band-nav { overflow: auto; max-height: 37vh; }
.band-nav-item { min-height: 35px; gap: 9px; font-size: 12px; }
.band-nav-item.active { color: var(--text); background: rgba(255, 107, 0, .1); }
.band-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--coral); box-shadow: 0 0 9px rgba(255, 107, 0, .35); }
.band-count { margin-left: auto; color: #757575; font: 10px var(--mono); }
.nav-empty { padding: 2px 10px; color: #666666; font-size: 11px; line-height: 1.6; }
.sidebar-bottom { margin-top: auto; }
.settings-link { width: 100%; margin: 0 0 13px; }
.user-card { display: flex; min-height: 57px; align-items: center; gap: 10px; padding: 9px 5px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 107, 0, .28); border-radius: 50%; color: var(--coral); background: var(--coral-soft); font: 12px var(--mono); }
.user-meta { display: grid; min-width: 0; flex: 1; gap: 3px; }
.user-meta strong { overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.main-content { min-height: 100vh; margin-left: 246px; }
.topbar { position: sticky; z-index: 6; top: 0; display: flex; height: 57px; align-items: center; justify-content: space-between; padding: 0 39px; border-bottom: 1px solid var(--line); background: rgba(16, 16, 16, .76); backdrop-filter: blur(18px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #6b6b6b; font: 10px var(--mono); }
.breadcrumbs b { color: #474747; font-weight: 400; }
.breadcrumbs strong { color: var(--text-soft); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 8px; color: #a4a4a4; font-size: 11px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(255, 107, 0, .46); }
.topbar-date { margin-left: 13px; padding-left: 15px; border-left: 1px solid var(--line); color: var(--muted); font: 10px var(--mono); }
.mobile-menu { display: none; }
.page-content { width: min(100%, 1460px); margin: 0 auto; padding: 37px 40px 60px; animation: rise .32s ease both; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 29px; }
.page-heading .eyebrow { margin-bottom: 9px; color: var(--coral); }
.page-heading h1 { margin: 0; font: 700 31px/1.18 var(--display); }
.page-heading .muted { max-width: 620px; margin: 8px 0 0; font-size: 13px; }
.heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 21px; }
.stat-panel { position: relative; overflow: hidden; min-height: 139px; padding: 20px 21px 17px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, rgba(34, 34, 34, .76), rgba(23, 23, 23, .88)); box-shadow: inset 0 1px rgba(255, 255, 255, .025); backdrop-filter: blur(14px); }
.stat-panel.accent-panel { border-color: rgba(255, 107, 0, .25); background: linear-gradient(135deg, rgba(32, 32, 32, .73), rgba(27, 27, 27, .86)); }
.stat-panel .stat-label { display: block; }
.stat-panel > strong { display: block; margin-top: 13px; font: 700 32px/1 var(--display); }
.stat-foot { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.stat-glyph { position: absolute; right: 19px; bottom: 17px; color: rgba(255, 255, 255, .16); font-size: 35px; }
.accent-panel .stat-glyph { color: rgba(255, 107, 0, .36); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(235px, .9fr); gap: 20px; align-items: start; }
.section-block, .quick-panel, .bands-strip { min-width: 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-title .eyebrow { margin-bottom: 4px; }
.section-title h2, .quick-panel h2, .bands-strip h2 { margin: 0; font: 600 17px var(--display); }
.count-pill { padding: 5px 9px; border: 1px solid var(--line); border-radius: 20px; color: var(--text-soft); font: 10px var(--mono); }
.quick-panel { padding: 20px 0 0 20px; border-left: 1px solid var(--line); }
.quick-panel > .eyebrow { margin-bottom: 7px; color: var(--coral); }
.quick-panel h2 { margin-bottom: 13px; }
.quick-action { display: flex; width: 100%; min-height: 64px; align-items: center; gap: 11px; padding: 9px 2px; border: 0; border-top: 1px solid var(--line); color: var(--text); background: transparent; text-align: left; }
.quick-action:hover strong { color: var(--lime); }
.quick-icon { display: grid; width: 33px; height: 33px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 107, 0, .2); border-radius: 7px; color: var(--coral); background: var(--coral-soft); font-size: 16px; }
.quick-icon.coral { border-color: rgba(255, 107, 0, .2); }
.quick-icon.lime { border-color: rgba(255, 107, 0, .2); color: var(--lime); background: var(--lime-soft); }
.quick-action > span:nth-child(2) { display: grid; flex: 1; gap: 4px; }
.quick-action strong { font-size: 11px; transition: color .15s ease; }
.quick-action small { color: var(--muted); font-size: 10px; }
.quick-action b { color: #6b6b6b; font-weight: 400; }
.bands-strip { margin-top: 30px; padding-top: 19px; border-top: 1px solid var(--line); }
.band-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.band-card { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: rgba(28, 28, 28, .48); text-align: left; transition: border-color .15s ease, background .15s ease; }
.band-card:hover { border-color: rgba(255, 107, 0, .3); background: rgba(34, 34, 34, .75); }
.band-card-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 107, 0, .2); border-radius: 50%; color: var(--lime); background: rgba(255, 107, 0, .08); font: 13px var(--display); }
.band-card > span:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 4px; }
.band-card strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.band-card small { color: var(--muted); font-size: 10px; }
.band-card > b { color: var(--muted); font-weight: 400; }

/* Directories and tables */
.directory-panel { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(25, 25, 25, .64); box-shadow: inset 0 1px rgba(255, 255, 255, .025); backdrop-filter: blur(14px); }
.filter-bar { display: flex; min-height: 66px; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; min-width: 170px; min-height: 37px; flex: 1; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: rgba(10, 13, 12, .27); }
.search-field > span { font-size: 19px; line-height: 1; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: none; color: var(--text); background: transparent; font-size: 11px; }
.filter-bar select, .campaign-toolbar select, .chat-heading-actions select { min-height: 37px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 6px; outline: none; color: var(--text-soft); background-color: #1d1d1d; font-size: 11px; }
.result-count { flex: 0 0 auto; color: var(--muted); font: 10px var(--mono); }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: rgba(12, 15, 14, .23); }
th { height: 38px; padding: 0 14px; color: #7a7a7a; font: 10px var(--mono); white-space: nowrap; }
td { height: 57px; padding: 10px 14px; border-top: 1px solid rgba(255, 255, 255, .055); color: var(--text-soft); font-size: 11px; white-space: nowrap; }
td strong { display: block; color: var(--text); font-size: 12px; font-weight: 600; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
tbody tr { transition: background .13s ease; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
.tag-list { display: flex; gap: 5px; }
.class-tag, .language-tag { padding: 4px 7px; border: 1px solid rgba(255, 107, 0, .19); border-radius: 4px; color: var(--lime); background: rgba(255, 107, 0, .07); font: 10px var(--mono); }
.class-tag.muted-tag { border-color: var(--line); color: var(--text-soft); background: rgba(255, 255, 255, .035); }
.language-tag { border-color: rgba(255, 107, 0, .19); color: #ff9b59; background: rgba(255, 107, 0, .07); }
.contact-count { color: var(--lime); }
.row-actions { display: flex; justify-content: flex-end; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--text-soft); background: rgba(255, 255, 255, .035); font-size: 10px; }
.status-tag i { width: 6px; height: 6px; border-radius: 50%; background: #848484; }
.status-tag.queued { color: #ff9b59; border-color: rgba(255, 155, 89, .18); background: rgba(255, 155, 89, .07); }
.status-tag.queued i { background: #ff9b59; }
.status-tag.sent { color: var(--lime); border-color: rgba(255, 107, 0, .18); background: rgba(255, 107, 0, .06); }
.status-tag.sent i { background: var(--lime); }
.status-tag.replied, .status-tag.interested { color: #f1f1f1; border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); }
.status-tag.replied i, .status-tag.interested i { background: #f1f1f1; }
.status-tag.accepted { color: var(--green); border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .07); }
.status-tag.accepted i { background: var(--green); }
.status-tag.declined { color: #ff9563; }
.status-tag.declined i { background: #ff9563; }
.status-tag.failed { color: var(--danger); border-color: rgba(255, 107, 0, .2); background: rgba(255, 107, 0, .07); }
.status-tag.failed i { background: var(--danger); }
.empty-state { padding: 60px 22px; color: var(--text-soft); text-align: center; font-size: 13px; line-height: 1.7; }
.empty-state.compact { padding: 36px 18px; }
.empty-state p { max-width: 410px; margin: 10px auto; }
.empty-mark { display: block; color: var(--coral); font-size: 24px; }

/* Band roster and booking */
.bands-list { display: grid; border-top: 1px solid var(--line); }
.band-row { display: grid; grid-template-columns: 30px 42px minmax(160px, 1fr) 98px auto 36px 36px; align-items: center; gap: 13px; min-height: 111px; padding: 14px 7px; border-bottom: 1px solid var(--line); }
.band-index { color: #6b6b6b; font: 11px var(--mono); }
.band-row .band-card-mark { width: 40px; height: 40px; }
.band-row-main { min-width: 0; }
.band-row-main h2 { overflow: hidden; margin: 0 0 4px; font: 600 15px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.band-row-main p { overflow: hidden; max-width: 650px; margin: 0; color: var(--text-soft); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.link-row { display: flex; gap: 12px; margin-top: 7px; }
.link-row a { color: var(--lime); font-size: 10px; }
.band-row-count { display: grid; justify-items: center; gap: 3px; }
.band-row-count strong { font: 600 19px var(--display); }
.band-row-count small { color: var(--muted); font-size: 9px; }
.booking-summary { display: flex; min-height: 89px; align-items: center; gap: 36px; margin-bottom: 22px; padding: 13px 19px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(105deg, rgba(36, 36, 36, .72), rgba(23, 23, 23, .56)); }
.booking-summary > div:not(.booking-note) { display: grid; gap: 5px; }
.booking-summary strong { font: 600 19px var(--display); }
.booking-note { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--text-soft); font-size: 11px; }
.booking-note .live-dot { background: var(--lime); }
.booking-table { padding: 18px 15px 0; }
.booking-table .section-title { padding: 0 4px; }
.application-row { cursor: pointer; }

/* Conversation */
.chat-page-content { display: flex; min-height: calc(100vh - 57px); flex-direction: column; padding-top: 20px; padding-bottom: 20px; }
.chat-heading { display: flex; min-height: 39px; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.back-button { display: inline-flex; align-items: center; gap: 9px; padding: 0; border: 0; color: var(--text-soft); background: transparent; font-size: 12px; }
.back-button:hover { color: var(--text); }
.chat-heading-actions { display: flex; align-items: center; gap: 9px; }
.chat-heading-actions select { min-height: 30px; padding: 0 8px; }
.chat-layout { display: grid; min-height: 0; flex: 1; grid-template-columns: 245px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(25, 25, 25, .63); backdrop-filter: blur(15px); }
.chat-details { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 23px 18px; border-right: 1px solid var(--line); background: rgba(16, 16, 16, .35); }
.chat-details .eyebrow { color: var(--coral); }
.chat-details h1 { margin: 0; font: 600 20px/1.25 var(--display); overflow-wrap: anywhere; }
.chat-location { margin: -3px 0 3px; color: var(--text-soft); font-size: 11px; }
.detail-rule { width: 100%; height: 1px; margin: 5px 0; background: var(--line); }
.detail-label { margin-top: 9px; font-size: 9px; }
.recipient-list { display: grid; gap: 5px; overflow-wrap: anywhere; color: var(--text-soft); font-size: 10px; }
.chat-details > strong { overflow-wrap: anywhere; color: var(--text); font-size: 11px; font-weight: 500; }
.danger-text { margin-top: auto; color: var(--danger); }
.conversation { display: flex; min-width: 0; min-height: 560px; flex-direction: column; }
.conversation-top { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.conversation-top .eyebrow { margin-bottom: 4px; color: var(--coral); }
.conversation-top h2 { overflow: hidden; max-width: 500px; margin: 0; font: 600 13px var(--display); text-overflow: ellipsis; white-space: nowrap; }
.message-count { flex: 0 0 auto; color: var(--muted); font: 10px var(--mono); }
.message-stream { display: flex; min-height: 200px; flex: 1; flex-direction: column; gap: 13px; overflow-y: auto; padding: 18px 20px; }
.message { max-width: min(88%, 710px); padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .035); }
.message.outgoing { align-self: flex-end; border-color: rgba(255, 107, 0, .16); background: rgba(255, 107, 0, .055); }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; color: var(--text); font-size: 10px; }
.message-meta time { color: var(--muted); font: 9px var(--mono); }
.message-subject { margin-top: 7px; color: #949494; font-size: 10px; }
.message-body { margin-top: 9px; color: #c6cbc4; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.message-body p { margin: 0 0 9px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body a { color: var(--lime); text-decoration: underline; }
.message-body ul, .message-body ol { padding-left: 18px; }
.thread-empty { display: grid; flex: 1; align-content: center; justify-items: center; color: var(--muted); text-align: center; }
.thread-empty > span { margin-bottom: 11px; color: var(--coral); font-size: 26px; }
.thread-empty strong { color: var(--text-soft); font-size: 12px; }
.thread-empty p { font-size: 11px; }
.reply-composer { margin: 0 14px 14px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(11, 14, 13, .36); }
.editor-toolbar { display: flex; min-height: 36px; align-items: center; gap: 3px; padding: 3px 7px; border-bottom: 1px solid var(--line); }
.editor-toolbar button { display: grid; width: 28px; height: 27px; place-items: center; border: 0; border-radius: 4px; color: var(--text-soft); background: transparent; }
.editor-toolbar button:hover { color: var(--lime); background: rgba(255, 255, 255, .08); }
.editor-toolbar > span:last-child { margin-left: auto; padding: 0 5px; color: var(--muted); font: 9px var(--mono); }
.toolbar-divider { width: 1px; height: 16px; margin: 0 5px; background: var(--line); }
.reply-editor { min-height: 93px; max-height: 220px; overflow: auto; padding: 12px; outline: none; color: var(--text); font-size: 12px; line-height: 1.7; }
.reply-editor:empty::before { content: attr(data-placeholder); color: #6a6a6a; }
.reply-editor a { color: var(--lime); text-decoration: underline; }
.composer-footer { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-top: 1px solid var(--line); }
.composer-footer > span { color: var(--muted); font-size: 10px; }
.composer-footer .button { min-height: 34px; padding: 0 11px; font-size: 11px; }

/* Settings and admin */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 27px; align-items: start; }
.settings-tabs { display: grid; gap: 4px; }
.settings-tabs button { min-height: 39px; padding: 0 11px; border: 1px solid transparent; border-radius: 6px; color: var(--text-soft); background: transparent; text-align: left; font-size: 12px; }
.settings-tabs button.active { border-color: var(--line); color: var(--text); background: rgba(255, 255, 255, .055); }
.settings-section { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: rgba(25, 25, 25, .6); }
.settings-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.settings-section-heading .eyebrow { margin-bottom: 6px; color: var(--coral); }
.settings-section-heading h2 { margin: 0; font: 600 20px var(--display); }
.settings-section-heading .muted { max-width: 600px; margin: 7px 0 0; font-size: 11px; }
.autosave-mark { color: var(--lime); font: 9px var(--mono); white-space: nowrap; }
.template-tabs { display: flex; gap: 3px; width: max-content; margin-bottom: 12px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(10, 13, 12, .32); }
.template-tabs button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 5px; color: var(--text-soft); background: transparent; font-size: 11px; }
.template-tabs button.active { color: var(--text); background: rgba(255, 255, 255, .1); }
.template-label { display: block; margin-bottom: 6px; color: var(--muted); font: 9px var(--mono); }
.template-editor { display: block; width: 100%; min-height: 275px; resize: vertical; padding: 13px; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; color: #d1d5cd; background: rgba(10, 13, 12, .38); font: 12px/1.7 var(--mono); }
.template-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.template-tags > span { margin-right: 4px; color: var(--muted); font: 9px var(--mono); }
.template-tags button { padding: 5px 7px; border: 1px solid rgba(255, 107, 0, .16); border-radius: 4px; color: var(--lime); background: rgba(255, 107, 0, .045); font: 10px var(--mono); }
.template-tags button:hover { background: rgba(255, 107, 0, .12); }
.settings-save-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.settings-save-row .muted { font-size: 10px; }
.password-form { display: grid; max-width: 430px; gap: 16px; }
.password-form label { max-width: 100%; }
.password-form .button { justify-self: start; margin-top: 3px; }

/* Modal, composer tools */
.modal-backdrop { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; overflow: auto; padding: 22px; background: rgba(4, 4, 4, .73); backdrop-filter: blur(9px); animation: fade .16s ease both; }
.modal { width: min(100%, 520px); max-height: min(88vh, 850px); overflow: auto; padding: 22px; border: 1px solid rgba(255, 255, 255, .19); border-radius: 10px; background: linear-gradient(145deg, rgba(31, 31, 31, .98), rgba(20, 20, 20, .985)); box-shadow: 0 35px 100px rgba(0, 0, 0, .62), inset 0 1px rgba(255, 255, 255, .045); animation: modal-in .2s ease both; }
.modal.wide-modal { width: min(100%, 650px); }
.modal.campaign-modal { display: flex; width: min(100%, 780px); max-height: min(90vh, 900px); flex-direction: column; padding-bottom: 0; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.modal-header .eyebrow { margin-bottom: 5px; color: var(--coral); }
.modal-header h2 { margin: 0; font: 600 21px var(--display); }
.modal-form { display: grid; gap: 14px; }
.modal-form > label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.modal-form textarea { min-height: 78px; resize: vertical; }
.modal-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 5px; padding-top: 14px; border-top: 1px solid var(--line); }
.extra-data { padding: 9px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--text-soft); font-size: 11px; }
.extra-data summary { cursor: pointer; }
.extra-data pre { max-height: 180px; overflow: auto; color: #adadad; white-space: pre-wrap; }
.campaign-toolbar { display: flex; gap: 8px; padding-bottom: 12px; }
.campaign-toolbar select { min-width: 130px; }
.campaign-select-row { display: flex; min-height: 35px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.campaign-select-row > span { color: var(--muted); font: 10px var(--mono); }
.campaign-list { min-height: 140px; flex: 1; overflow: auto; overscroll-behavior: contain; }
.campaign-item { display: flex; min-height: 55px; align-items: center; gap: 12px; padding: 7px 9px; border-bottom: 1px solid rgba(255, 255, 255, .06); cursor: pointer; }
.campaign-item:hover { background: rgba(255, 255, 255, .035); }
.campaign-item > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.campaign-check { display: grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255, 255, 255, .24); border-radius: 4px; }
.campaign-item > input:checked + .campaign-check { border-color: var(--lime); color: #141714; background: var(--lime); }
.campaign-item > input:checked + .campaign-check::after { content: '✓'; font-size: 12px; font-weight: 800; }
.campaign-item-main { display: grid; min-width: 0; flex: 1; gap: 4px; }
.campaign-item-main strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-item-main small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.campaign-item-size { color: var(--text-soft); font-size: 10px; }
.campaign-item-email { width: 24px; color: var(--lime); text-align: center; }
.campaign-item-email:empty { color: var(--coral); }
.campaign-footer { display: flex; min-height: 67px; align-items: center; gap: 13px; margin: 0 -22px; padding: 10px 22px; border-top: 1px solid var(--line); background: rgba(13, 16, 15, .45); }
.language-choice { display: grid; gap: 5px; }
.language-choice > span { color: var(--muted); font: 8px var(--mono); }
.ios-switch { display: flex; width: 91px; padding: 3px; border: 1px solid var(--line); border-radius: 20px; background: rgba(9, 12, 11, .62); }
.ios-switch button { min-height: 25px; flex: 1; border: 0; border-radius: 16px; color: var(--muted); background: transparent; font: 10px var(--mono); transition: color .17s ease, background .17s ease; }
.ios-switch button.active { color: #161914; background: var(--lime); }
.campaign-warning { flex: 1; color: var(--muted); font-size: 10px; }
.upload-drop { position: relative; display: grid; min-height: 160px; align-content: center; justify-items: center; gap: 8px; border: 1px dashed rgba(255, 255, 255, .25); border-radius: 7px; background: rgba(255, 255, 255, .025); text-align: center; }
.upload-icon { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid rgba(255, 107, 0, .2); border-radius: 50%; color: var(--lime); font-size: 18px; }
.upload-drop strong { font-size: 12px; }
.upload-drop small { color: var(--muted); font-size: 10px; }
.upload-drop input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.import-form > .muted { margin: 0; font-size: 11px; }
.toast-root { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 8px; }
.toast { max-width: min(390px, calc(100vw - 40px)); padding: 12px 16px; border: 1px solid rgba(255, 107, 0, .24); border-radius: 7px; color: var(--lime); background: rgba(28, 36, 31, .96); box-shadow: 0 12px 35px rgba(0, 0, 0, .38); font-size: 12px; animation: rise .2s ease both; }
.toast.error { border-color: rgba(255, 107, 0, .32); color: var(--danger); }
.toast.warning { border-color: rgba(255, 155, 89, .32); color: #ff9b59; }

/* Setup */
.setup-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.setup-shell { width: min(100%, 490px); padding: 35px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-glass); box-shadow: 0 25px 80px rgba(0, 0, 0, .4); backdrop-filter: blur(20px); }
.brand-mark { width: 55px; height: 55px; }
.setup-shell .eyebrow { margin: 15px 0 6px; color: var(--coral); }
.setup-shell h1 { margin: 0; font: 700 28px var(--display); }
.setup-form { display: grid; gap: 15px; margin-top: 20px; }
.setup-form label { display: grid; gap: 7px; color: var(--text-soft); font-size: 12px; }
.setup-form input { min-height: 42px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 5px; background: rgba(10, 13, 12, .4); }

@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: .5; transform: translateY(7px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 1120px) {
    .page-content { padding-right: 27px; padding-left: 27px; }
    .topbar { padding-right: 27px; padding-left: 27px; }
    .overview-grid { grid-template-columns: minmax(0, 1.55fr) minmax(210px, .8fr); gap: 15px; }
    .quick-panel { padding-left: 14px; }
    .band-row { grid-template-columns: 24px 40px minmax(140px, 1fr) 76px auto 32px 32px; gap: 9px; }
    .chat-layout { grid-template-columns: 210px minmax(0, 1fr); }
}

@media (max-width: 850px) {
    .sidebar { width: 215px; }
    .main-content { margin-left: 215px; }
    .page-content { padding: 30px 21px 48px; }
    .topbar { padding: 0 21px; }
    .overview-grid { grid-template-columns: 1fr; }
    .quick-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; padding: 17px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .quick-panel > .eyebrow, .quick-panel h2 { grid-column: 1 / -1; }
    .quick-action { align-items: flex-start; }
    .quick-action > b { display: none; }
    .band-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .band-row { grid-template-columns: 20px 38px minmax(0, 1fr) auto 32px 32px; }
    .band-row-count { display: none; }
    .chat-layout { grid-template-columns: 190px minmax(0, 1fr); }
    .chat-details { padding: 19px 13px; }
}

@media (max-width: 640px) {
    .login-view { justify-content: center; padding: 25px 16px 20px; }
    .login-panel { padding: 31px 25px 25px; }
    .login-panel h1 { font-size: 30px; }
    .login-foot { font-size: 9px; }
    .sidebar { z-index: 20; width: 255px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 16px 0 45px rgba(0, 0, 0, .28); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .topbar { height: 53px; justify-content: flex-start; gap: 10px; padding: 0 13px; }
    .mobile-menu { display: inline-grid; width: 31px; height: 31px; }
    .topbar-right { gap: 6px; margin-left: auto; font-size: 10px; }
    .topbar-date { display: none; }
    .breadcrumbs { gap: 6px; font-size: 9px; }
    .page-content { padding: 24px 14px 36px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 22px; }
    .page-heading h1 { font-size: 26px; overflow-wrap: anywhere; }
    .page-heading .muted { margin-top: 7px; font-size: 12px; }
    .heading-actions { width: 100%; flex-wrap: wrap; }
    .heading-actions .button { min-height: 38px; flex: 1; padding: 0 10px; font-size: 11px; }
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .stat-panel { min-height: 107px; padding: 12px 9px; }
    .stat-panel .stat-label { min-height: 25px; font-size: 8px; line-height: 1.3; }
    .stat-panel > strong { margin-top: 8px; font-size: 25px; }
    .stat-foot { margin-top: 6px; font-size: 9px; }
    .stat-glyph { right: 9px; bottom: 8px; font-size: 24px; }
    .section-title h2, .quick-panel h2, .bands-strip h2 { font-size: 15px; }
    .quick-panel { grid-template-columns: 1fr; }
    .quick-action { min-height: 56px; }
    .band-cards { grid-template-columns: 1fr; }
    .filter-bar { flex-wrap: wrap; padding: 10px; }
    .search-field { flex-basis: 100%; }
    .filter-bar select { min-width: 0; flex: 1; }
    .result-count { margin-left: auto; }
    th { padding: 0 10px; font-size: 9px; }
    td { padding: 9px 10px; font-size: 10px; }
    .directory-panel { border-radius: 6px; }
    .band-row { position: relative; grid-template-columns: 23px 36px minmax(0, 1fr) 32px; gap: 8px; padding: 13px 0; }
    .band-row .band-card-mark { width: 35px; height: 35px; }
    .band-row-main p { max-width: 100%; }
    .band-row > .small-button { grid-column: 3; grid-row: 2; justify-self: start; min-height: 31px; margin-top: 2px; }
    .band-row > .icon-button:nth-last-child(2) { grid-column: 4; grid-row: 1; }
    .band-row > .icon-button:last-child { position: absolute; right: 0; bottom: 8px; }
    .booking-summary { min-height: 74px; gap: 17px; padding: 11px; }
    .booking-summary .stat-label { font-size: 8px; }
    .booking-summary strong { font-size: 17px; }
    .booking-note { max-width: 105px; align-items: flex-start; font-size: 9px; line-height: 1.5; }
    .booking-table { padding: 13px 8px 0; }
    .booking-table .section-title { padding: 0 3px; }
    .chat-page-content { min-height: calc(100vh - 53px); padding: 13px 9px; }
    .chat-heading { align-items: flex-start; }
    .back-button { max-width: 52%; align-items: flex-start; font-size: 10px; }
    .back-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .chat-heading-actions { gap: 5px; }
    .chat-heading-actions .status-tag { display: none; }
    .chat-heading-actions select { max-width: 135px; font-size: 10px; }
    .chat-layout { display: flex; min-height: 0; flex-direction: column; overflow: visible; }
    .chat-details { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px; padding: 13px; border-right: 0; border-bottom: 1px solid var(--line); }
    .chat-details .eyebrow, .chat-details h1, .chat-location, .detail-rule, .recipient-list { grid-column: 1 / -1; }
    .chat-details h1 { font-size: 17px; }
    .chat-details .detail-label { margin-top: 5px; font-size: 8px; }
    .chat-details > strong { font-size: 10px; }
    .chat-details .danger-text { grid-column: 2; justify-self: end; margin-top: 6px; }
    .conversation { min-height: 480px; }
    .conversation-top { min-height: 57px; padding: 10px 12px; }
    .conversation-top h2 { max-width: 240px; font-size: 11px; }
    .message-stream { padding: 12px 10px; }
    .message { max-width: 96%; padding: 10px; }
    .message-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
    .reply-composer { margin: 0 7px 7px; }
    .composer-footer { align-items: flex-start; }
    .composer-footer > span { max-width: 48%; line-height: 1.4; }
    .settings-layout { grid-template-columns: 1fr; gap: 12px; }
    .settings-tabs { grid-template-columns: repeat(2, 1fr); }
    .settings-tabs button { padding: 0 7px; font-size: 11px; }
    .settings-section { padding: 15px 12px; }
    .settings-section-heading { flex-direction: column; }
    .settings-section-heading h2 { font-size: 18px; }
    .template-editor { min-height: 220px; font-size: 11px; }
    .template-tags > span { width: 100%; }
    .settings-save-row { align-items: flex-start; flex-direction: column; }
    .settings-save-row .button { width: 100%; }
    .modal-backdrop { align-items: end; padding: 0; }
    .modal, .modal.wide-modal, .modal.campaign-modal { width: 100%; max-height: 92vh; padding: 19px 15px; border-right: 0; border-bottom: 0; border-left: 0; border-radius: 13px 13px 0 0; }
    .modal.campaign-modal { padding-bottom: 0; }
    .modal-form .form-grid { grid-template-columns: 1fr; }
    .campaign-toolbar { flex-wrap: wrap; }
    .campaign-toolbar .search-field { flex-basis: 100%; }
    .campaign-toolbar select { min-width: 0; flex: 1; }
    .campaign-item { gap: 8px; }
    .campaign-item-size { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .campaign-footer { flex-wrap: wrap; margin-right: -15px; margin-left: -15px; padding: 10px 15px; }
    .campaign-warning { order: 2; flex-basis: 100%; }
    .campaign-footer > .button { flex: 1; }
    .toast-root { right: 10px; bottom: 10px; left: 10px; }
    .toast { max-width: none; }
    .setup-shell { padding: 27px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}