:root {
    --bg: #eef2f5;
    --panel: #ffffff;
    --panel-muted: #f7f8fa;
    --text: #20252b;
    --muted: #69737e;
    --line: #dce1e6;
    --header: #090909;
    --header-soft: #202327;
    --orange: #f5a623;
    --orange-dark: #c97b00;
    --blue: #236aa6;
    --green: #287a45;
    --red: #b33434;
    --amber: #a36600;
    --radius: 12px;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at top right, rgba(245,166,35,.08), transparent 28rem), var(--bg); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button, .button { appearance: none; border: 0; border-radius: 8px; padding: .72rem 1rem; background: var(--orange); color: #18130a; font-weight: 800; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; cursor: pointer; min-height: 44px; }
button:hover, .button:hover { background: #ffb53b; }
.button.secondary, button.secondary { background: #49535e; color: #fff; }
.button.ghost, button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.button.danger, button.danger { background: var(--red); color: #fff; }
.button.small, button.small { min-height: 36px; padding: .45rem .7rem; font-size: .9rem; }
.site-header { background: linear-gradient(135deg, var(--header), var(--header-soft)); border-bottom: 3px solid var(--orange); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 4px 16px rgba(0,0,0,.22); }
.header-wrap { width: min(1180px, calc(100% - 28px)); margin: 0 auto; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { color:#fff; text-decoration:none; display:inline-flex; align-items:baseline; gap:12px; white-space:nowrap; }
.brand-main { font-size:1.48rem; font-weight:900; letter-spacing:-.065em; line-height:1; }
.brand-accent { color:var(--orange); }
.brand-service { padding-left:12px; border-left:1px solid rgba(255,255,255,.28); color:#e4e4e4; font-size:.72rem; letter-spacing:.08em; text-transform:uppercase; font-weight:900; }
.nav-toggle { display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a, .nav-user { color: #fff; text-decoration: none; padding: .65rem .72rem; border-radius: 7px; font-weight: 700; }
.main-nav a:hover, .main-nav a:focus { background: rgba(245,166,35,.18); color: #fff; }
.nav-user { color: #d9dee4; font-weight: 500; border-left: 1px solid rgba(255,255,255,.18); margin-left: .4rem; }
.main-nav .nav-signout { color: var(--orange); }
.page-wrap { width: min(1180px, calc(100% - 28px)); margin: 0 auto; }
main.page-wrap { padding-block: 28px 48px; min-height: calc(100vh - 128px); }
h1, h2, h3 { line-height: 1.18; margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.65rem); letter-spacing: -.035em; }
h2 { font-size: 1.3rem; }
.lead { color: var(--muted); font-size: 1.06rem; line-height: 1.6; }
.eyebrow { color: var(--orange-dark); text-transform: uppercase; font-size: .75rem; letter-spacing: .12em; font-weight: 900; margin-bottom: .45rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 5px 18px rgba(28,39,49,.06); margin-bottom: 18px; }
.card.compact { padding: 15px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -25px; top: -25px; width: 82px; height: 82px; border-radius: 50%; background: rgba(245,166,35,.11); }
.stat-value { font-size: 2.25rem; font-weight: 900; margin-top: .2rem; }
.stat-label { color: var(--muted); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.actions.split { justify-content: space-between; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
label { display: block; font-weight: 800; margin-bottom: 13px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=number], select, textarea { display: block; width: 100%; margin-top: 6px; padding: .72rem .8rem; border: 1px solid #b8c1ca; border-radius: 8px; background: #fff; color: var(--text); min-height: 44px; }
textarea { min-height: 140px; resize: vertical; line-height: 1.45; }
select option { background: #fff; color: #20252b; }
.assignment-help, .fieldset-help { margin: -.15rem 0 1rem; line-height: 1.45; }
.assignment-card form { margin: 0; }
.assignment-card form + form { margin-top: .9rem; }
.assignment-actions { align-items: stretch; gap: .75rem; }
.assignment-actions button,
.assign-self-form button { width: 100%; }
.people-scheduling { border-color: #cfd6dd; background: #fbfcfd; }
.error-text { color: var(--red); font-weight: 800; margin-top: .45rem; }
input:focus, select:focus, textarea:focus, button:focus, a:focus { outline: 3px solid rgba(245,166,35,.32); outline-offset: 2px; border-color: var(--orange-dark); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 0 0 18px; }
legend { font-weight: 900; padding-inline: .4rem; }
.help { color: var(--muted); font-size: .9rem; margin-top: -.4rem; }
.muted { color: var(--muted); }
code { background: #eef1f4; border-radius: 5px; padding: .12rem .32rem; }
input[type=file] { display: block; width: 100%; margin-top: 6px; padding: .65rem; border: 1px dashed #aeb8c2; border-radius: 8px; background: var(--panel-muted); }
.flash { padding: 13px 15px; border-radius: 9px; margin-bottom: 18px; border-left: 5px solid; }
.flash.success { background: #e4f4e8; color: #1f5e35; border-color: var(--green); }
.flash.error { background: #fbe7e7; color: #7c2626; border-color: var(--red); }
.flash.info { background: #e8f1f8; color: #22587e; border-color: var(--blue); }
.badge { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; padding: .28rem .58rem; font-size: .78rem; font-weight: 900; background: #e6eaee; color: #39434d; }
.status-new { background: #e7edf4; color: #40556a; }
.status-assigned { background: #e2eef9; color: #225e91; }
.status-in_progress { background: #fff0cc; color: #815400; }
.status-waiting { background: #efe7f9; color: #684390; }
.status-resolved { background: #e0f3e5; color: #21633a; }
.status-closed { background: #dde1e5; color: #3b444c; }
.priority-low { background: #e9eef2; color: #56626d; }
.priority-normal { background: #e3eef8; color: #2e638b; }
.priority-high { background: #fff0cc; color: #8a5c00; }
.priority-urgent { background: #f8dddd; color: #8f2222; }
.overdue { color: var(--red); font-weight: 900; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--panel-muted); color: #4c5863; font-size: .8rem; text-transform: uppercase; letter-spacing: .045em; }
tbody tr:hover { background: #fffaf0; }
tr:last-child td { border-bottom: 0; }
.ticket-link { font-weight: 900; text-decoration: none; color: var(--text); }
.ticket-number { color: var(--orange-dark); font-size: .83rem; font-weight: 900; letter-spacing: .035em; }
.project-section { margin-bottom: 28px; }
.project-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; border-bottom: 2px solid #d8dde2; padding-bottom: 9px; }
.project-heading h2 { margin: 0; }
.ticket-list { display: grid; gap: 10px; }
.ticket-row { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: 10px; padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; box-shadow: 0 3px 10px rgba(29,38,47,.04); }
.ticket-row-meta { display: flex; flex-wrap: wrap; gap: 7px 10px; margin-top: 7px; color: var(--muted); font-size: .9rem; }
.ticket-row-side { text-align: right; }
.ticket-title { margin: .18rem 0 0; font-size: 1rem; }
.ticket-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 18px; }
.detail-list { display: grid; grid-template-columns: 8.5rem 1fr; gap: 9px 13px; }
.detail-list dt { color: var(--muted); font-weight: 800; }
.detail-list dd { margin: 0; }
.description { white-space: pre-wrap; line-height: 1.6; }
.timeline { display: grid; gap: 12px; }
.timeline-item { border-left: 3px solid #ccd4dc; padding: 4px 0 4px 15px; }
.timeline-item.comment { border-left-color: var(--orange); }
.timeline-meta { color: var(--muted); font-size: .85rem; margin-bottom: 5px; }
.timeline-body { white-space: pre-wrap; line-height: 1.55; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment { display: inline-flex; gap: 7px; align-items: center; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; background: var(--panel-muted); max-width: 100%; }
.attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { background: #fff; border: 1px solid var(--line); padding: 15px; border-radius: 10px; margin-bottom: 18px; }
.filters .form-grid { align-items: end; }
.empty-state { text-align: center; padding: 35px 18px; color: var(--muted); }
.empty-state h2 { color: var(--text); }
.auth-shell { min-height: calc(100vh - 190px); display: grid; place-items: center; padding: 24px 0; }
.login-card { width: min(470px, 100%); padding: 30px; border-top: 4px solid var(--orange); position: relative; overflow: hidden; }
.login-card::after { content: ''; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -80px; top: -90px; background: rgba(245,166,35,.10); pointer-events: none; }
.login-card > * { position: relative; z-index: 1; }
.login-card h1 { margin-bottom: .55rem; }
.login-card .lead { margin: 0 0 1.4rem; }
.auth-form { display: grid; gap: 17px; position: relative; z-index: 1; }
.auth-field { margin: 0; }
.auth-field > span { display: block; margin-bottom: 7px; color: #37414b; font-size: .94rem; }
.auth-field input { margin: 0; min-height: 50px; padding: .82rem .9rem; border: 2px solid #cbd2d9; border-radius: 10px; background: #fbfcfd; box-shadow: inset 0 1px 2px rgba(20,30,40,.035); }
.auth-field input:hover { border-color: #aeb8c2; }
.auth-field input:focus { background: #fff; border-color: var(--orange-dark); }
.auth-submit { width: 100%; min-height: 50px; margin-top: 2px; font-size: 1rem; }
.install-card { width: min(760px, 100%); }
.success-state { background: #eaf7ed; border-radius: 10px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.admin-nav a { text-decoration: none; padding: .65rem .85rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-weight: 800; color: var(--text); }
.admin-nav a:hover { border-color: var(--orange); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.checkbox-option { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.checkbox-option input { width: auto; margin: 0; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); background: #e9edf0; }
.footer-inner { min-height: 60px; display: flex; justify-content: space-between; align-items: center; gap: 15px; font-size: .88rem; }
@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    .header-wrap { min-height: 62px; flex-wrap: wrap; padding-block: 8px; }
    .main-nav { display: none; width: 100%; flex-direction: column; align-items: stretch; padding: 8px 0 12px; border-top: 1px solid rgba(255,255,255,.15); }
    .main-nav.is-open { display: flex; }
    .main-nav a, .nav-user { color: #fff; background: rgba(255,255,255,.055); border-radius: 7px; border: 0; margin: 0; }
    .main-nav a:hover { background: rgba(245,166,35,.22); }
    .main-nav .nav-signout { color: #ffd27e; }
    .ticket-detail-grid { grid-template-columns: 1fr; }
    .form-grid.three-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .page-wrap, .header-wrap { width: min(100% - 20px, 1180px); }
    main.page-wrap { padding-top: 18px; }
    .brand { font-size: 1.28rem; }
    .auth-shell { min-height: auto; padding: 8px 0 24px; place-items: start center; }
    .login-card { padding: 22px 18px; border-radius: 11px; }
    .form-grid.two-columns, .form-grid.three-columns { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; }
    .page-heading .actions, .page-heading .button { width: 100%; }
    .actions.mobile-full > * { flex: 1 1 100%; }
    .ticket-row { grid-template-columns: 1fr; }
    .ticket-row-side { text-align: left; }
    .detail-list { grid-template-columns: 1fr; gap: 3px; }
    .detail-list dd { margin-bottom: 8px; }
    table.responsive, table.responsive thead, table.responsive tbody, table.responsive th, table.responsive td, table.responsive tr { display: block; }
    table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    table.responsive tr { border-bottom: 8px solid var(--bg); padding: 8px 0; }
    table.responsive td { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; border-bottom: 1px solid var(--line); }
    table.responsive td::before { content: attr(data-label); color: var(--muted); font-weight: 800; }
    table.responsive td:last-child { border-bottom: 0; }
    .footer-inner { flex-direction: column; justify-content: center; padding-block: 15px; text-align: center; }
}

.assign-self-form { display: block; }
.compact-flash { margin-top: .75rem; margin-bottom: 0; }
