/* Grand Chat - login, admin and settings pages */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Inter, "Segoe UI", system-ui, sans-serif; color: #1A1F29; background: #F4F2ED; }
a { color: #1D3557; } a:hover { color: #0E1A2B; }
h1, h2 { font-family: "Space Grotesk", Inter, "Segoe UI", sans-serif; color: #0E1A2B; }

.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 36px 32px; box-shadow: 0 10px 40px rgba(14,26,43,.10); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-logo { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.brand-logo img { width: 190px; max-width: 70%; height: auto; }
.brand-logo h1 { margin: 6px 0 0; font-family: Poppins, Inter, "Segoe UI", sans-serif; font-weight: 500; font-size: 26px; color: #E4041C; letter-spacing: .2px; }
.brand-logo p { margin: 4px 0 0; font-size: 13px; color: #5B6573; }
.brand-img { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 1px 4px rgba(14,26,43,.15); background: #fff; flex: 0 0 46px; }
.brand-mark { width: 46px; height: 46px; border-radius: 13px; background: #E5A13A; color: #0E1A2B; display: flex; align-items: center; justify-content: center; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 24px; }
.brand h1 { margin: 0; font-size: 24px; }
.brand p { margin: 2px 0 0; font-size: 13px; color: #5B6573; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: #3A4250; }
.input { height: 46px; border: 1px solid #DAD5CB; border-radius: 12px; padding: 0 14px; font-size: 15px; font-family: inherit; background: #FBFAF8; color: #1A1F29; outline: none; width: 100%; }
.input:focus { border-color: #1D3557; box-shadow: 0 0 0 3px rgba(29,53,87,.12); background: #fff; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #3A4250; margin-bottom: 20px; }
.check input { width: 18px; height: 18px; }

.btn { height: 46px; border: 0; border-radius: 12px; padding: 0 20px; font-size: 15px; font-weight: 600; font-family: inherit; cursor: pointer; background: #1D3557; color: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.btn:hover { background: #0E1A2B; color: #fff; }
.btn.block { width: 100%; }
.apk-link { margin-top: 12px; }
.btn.amber { background: #E5A13A; color: #0E1A2B; }
.btn.amber:hover { background: #D48F27; }
.btn.ghost { background: #fff; color: #1D3557; border: 1px solid #DAD5CB; }
.btn.ghost:hover { background: #F2F4F8; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { background: #fff; color: #B42318; border: 1px solid #F0C9C4; }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; display: block; }
.alert.error { background: #FDECEA; color: #8F1D13; }
.alert.ok { background: #E7F4EC; color: #1E5B3D; }
.hint { font-size: 12px; color: #5B6573; margin-top: 18px; text-align: center; }

/* admin */
.page { width: 95%; margin: 0 auto; padding: 28px 0 60px; }
.topbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 26px; flex: 1; }
.panel { background: #fff; border-radius: 16px; padding: 22px; box-shadow: 0 1px 2px rgba(14,26,43,.06); margin-bottom: 22px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.grid-form .field { margin: 0; }
.table-wrap { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; }
table.users th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #5B6573; padding: 10px 12px; border-bottom: 1px solid #E6E2D9; white-space: nowrap; }
table.users td { padding: 10px 12px; border-bottom: 1px solid #F0ECE4; vertical-align: middle; }
table.users tr.inactive td { color: #8A94A3; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.pill.admin { background: #FFF0D4; color: #6B4A10; }
.pill.active { background: #E7F4EC; color: #1E5B3D; }
.pill.off { background: #EEF0F3; color: #4A5361; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- phone ---------- */
@media (max-width: 600px) {
  .page { width: 100%; padding: 16px 12px 40px; }
  .topbar h1 { font-size: 21px; }
  .panel { padding: 16px; border-radius: 12px; }
  .grid-form { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .input { font-size: 16px; }
  table.users { font-size: 13px; }
  table.users th, table.users td { padding: 8px; }
}

/* ---------- admin: navigation, forms, settings ---------- */
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; background: #fff; padding: 4px; border-radius: 12px; box-shadow: 0 1px 2px rgba(14,26,43,.06); }
.admin-nav a { padding: 8px 14px; border-radius: 9px; text-decoration: none; font-size: 14px; font-weight: 600; color: #3A4250; }
.admin-nav a:hover { background: #F2F4F8; }
.admin-nav a.active { background: #1D3557; color: #fff; }
.muted { color: #5B6573; font-weight: 400; }
.small { font-size: 12px; }
.checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.checks .check { margin: 0; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.input.filter { max-width: 320px; height: 40px; }
.input.short { max-width: 140px; }
.input.slim { height: 36px; font-size: 14px; min-width: 180px; }
select.input { padding-right: 8px; }
.t-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: #2F6F9F; color: #fff; font-size: 13px; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.settings-grid .panel { margin-bottom: 0; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-list label { font-size: 14px; color: #1A1F29; margin-left: 6px; font-weight: 400; }
.radio-list input { width: 17px; height: 17px; vertical-align: middle; }
.status-box { background: #F4F2ED; border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.5; margin: 6px 0 12px; }
.status-box code { background: #fff; padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.save-bar { display: flex; justify-content: flex-end; margin: 18px 0 22px; }
.inline-add { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-add .input { height: 40px; min-width: 240px; }
@media (max-width: 600px) {
  .admin-nav { width: 100%; }
  .admin-nav a { flex: 1; text-align: center; padding: 8px 6px; }
  .inline-add .input { min-width: 0; flex: 1; }
}

/* ---------- regions, regional admins, password requests ---------- */
.pill.regional { background: #E3EEFA; color: #1D3557; }
.scope-tag { display: inline-block; vertical-align: middle; margin-left: 8px; font-family: Inter, sans-serif; font-size: 13px; font-weight: 600; color: #6B4A10; background: #FFF0D4; padding: 4px 10px; border-radius: 8px; }
.panel.requests { border: 2px solid #E5A13A; }
.intro { font-size: 14px; color: #3A4250; line-height: 1.5; margin: 0 0 16px; }
.auth-card .hint a { font-weight: 600; }

/* ---------- update 4: reports and audit ---------- */
.nowrap { white-space: nowrap; }
.report-filter { display: flex; align-items: center; gap: 12px; padding: 14px 22px; }
.report-filter label { font-weight: 600; margin: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 1px 2px rgba(14,26,43,.06); }
.tile-label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #5B6573; font-weight: 600; }
.tile-value { font-family: "Space Grotesk", Inter, sans-serif; font-size: 28px; font-weight: 700; color: #0E1A2B; margin-top: 6px; }
.tile-note { font-size: 12px; color: #5B6573; margin-top: 2px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.report-grid .panel { margin-bottom: 22px; }
.bar { height: 6px; background: #EEF0F3; border-radius: 4px; margin-top: 5px; min-width: 70px; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 4px; }
.bar .navy { background: #1D3557; } .bar .amber { background: #E5A13A; } .bar .grey { background: #8A94A3; }
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }
