:root {
  --ink: #17231f; --forest: #183229; --forest-2: #214438; --orange: #e57b45;
  --orange-soft: #fff0e7; --paper: #f5f4ef; --card: #fff; --line: #e5e4de;
  --muted: #727a76; --green: #43876e; --red: #c75b4c; --yellow: #bd832e;
  --shadow: 0 18px 50px rgba(24, 50, 41, .1); --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.brand-lockup { display: flex; align-items: center; gap: 12px; color: white; }
.brand-lockup b { display: block; font-size: 14px; letter-spacing: .16em; }
.brand-lockup small { display: block; margin-top: 3px; opacity: .55; font-size: 8px; letter-spacing: .16em; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.45); color: white; font-family: Georgia, serif; font-size: 22px; font-style: italic; }
.brand-lockup--large .brand-mark { width: 47px; height: 47px; font-size: 28px; }
.brand-lockup--large b { font-size: 18px; }
.brand-lockup--large small { font-size: 9px; }

/* login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(440px, 1.12fr) minmax(440px, .88fr); }
.login-brand { position: relative; min-height: 640px; overflow: hidden; padding: 60px 8vw; display: flex; flex-direction: column; justify-content: space-between; color: white; background: var(--forest); }
.login-brand::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 18%, rgba(229,123,69,.16), transparent 30%), linear-gradient(135deg, transparent 60%, rgba(255,255,255,.025)); }
.login-claim { position: relative; z-index: 1; max-width: 650px; margin: auto 0; }
.login-claim h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(48px, 5.5vw, 82px); font-weight: 400; line-height: .98; letter-spacing: -.04em; }
.login-claim h1 em { color: var(--orange); font-weight: 400; }
.login-claim > p:last-child { max-width: 470px; margin: 30px 0 0; color: rgba(255,255,255,.65); font-size: 16px; line-height: 1.7; }
.login-pattern { position: absolute; right: -100px; bottom: -130px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.08); transform: rotate(45deg); }
.login-pattern::before, .login-pattern::after { content: ""; position: absolute; inset: 70px; border: 1px solid rgba(255,255,255,.06); }
.login-pattern::after { inset: 150px; background: rgba(229,123,69,.06); }
.login-panel { display: grid; place-items: center; padding: 50px; background: #faf9f6; }
.login-card { width: min(390px, 100%); }
.login-card h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 44px; font-weight: 400; }
.login-card > .muted { margin-bottom: 38px; font-size: 14px; }
.login-card label { display: block; margin: 20px 0 7px; font-size: 12px; font-weight: 750; }
.login-card input, .form-grid input, .form-grid select, .form-grid textarea { width: 100%; margin-top: 8px; padding: 13px 14px; border: 1px solid #d8d8d2; border-radius: 8px; outline: none; color: var(--ink); background: white; transition: .2s; }
.login-card input:focus, .form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(229,123,69,.12); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 44px; }
.password-wrap button { position: absolute; right: 10px; bottom: 8px; border: 0; padding: 7px; color: var(--muted); background: transparent; }
.btn { border: 0; border-radius: 8px; padding: 12px 17px; font-size: 13px; font-weight: 750; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--orange); box-shadow: 0 8px 18px rgba(229,123,69,.22); }
.btn-primary:hover { background: #d96c36; }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: white; }
.btn-full { width: 100%; margin-top: 12px; display: flex; justify-content: space-between; }
.secure-note { margin-top: 22px; color: #89908d; font-size: 10px; letter-spacing: .06em; text-align: center; }
.secure-note::first-letter { color: var(--green); }
.form-error { min-height: 17px; margin: 9px 0; color: var(--red); font-size: 12px; }
.mobile-brand { display: none; }

/* application shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 27px 18px 20px; color: white; background: var(--forest); z-index: 20; }
.sidebar .brand-lockup { padding: 0 10px 34px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar nav { padding-top: 22px; }
.nav-label { margin: 27px 12px 9px; color: rgba(255,255,255,.32); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.nav-link { position: relative; width: 100%; display: flex; align-items: center; gap: 13px; margin: 4px 0; padding: 12px 14px; border: 0; border-radius: 8px; color: rgba(255,255,255,.66); background: transparent; font-size: 13px; text-align: left; }
.nav-link:hover { color: white; background: rgba(255,255,255,.05); }
.nav-link.active { color: white; background: var(--forest-2); }
.nav-link.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 25px; background: var(--orange); }
.nav-icon { width: 19px; color: var(--orange); font-size: 20px; text-align: center; }
.nav-badge { margin-left: auto; min-width: 21px; padding: 3px 6px; border-radius: 20px; color: white; background: var(--orange); font-size: 9px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 6px 0; border-top: 1px solid rgba(255,255,255,.08); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.sidebar-footer .avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--forest); background: #d8c5ae; font-size: 10px; font-weight: 800; }
.sidebar-footer b, .sidebar-footer small { display: block; }
.sidebar-footer b { font-size: 11px; }.sidebar-footer small { margin-top: 3px; color: rgba(255,255,255,.4); font-size: 9px; }
.sidebar-footer button { border: 0; color: rgba(255,255,255,.5); background: transparent; font-size: 19px; }
main { min-width: 0; }
.topbar { height: 76px; padding: 0 clamp(22px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(250,249,246,.9); }
.breadcrumb { margin: 0; color: #9a9f9c; font-size: 9px; font-weight: 800; letter-spacing: .13em; }.breadcrumb span { margin: 0 7px; }.breadcrumb strong { color: var(--orange); }
.top-actions { display: flex; align-items: center; gap: 17px; }.today { color: var(--muted); font-size: 11px; }
.icon-btn { position: relative; min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; font-size: 17px; }
.notification-dot { position: absolute; top: 7px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--orange); }
.content { max-width: 1500px; margin: 0 auto; padding: 40px clamp(22px, 4vw, 58px) 70px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 31px; }
.page-head h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 4vw, 48px); font-weight: 400; letter-spacing: -.03em; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

/* dashboard */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.metric-card { position: relative; min-height: 142px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.metric-card::after { content: ""; position: absolute; right: -31px; bottom: -48px; width: 100px; height: 100px; border: 1px solid var(--line); transform: rotate(45deg); }
.metric-label { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.metric-icon { color: var(--orange); font-size: 18px; }
.metric-value { display: block; margin-top: 17px; font-family: Georgia, serif; font-size: 35px; font-weight: 400; }
.metric-foot { margin-top: 8px; color: var(--muted); font-size: 10px; }.metric-foot strong { color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.panel-header { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 400; }.panel-header button { border: 0; color: var(--orange); background: transparent; font-size: 11px; font-weight: 750; }
.ticket-list { padding: 4px 20px; }
.ticket-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; padding: 15px 2px; border-bottom: 1px solid #eeeeea; }
.ticket-row-button { width: 100%; border-top: 0; border-right: 0; border-left: 0; color: var(--ink); background: transparent; text-align: left; }.ticket-row-button:hover b { color: var(--orange); }
.ticket-row:last-child { border-bottom: 0; }
.priority-stripe { width: 3px; height: 38px; border-radius: 3px; background: var(--yellow); }.priority-stripe.high { background: var(--red); }.priority-stripe.low { background: var(--green); }
.ticket-row b { display: block; margin-bottom: 4px; font-size: 12px; }.ticket-row small { color: var(--muted); font-size: 10px; }
.occupancy-wrap { padding: 25px; }
.donut { --percent: 0; position: relative; width: 156px; height: 156px; margin: 5px auto 25px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--orange) calc(var(--percent) * 1%), #ebeae5 0); }
.donut::after { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: white; }
.donut span { position: relative; z-index: 1; font-family: Georgia, serif; font-size: 30px; }.donut small { display: block; font-family: Inter, sans-serif; color: var(--muted); font-size: 9px; text-align: center; }
.occupancy-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.occupancy-stats div { padding: 12px; border-radius: 9px; background: var(--paper); }.occupancy-stats small, .occupancy-stats b { display: block; }.occupancy-stats small { color: var(--muted); font-size: 9px; }.occupancy-stats b { margin-top: 5px; font-size: 16px; }

/* data views */
.toolbar { margin-bottom: 15px; display: flex; justify-content: space-between; gap: 12px; }
.search { position: relative; width: min(360px, 100%); }.search input { width: 100%; padding: 11px 13px 11px 38px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; }.search::before { content: "⌕"; position: absolute; top: 8px; left: 13px; color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 13px 18px; color: #8a908d; background: #fbfbf8; font-size: 9px; letter-spacing: .1em; text-align: left; }
td { padding: 16px 18px; border-top: 1px solid #eeeeea; font-size: 12px; vertical-align: middle; }
.primary-cell { display: flex; align-items: center; gap: 11px; }.cell-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--orange); background: var(--orange-soft); font-family: Georgia, serif; font-weight: 700; }.primary-cell b, .primary-cell small { display: block; }.primary-cell small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 20px; color: var(--green); background: #ebf5f0; font-size: 9px; font-weight: 750; }.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }.status.open { color: var(--yellow); background: #fff5e5; }.status.progress { color: #4a78aa; background: #edf4fa; }.status.done { color: var(--green); }.status.high { color: var(--red); background: #fff0ed; }.status.low { color: var(--green); }
.status.inactive { color: var(--muted); background: #eeeeea; }
.actions { display: flex; justify-content: flex-end; gap: 5px; }.actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: white; }.actions button:hover { color: var(--orange); border-color: var(--orange); }
.empty { padding: 60px 20px; color: var(--muted); text-align: center; }.empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-family: Georgia, serif; font-size: 21px; }

/* user administration */
.admin-note { margin-bottom: 16px; padding: 15px 18px; display: flex; gap: 12px; border: 1px solid #eadfce; border-radius: 10px; color: #5f5b53; background: #fffaf1; font-size: 11px; line-height: 1.5; }.admin-note b { color: var(--ink); white-space: nowrap; }
.permission-fieldset { margin: 5px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }.permission-fieldset legend { padding: 0 7px; color: var(--ink); font-size: 12px; font-weight: 750; }.permission-fieldset > p { margin: 0 0 15px; font-size: 11px; }
.permission-grid { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(4, minmax(64px, .6fr)); align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }.permission-grid > * { min-height: 43px; padding: 10px; display: flex; align-items: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }.permission-grid > *:nth-child(5n) { border-right: 0; }.permission-grid > *:nth-last-child(-n+5) { border-bottom: 0; }
.permission-head { color: var(--muted); background: #f5f4ef; font-size: 8px; font-weight: 800; letter-spacing: .06em; justify-content: center; }.permission-head:first-child { justify-content: flex-start; }
.permission-name { font-size: 11px; font-weight: 750; }.permission-check { justify-content: center; cursor: pointer; }.permission-check input { position: absolute; opacity: 0; pointer-events: none; }.permission-check span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #d2d3ce; border-radius: 5px; color: transparent; background: white; }.permission-check input:checked + span { border-color: var(--orange); color: white; background: var(--orange); }.permission-check.disabled { cursor: default; background: #f8f8f5; }.permission-check.disabled span { opacity: .35; }
.toggle-row { margin-top: 3px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }.toggle-row input { width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--orange); }.toggle-row b, .toggle-row small { display: block; }.toggle-row small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.form-grid .full { grid-column: 1 / -1; }
.property-assignment { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; }
.property-assignment legend { padding: 0 6px; color: #4c5551; font-size: 11px; font-weight: 750; }
.property-assignment > p { margin: 0 0 12px; color: var(--muted); font-size: 10px; font-weight: 400; }
.property-checklist { max-height: 230px; overflow: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-grid .property-option { min-width: 0; padding: 11px 12px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--card); cursor: pointer; }
.form-grid .property-option:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }
.form-grid .property-option input { width: 16px; height: 16px; margin: 1px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--orange); box-shadow: none; }
.property-option span { min-width: 0; }.property-option b, .property-option small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.property-option b { font-size: 11px; }.property-option small { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }
.property-empty { padding: 12px; color: var(--muted); font-size: 11px; }

/* ticket filters and detail view */
.ticket-filter-tools { display: flex; align-items: center; gap: 12px; }
.ticket-closed-toggle { min-height: 39px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--card); font-size: 10px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.ticket-closed-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--orange); }
.ticket-title-button { max-width: 390px; overflow: hidden; padding: 0; display: block; border: 0; color: var(--ink); background: transparent; font-size: 12px; font-weight: 750; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.ticket-title-button:hover { color: var(--orange); }
.ticket-detail-card { width: min(900px, 100%); }
.ticket-detail-content { padding: 24px 27px 30px; }
.ticket-detail-actions { min-height: 0; display: flex; justify-content: flex-end; }
.ticket-detail-actions:has(.btn) { margin-bottom: 17px; }
.ticket-meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ticket-meta-grid > div { min-width: 0; min-height: 75px; padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); }
.ticket-meta-grid > div:nth-child(3n) { border-right: 0; }.ticket-meta-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
.ticket-meta-grid small, .ticket-meta-grid b { display: block; }.ticket-meta-grid small { margin-bottom: 9px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; }.ticket-meta-grid b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-description { margin-top: 18px; padding: 19px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ticket-description h3, .ticket-section-head h3 { margin: 0; font-family: Georgia, serif; font-size: 20px; font-weight: 400; }.ticket-description p { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.ticket-activity { margin-top: 25px; }
.ticket-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }.ticket-section-head .eyebrow { margin-bottom: 6px; }.ticket-section-head > span { color: var(--muted); font-size: 10px; }
.comment-timeline { padding: 4px 0 2px; }
.comment-entry { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.comment-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--orange); background: var(--orange-soft); font-size: 9px; font-weight: 800; }
.comment-entry header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.comment-entry header b { font-size: 11px; }.comment-entry time { color: var(--muted); font-size: 9px; }.comment-entry p { margin: 7px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.comment-empty { padding: 28px 12px; color: var(--muted); font-size: 11px; text-align: center; }
.ticket-comment-form { margin-top: 17px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ticket-comment-form > label { display: block; color: var(--ink); font-size: 11px; font-weight: 750; }.ticket-comment-form textarea { width: 100%; min-height: 105px; margin-top: 9px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; outline: none; color: var(--ink); background: var(--card); resize: vertical; }.ticket-comment-form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 14%, transparent); }
.ticket-comment-form > div { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }.ticket-comment-form .muted { font-size: 9px; line-height: 1.4; }

/* personal settings */
.settings-card { max-width: 980px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.settings-intro { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.settings-intro h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 400; }
.settings-intro p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.settings-current { padding: 6px 9px; border-radius: 20px; color: var(--orange); background: var(--orange-soft); font-size: 9px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.theme-choice { position: relative; min-width: 0; padding: 13px; display: grid; grid-template-columns: 128px 1fr auto; align-items: center; gap: 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--card); text-align: left; transition: border-color .2s, transform .2s, box-shadow .2s; }
.theme-choice:hover { transform: translateY(-2px); border-color: var(--orange); }
.theme-choice.selected { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 18%, transparent); }
.theme-copy b, .theme-copy small { display: block; }.theme-copy b { font-size: 13px; }.theme-copy small { margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.theme-check { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: transparent; font-size: 11px; }
.theme-choice.selected .theme-check { border-color: var(--orange); color: white; background: var(--orange); }
.theme-preview { height: 78px; overflow: hidden; display: grid; grid-template-columns: 25% 1fr 1fr; grid-template-rows: 22px 1fr; gap: 6px; padding: 8px; border: 1px solid rgba(127,127,127,.25); border-radius: 8px; }
.theme-preview i { display: block; border-radius: 3px; background: currentColor; opacity: .9; }.theme-preview i:first-child { grid-row: 1 / 3; }.theme-preview i:nth-child(2) { grid-column: 2 / 4; opacity: .35; }.theme-preview i:nth-child(3), .theme-preview i:nth-child(4) { opacity: .65; }
.theme-preview--classic { color: #e57b45; background: #f5f4ef; }.theme-preview--classic i:first-child { background: #183229; }
.theme-preview--dark { color: #6ec7a2; background: #101614; }.theme-preview--dark i:first-child { background: #080d0b; }
.theme-preview--galaxy { color: #b894ff; background: radial-gradient(circle at 75% 20%, #283274, #0a0c20 62%); }.theme-preview--galaxy i:first-child { background: #121535; }
.theme-preview--white { color: #2c5ea8; background: #fff; border-radius: 2px; }.theme-preview--white i { border-radius: 0; }.theme-preview--white i:first-child { background: #f0f1f3; }

/* modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; z-index: 50; }.modal-backdrop { position: absolute; inset: 0; background: rgba(10,22,18,.68); backdrop-filter: blur(4px); }.modal-card { position: relative; width: min(680px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 16px; background: #faf9f6; box-shadow: 0 30px 80px rgba(0,0,0,.3); }.modal-card > header { padding: 24px 27px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }.modal-card h2 { margin: 0; font-family: Georgia, serif; font-size: 28px; font-weight: 400; }.modal-card form { padding: 23px 27px 25px; }.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.form-grid label { color: #4c5551; font-size: 11px; font-weight: 750; }.form-grid label.full { grid-column: 1 / -1; }.form-grid textarea { min-height: 90px; resize: vertical; }.modal-card footer { margin-top: 20px; padding-top: 18px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 25px; bottom: 25px; padding: 13px 18px; border-radius: 8px; color: white; background: var(--forest); box-shadow: var(--shadow); font-size: 12px; transform: translateY(100px); opacity: 0; transition: .3s; z-index: 80; }.toast.show { transform: none; opacity: 1; }
.mobile-only { display: none; }

@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(2, 1fr); }.dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .login-shell { display: block; }.login-brand { display: none; }.login-panel { min-height: 100vh; padding: 30px; }.mobile-brand { display: grid; margin-bottom: 38px; color: var(--forest); border-color: var(--forest); }
  .app-shell { display: block; }.sidebar { position: fixed; left: 0; transform: translateX(-100%); width: 250px; transition: transform .25s; box-shadow: 15px 0 50px rgba(0,0,0,.2); }.sidebar.open { transform: none; }
  .mobile-only { display: inline-grid; place-items: center; }.topbar { padding: 0 18px; }.today { display: none; }.content { padding: 28px 18px 50px; }.page-head { align-items: flex-start; }.page-head p { max-width: 270px; }.metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { min-height: 125px; padding: 17px; }.metric-value { font-size: 29px; }.form-grid { grid-template-columns: 1fr; }.form-grid label.full { grid-column: auto; }
  .permission-fieldset.full { grid-column: auto; overflow: auto; }.permission-grid { min-width: 540px; }.admin-note { display: block; }.admin-note b { display: block; margin-bottom: 4px; }
  .form-grid .full { grid-column: auto; }.property-checklist { grid-template-columns: 1fr; }
  .ticket-filter-tools { width: 100%; align-items: stretch; flex-direction: column; }.ticket-closed-toggle { justify-content: center; }.ticket-meta-grid { grid-template-columns: 1fr 1fr; }.ticket-meta-grid > div:nth-child(3n) { border-right: 1px solid var(--line); }.ticket-meta-grid > div:nth-child(2n) { border-right: 0; }.ticket-meta-grid > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }.ticket-meta-grid > div:nth-last-child(-n+2) { border-bottom: 0; }.ticket-detail-content { padding: 19px; }
  .theme-grid { grid-template-columns: 1fr; }.theme-choice { grid-template-columns: 112px 1fr auto; }
}
@media (max-width: 480px) { .metric-grid { grid-template-columns: 1fr; }.page-head { display: block; }.page-head .btn { margin-top: 18px; }.toolbar { display: block; }.toolbar .btn { width: 100%; margin-top: 10px; }.login-panel { padding: 25px; }.ticket-meta-grid { grid-template-columns: 1fr; }.ticket-meta-grid > div, .ticket-meta-grid > div:nth-child(2n), .ticket-meta-grid > div:nth-child(3n), .ticket-meta-grid > div:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }.ticket-meta-grid > div:last-child { border-bottom: 0; }.ticket-comment-form > div { align-items: stretch; flex-direction: column; }.ticket-comment-form .btn { width: 100%; } }

/* dark and galaxy surfaces */
body[data-theme="dark"] {
  --ink: #e8eeeb; --forest: #0a110f; --forest-2: #17231f; --orange: #65b794;
  --orange-soft: #173126; --paper: #101613; --card: #18201d; --line: #2c3934;
  --muted: #9aa9a3; --green: #69c49e; --red: #ef8878; --yellow: #e0aa59;
  --shadow: 0 18px 50px rgba(0,0,0,.3);
}
body[data-theme="galaxy"] {
  --ink: #f0edff; --forest: #0c0e26; --forest-2: #1b2050; --orange: #ae86ff;
  --orange-soft: #292151; --paper: #090b1a; --card: #14172f; --line: #30355d;
  --muted: #aaa9c5; --green: #63dcc5; --red: #ff7f9e; --yellow: #f5c66f;
  --shadow: 0 18px 60px rgba(0,0,0,.38);
  background-color: var(--paper);
  background-image: radial-gradient(circle at 12% 18%, rgba(112,93,255,.18), transparent 28%), radial-gradient(circle at 88% 74%, rgba(50,205,226,.11), transparent 30%), radial-gradient(circle, rgba(255,255,255,.48) 0 1px, transparent 1.5px);
  background-size: auto, auto, 74px 74px;
}
body[data-theme="dark"] .login-panel,
body[data-theme="galaxy"] .login-panel,
body[data-theme="dark"] .topbar,
body[data-theme="galaxy"] .topbar,
body[data-theme="dark"] .modal-card,
body[data-theme="galaxy"] .modal-card { background: color-mix(in srgb, var(--paper) 94%, transparent); }
body[data-theme="dark"] .login-card input,
body[data-theme="galaxy"] .login-card input,
body[data-theme="dark"] .form-grid input,
body[data-theme="galaxy"] .form-grid input,
body[data-theme="dark"] .form-grid select,
body[data-theme="galaxy"] .form-grid select,
body[data-theme="dark"] .form-grid textarea,
body[data-theme="galaxy"] .form-grid textarea,
body[data-theme="dark"] .btn-ghost,
body[data-theme="galaxy"] .btn-ghost,
body[data-theme="dark"] .icon-btn,
body[data-theme="galaxy"] .icon-btn,
body[data-theme="dark"] .search input,
body[data-theme="galaxy"] .search input,
body[data-theme="dark"] .table-wrap,
body[data-theme="galaxy"] .table-wrap,
body[data-theme="dark"] .toggle-row,
body[data-theme="galaxy"] .toggle-row { color: var(--ink); background: var(--card); }
body[data-theme="dark"] th,
body[data-theme="galaxy"] th,
body[data-theme="dark"] .permission-head,
body[data-theme="galaxy"] .permission-head,
body[data-theme="dark"] .permission-check.disabled,
body[data-theme="galaxy"] .permission-check.disabled { color: var(--muted); background: color-mix(in srgb, var(--card) 82%, var(--paper)); }
body[data-theme="dark"] .donut::after,
body[data-theme="galaxy"] .donut::after { background: var(--card); }
body[data-theme="dark"] .actions button,
body[data-theme="galaxy"] .actions button,
body[data-theme="dark"] .permission-check span,
body[data-theme="galaxy"] .permission-check span { color: var(--muted); background: var(--card); }
body[data-theme="dark"] .property-assignment legend,
body[data-theme="galaxy"] .property-assignment legend { color: var(--ink); }
body[data-theme="dark"] .panel { background: var(--card); }
body[data-theme="dark"] .ticket-row,
body[data-theme="galaxy"] .ticket-row { border-bottom-color: var(--line); }
body[data-theme="dark"] .permission-check input:checked + span,
body[data-theme="galaxy"] .permission-check input:checked + span { color: white; background: var(--orange); }
body[data-theme="galaxy"] .sidebar, body[data-theme="galaxy"] .login-brand { background: radial-gradient(circle at 15% 15%, #272d6a, #0c0e26 62%); }
body[data-theme="galaxy"] .metric-card, body[data-theme="galaxy"] .panel, body[data-theme="galaxy"] .settings-card, body[data-theme="galaxy"] .theme-choice { background: rgba(20,23,47,.88); backdrop-filter: blur(10px); }

/* restrained white theme */
body[data-theme="white"] {
  --ink: #20242a; --forest: #fff; --forest-2: #f0f2f4; --orange: #285d9f;
  --orange-soft: #edf3fa; --paper: #fff; --card: #fff; --line: #dfe2e5;
  --muted: #6d737b; --green: #28785c; --red: #b4433a; --yellow: #8b641e;
  --shadow: none; --radius: 3px;
}
body[data-theme="white"] .sidebar { color: var(--ink); background: #fff; border-right: 1px solid var(--line); }
body[data-theme="white"] .sidebar .brand-lockup, body[data-theme="white"] .sidebar-footer { border-color: var(--line); }
body[data-theme="white"] .brand-lockup { color: var(--ink); }
body[data-theme="white"] .brand-mark { color: var(--ink); border-color: var(--ink); }
body[data-theme="white"] .nav-label { color: #92979e; }
body[data-theme="white"] .nav-link { color: #555c64; border-radius: 2px; }
body[data-theme="white"] .nav-link:hover, body[data-theme="white"] .nav-link.active { color: var(--ink); background: #f0f2f4; }
body[data-theme="white"] .sidebar-footer b { color: var(--ink); }
body[data-theme="white"] .sidebar-footer small, body[data-theme="white"] .sidebar-footer button { color: var(--muted); }
body[data-theme="white"] .login-brand { color: var(--ink); background: #f2f3f3; border-right: 1px solid var(--line); }
body[data-theme="white"] .login-claim > p:last-child { color: var(--muted); }
body[data-theme="white"] .login-pattern { display: none; }
body[data-theme="white"] .login-panel, body[data-theme="white"] .topbar, body[data-theme="white"] .modal-card { background: #fff; }
body[data-theme="white"] .page-head h1,
body[data-theme="white"] .login-claim h1,
body[data-theme="white"] .login-card h2,
body[data-theme="white"] .modal-card h2,
body[data-theme="white"] .panel-header h2,
body[data-theme="white"] .settings-intro h2,
body[data-theme="white"] .empty strong,
body[data-theme="white"] .metric-value { font-family: inherit; letter-spacing: -.02em; }
body[data-theme="white"] .page-head h1 { font-size: clamp(31px, 3.2vw, 41px); font-weight: 650; }
body[data-theme="white"] .metric-card::after { display: none; }
body[data-theme="white"] .btn, body[data-theme="white"] input, body[data-theme="white"] select, body[data-theme="white"] textarea, body[data-theme="white"] .icon-btn, body[data-theme="white"] .theme-choice { border-radius: 2px; box-shadow: none; }
body[data-theme="white"] .metric-card, body[data-theme="white"] .panel, body[data-theme="white"] .table-wrap, body[data-theme="white"] .settings-card { box-shadow: none; }
