:root{
  --bg:#eef3f8; --surface:#fff; --surface-2:#f7fafc; --line:#e1e8f0;
  --text:#1f2d3d; --muted:#7b8a9a; --blue:#2f80ed; --blue-dark:#1f6fd0;
  --green:#2ecc71; --red:#ef5350; --yellow:#f5a623; --radius:10px;
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text);font-size:14px}
a{color:var(--blue);text-decoration:none}
h1,h2,h3{font-weight:600;margin:0 0 14px}
h1{font-size:24px}h2{font-size:18px}h3{font-size:15px}
p{margin:0 0 12px;line-height:1.5}
small{color:var(--muted)}
.app-shell{display:flex;min-height:100vh}
.sidebar{width:236px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:18px 14px;position:sticky;top:0;height:100vh}
.brand{display:flex;gap:10px;align-items:center;color:var(--text);font-weight:700;font-size:17px;margin:0 6px 24px}
.brand small{display:block;font-weight:400;font-size:11px;color:var(--muted)}
.brand-mark{width:34px;height:34px;border-radius:9px;background:linear-gradient(135deg,#2f80ed,#56ccf2);color:#fff;display:grid;place-items:center;font-weight:800}
.nav{display:flex;flex-direction:column;gap:3px}
.nav-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:8px;color:#3b4a5a;font-weight:500}
.nav-item:hover{background:var(--surface-2);color:var(--blue)}
.nav-item.active{background:#e8f1fd;color:var(--blue-dark);font-weight:600}
.sidebar-footer{margin-top:auto;display:flex;align-items:center;gap:10px;border-top:1px solid var(--line);padding-top:14px}
.sidebar-footer strong{display:block;font-size:13px}.sidebar-footer small{display:block}
.avatar{width:34px;height:34px;border-radius:50%;background:#dbeafe;color:#1d4ed8;display:grid;place-items:center;font-weight:700}
.logout{display:block;margin-top:10px;color:var(--muted);font-size:13px;padding:6px}
.main{flex:1;min-width:0}
.topbar{height:58px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:5}
.topbar-title{font-weight:600}
.topbar-user{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:13px}
.role-pill{background:#eef3f8;color:#4b5b6b;border-radius:20px;padding:3px 9px;font-size:11px}
.content{padding:24px 28px 50px;max-width:1320px}
.alert{padding:11px 14px;border-radius:8px;margin-bottom:16px;border:1px solid #d7e3ef;background:#f3f8ff}
.alert.error{border-color:#f3c7c5;background:#fdf1f0;color:#9b2c2c}
.alert.ok{border-color:#c9e8d4;background:#f0fbf4;color:#22683a}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:18px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.grid{display:grid;gap:16px}
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px}
.stat b{display:block;font-size:26px;margin-top:8px}
.stat span{color:var(--muted);font-size:13px}
.btn{display:inline-flex;align-items:center;gap:7px;border:0;border-radius:8px;padding:9px 15px;background:var(--blue);color:#fff;font-weight:600;font-size:13px;cursor:pointer}
.btn:hover{background:var(--blue-dark);color:#fff}
.btn.secondary{background:#eef3f8;color:#36495c}
.btn.secondary:hover{background:#e2ebf5;color:#1f2d3d}
.btn.danger{background:#ef5350}
.btn.small{padding:6px 11px;font-size:12px}
.btn:disabled{opacity:.5;cursor:not-allowed}
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-size:12px;color:var(--muted);font-weight:600;padding:9px 10px;border-bottom:1px solid var(--line);background:#f8fafc}
.table td{padding:11px 10px;border-bottom:1px solid #edf2f7;vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table tr:hover td{background:#fbfdff}
.status{display:inline-flex;align-items:center;gap:6px;border-radius:20px;padding:4px 10px;font-size:12px;font-weight:600;background:#eef3f8;color:#4b5b6b}
.status.new{background:#eaf3ff;color:#1d5fbf}
.status.in_progress{background:#fff5e1;color:#9a6200}
.status.answered{background:#e9f8ef;color:#1e7a43}
.status.email_failed{background:#fdeceb;color:#a52a27}
.status.payment_pending{background:#f1ebff;color:#5b3bb5}
label{display:block;font-weight:600;font-size:13px;margin:14px 0 6px}
input[type=text],input[type=email],input[type=password],input[type=tel],input[type=date],input[type=datetime-local],input[type=number],select,textarea{
  width:100%;padding:10px 11px;border:1px solid #d7e1eb;border-radius:8px;background:#fff;font:inherit;color:var(--text)
}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px #2f80ed22}
textarea{min-height:110px;resize:vertical}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-actions{display:flex;gap:10px;align-items:center;margin-top:18px}
.hint{color:var(--muted);font-size:12px;margin-top:4px}
.inline{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.pill{display:inline-block;padding:3px 9px;border-radius:20px;background:#eef3f8;color:#4b5b6b;font-size:12px}
.file-list{margin:8px 0 0;padding-left:18px}
.file-list li{margin:4px 0}
.messages{display:flex;flex-direction:column;gap:12px}
.message{border:1px solid var(--line);border-radius:10px;padding:12px 14px;background:#fff}
.message.support{background:#f3f8ff;border-color:#d5e6fb}
.message.user{background:#f8fafc}
.message .meta{font-size:11px;color:var(--muted);margin-bottom:6px}
.empty{color:var(--muted);padding:20px;text-align:center}
.auth-body{background:linear-gradient(135deg,#eef3f8,#e3edf8);min-height:100vh;display:flex;align-items:center;justify-content:center;padding:28px}
.auth-wrap{width:100%;max-width:960px;display:grid;grid-template-columns:1fr 1fr;background:#fff;border-radius:16px;box-shadow:0 18px 50px #1f2d3d1a;overflow:hidden;position:relative}
.auth-brand{padding:34px;background:linear-gradient(145deg,#1d5fa7,#2f80ed 55%,#56ccf2);color:#fff;display:flex;flex-direction:column;gap:12px;font-size:26px;font-weight:700;justify-content:flex-start}
.auth-brand .brand-mark{background:#ffffff2b;width:44px;height:44px;font-size:20px}
.auth-wrap > form,.auth-wrap > .auth-panel{padding:34px}
.auth-wrap > .auth-panel{grid-column:1/-1;max-width:520px;margin:auto}
.auth-switch{margin-top:16px;color:var(--muted);font-size:13px}
.checkbox{display:flex;gap:9px;align-items:flex-start;margin:10px 0;font-weight:400;font-size:13px;line-height:1.45}
.checkbox input{width:17px;height:17px;margin-top:2px}
.hero{background:linear-gradient(135deg,#1d5fa7,#2f80ed 55%,#56ccf2);color:#fff;border-radius:14px;padding:38px;margin-bottom:22px}
.hero h1{font-size:32px;line-height:1.2;margin-bottom:12px}
.hero p{opacity:.9;max-width:700px}
.hero .btn{background:#fff;color:#1d5fa7;margin-top:8px}
.service-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;display:flex;flex-direction:column;gap:10px}
.service-card h3{margin:0;font-size:16px}
.service-card p{color:var(--muted);font-size:13px;flex:1}
.service-icon{width:38px;height:38px;border-radius:10px;background:#e8f1fd;color:var(--blue);display:grid;place-items:center;font-size:19px}
.top-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.detail-list{display:grid;grid-template-columns:180px 1fr;gap:8px 14px}
.detail-list dt{color:var(--muted);font-size:13px}.detail-list dd{margin:0}
.tag{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.hero-kicker{display:inline-block;font-size:12px;text-transform:uppercase;letter-spacing:.08em;background:#ffffff26;padding:5px 10px;border-radius:20px;margin-bottom:14px}
.public-shell{max-width:1180px;margin:0 auto;padding:0 24px 60px}
.public-head{height:72px;display:flex;align-items:center;justify-content:space-between}
.public-head .brand{margin:0}
.public-main{padding-top:10px}
.doc-box{border:1px solid var(--line);border-radius:10px;overflow:hidden}
.doc-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 13px;border-bottom:1px solid var(--line);background:#fbfdff}
.doc-row:last-child{border-bottom:0}
.doc-row input{width:19px;height:19px;flex:0 0 auto}
@media(max-width:900px){.app-shell{flex-direction:column}.sidebar{width:100%;height:auto;position:relative;flex-direction:row;flex-wrap:wrap;align-items:center;gap:10px}.sidebar .nav{flex-direction:row;flex-wrap:wrap}.sidebar-footer{margin:0;border:0;padding:0}.logout{margin:0}.content{padding:18px}.grid.cols-3,.grid.cols-4,.grid.cols-2,.form-row{grid-template-columns:1fr}.auth-wrap{grid-template-columns:1fr}.auth-brand{padding:24px}.topbar{padding:0 18px}.auth-wrap > .auth-panel{padding:24px}}
