* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, sans-serif; color: #1f2430; background: #f4f6fa; }
a { color: #2b5cd6; text-decoration: none; } a:hover { text-decoration: underline; }
main { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
h1 { font-size: 22px; } h2 { font-size: 18px; margin-top: 28px; }
.muted { color: #7a8194; } .small { font-size: 12px; }

.nav { display: flex; align-items: center; gap: 18px; background: #1f2937; color: #fff; padding: 10px 18px; }
.nav .brand { font-weight: 700; }
.nav nav { display: flex; gap: 14px; }
.nav nav a { color: #cdd5e5; } .nav nav a:hover { color: #fff; }
.nav .user { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nav .logout { color: #ffd0d0; }
.badge { background: #374151; color: #cbd5e1; padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.warn { background: #fff4d6; color: #7a5b00; padding: 8px 18px; font-size: 13px; border-bottom: 1px solid #f0e0a8; }
.err { background: #ffe2e2; color: #a12; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }
.ok { background: #dff5e3; color: #176a2e; padding: 8px 12px; border-radius: 6px; margin: 8px 0; }

button { cursor: pointer; border: 1px solid #c4ccda; background: #fff; padding: 7px 12px; border-radius: 7px; font-size: 14px; }
button:hover { background: #f0f3f9; }
button.primary { background: #2b5cd6; color: #fff; border-color: #2b5cd6; }
button.primary:hover { background: #2350bd; }
button.danger { background: #fff; color: #c02626; border-color: #e6b3b3; }
input, select, textarea { padding: 7px 9px; border: 1px solid #c4ccda; border-radius: 7px; font-size: 14px; font-family: inherit; }
textarea { width: 100%; resize: vertical; }
label { display: block; margin: 6px 0; font-size: 14px; }
label input, label select { display: block; width: 100%; margin-top: 3px; }

.login-box { max-width: 360px; margin: 60px auto; background: #fff; padding: 28px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.login-box button { width: 100%; margin-top: 10px; }

.row-head { display: flex; align-items: center; gap: 14px; }
.row-head h1 { margin-right: auto; }
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-top: 10px; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #eef1f6; font-size: 14px; vertical-align: top; }
.tbl th { background: #f0f3f9; font-size: 13px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; }
.inline { display: inline; }
.panel, .card { background: #fff; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.panel { padding: 16px; margin: 14px 0; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr) auto; gap: 10px; align-items: end; }
.cards { display: flex; gap: 14px; margin: 14px 0; }
.card { padding: 16px 20px; text-align: center; flex: 1; }
.card .num { font-size: 26px; font-weight: 700; color: #2b5cd6; }

.chat { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.msg { padding: 10px 14px; border-radius: 10px; max-width: 80%; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.msg.user { background: #dce8ff; align-self: flex-end; }
.msg.assistant { background: #fff; align-self: flex-start; }
.msg .who { font-size: 12px; color: #7a8194; margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.atts { margin: 10px 0; font-size: 13px; }
.chip { display: inline-block; background: #eef2fb; padding: 3px 9px; border-radius: 12px; margin: 2px; }
.composer { background: #fff; padding: 14px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-top: 10px; }
.composer .upload { margin-bottom: 10px; }
.composer .send button { margin-top: 8px; }
