:root {
    --navy: #0d2a5e;
    --blue: #1565C0;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1d2a3f;
    --muted: #5b6b82;
    --line: #dfe5ef;
    --ok: #2e7d32;
    --warn: #b26a00;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }

.topbar { background: var(--navy); color: #fff; }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; }
.brand-logo { height: 34px; width: auto; background: #fff; border-radius: 6px; padding: 2px; }
.topnav a, .topnav-note { color: #fff; font-size: 14px; text-decoration: none; opacity: .9; }
.topnav a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.foot { max-width: 760px; margin: 0 auto; padding: 18px 16px 30px; color: var(--muted); font-size: 14px; text-align: center; }

h1 { font-size: 24px; margin: 4px 0 6px; color: var(--navy); }
.lead { color: var(--muted); margin: 0 0 18px; }

/* Category tiles */
.tiles { display: flex; flex-direction: column; gap: 12px; }
.tile { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 6px; padding: 14px 16px; text-decoration: none; color: var(--blue); box-shadow: 0 1px 4px rgba(13,42,94,.10); }
.tile:hover, .tile:focus { box-shadow: 0 2px 8px rgba(13,42,94,.20); }
.tile-chev { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1; }
.tile-name { font-weight: 700; font-size: 18px; display: block; }
.tile-desc { color: var(--muted); font-size: 14px; display: block; font-weight: 400; }

/* Cards, forms */
.card { background: var(--card); border-radius: 8px; padding: 18px; box-shadow: 0 1px 4px rgba(13,42,94,.10); margin-bottom: 16px; }
label { display: block; font-weight: 600; margin: 14px 0 4px; }
.hint { color: var(--muted); font-size: 14px; font-weight: 400; }
input[type=text], input[type=email], select, textarea { width: 100%; padding: 11px 12px; font: inherit; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
input[readonly] { background: #eef2f8; }
textarea { min-height: 150px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(21,101,192,.35); border-color: var(--blue); }
.btn { display: inline-block; background: var(--blue); color: #fff; border: 0; border-radius: 6px; padding: 12px 20px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: #0f56a3; }
.btn-secondary { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-secondary:hover { background: #eef4fc; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.notice-error { background: #fdecea; border-color: #f5c2bd; color: #8a1c13; }
.notice-ok { background: #e8f5e9; border-color: #bfe0c1; color: #1b5e20; }
.notice-info { background: #e8f1fb; border-color: #bcd3ef; color: var(--navy); }
.notice ul { margin: 4px 0 0 18px; padding: 0; }
.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox input { font-size: 13px; }

/* Ticket */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #e8f1fb; color: var(--navy); }
.badge-new { background: #fff3d6; color: #7a5200; }
.badge-open { background: #e8f1fb; color: var(--navy); }
.badge-waiting { background: #fde7d5; color: #8a3b00; }
.badge-resolved { background: #e3f3e4; color: #1b5e20; }
.badge-closed { background: #e9ecf1; color: #4a5568; }
.meta { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.meta span + span::before { content: " · "; }
.thread { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.msg { background: var(--card); border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(13,42,94,.08); border-left: 4px solid var(--line); }
.msg-staff { border-left-color: var(--blue); background: #f3f8fe; }
.msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.msg-head strong { color: var(--text); }
.msg-body { overflow-wrap: anywhere; }

/* Ticket list */
.tlist { display: flex; flex-direction: column; gap: 10px; }
.trow { display: block; background: var(--card); border-radius: 8px; padding: 12px 14px; text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(13,42,94,.08); }
.trow:hover { box-shadow: 0 2px 8px rgba(13,42,94,.18); }
.trow-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.trow-subject { font-weight: 600; color: var(--blue); overflow-wrap: anywhere; }
.empty { color: var(--muted); text-align: center; padding: 28px 10px; }

@media (min-width: 640px) {
    h1 { font-size: 28px; }
    .tile { padding: 16px 20px; }
}
