/* ── Reset & base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f4f6f9;
  --surface:   #ffffff;
  --border:    #dee2e6;
  --text:      #212529;
  --text-dim:  #6c757d;
  --primary:   #0d6efd;
  --primary-h: #0b5ed7;
  --success:   #198754;
  --danger:    #dc3545;
  --warning:   #ffc107;
  --sidebar-w: 220px;
  --sidebar-bg:#1e2a3a;
  --sidebar-fg:#c8d6e5;
}

body { font-family: system-ui, sans-serif; font-size: 15px; color: var(--text); background: var(--bg); }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1.1rem; border-radius: 6px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); text-decoration: none; }
.btn-google   { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-google:hover { background: var(--bg); text-decoration: none; }

/* ── Navbar (public pages) ──────────────────────────────────────────── */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.navbar-brand a { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.navbar-menu    { display: flex; align-items: center; gap: 1rem; }
.nav-link       { color: var(--text-dim); font-size: 14px; }
.nav-user       { display: flex; align-items: center; gap: .5rem; }

/* ── Avatar ─────────────────────────────────────────────────────────── */
.avatar    { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 24px; height: 24px; }

/* ── Landing page ────────────────────────────────────────────────────── */
.landing { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.landing-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 3rem; text-align: center; max-width: 480px; width: 100%;
}
.landing-card h1 { font-size: 1.75rem; margin-bottom: .75rem; }
.landing-card p  { color: var(--text-dim); margin-bottom: 1.5rem; }

/* ── Auth page ───────────────────────────────────────────────────────── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 2.5rem; text-align: center; max-width: 380px; width: 100%;
}
.auth-card h1 { margin-bottom: .5rem; }
.auth-card p  { color: var(--text-dim); margin-bottom: 1.5rem; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { text-align: center; padding: 1.5rem; color: var(--text-dim); font-size: 13px; }

/* ── Page layout (tickets etc.) ──────────────────────────────────────── */
.page-wrap { max-width: 860px; margin: 0 auto; padding: 1.5rem; }
.page-hdr  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.page-hdr h2 { font-size: 1.2rem; font-weight: 600; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-dim); }
.empty-state p { margin-bottom: 1rem; }

/* ── Status / priority badges ────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-open        { background: #cfe2ff; color: #084298; }
.badge-in_progress { background: #fff3cd; color: #664d03; }
.badge-closed      { background: #d1e7dd; color: #0f5132; }
.badge-low         { background: #e9ecef; color: #495057; }
.badge-medium      { background: #fff3cd; color: #664d03; }
.badge-high        { background: #fde8e8; color: #842029; }
.badge-urgent      { background: #dc3545; color: #fff; }
.badge-isp            { background: #cfe2ff; color: #084298; }
.badge-access_control { background: #e2d9f3; color: #432874; }
.badge-cameras        { background: #d1e7dd; color: #0f5132; }
.badge-general        { background: #e9ecef; color: #495057; }

/* ── Ticket list ─────────────────────────────────────────────────────── */
.ticket-list { display: flex; flex-direction: column; gap: .5rem; }
.ticket-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 1rem 1.25rem; display: flex; align-items: center; gap: 1rem;
  color: var(--text); text-decoration: none;
}
.ticket-item:hover { border-color: var(--primary); text-decoration: none; }
.ticket-item-body  { flex: 1; min-width: 0; }
.ticket-item-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket-item-sub   { font-size: 12px; color: var(--text-dim); margin-top: .2rem; }
.ticket-item-badges { display: flex; gap: .4rem; flex-shrink: 0; }

/* ── Ticket detail ───────────────────────────────────────────────────── */
.ticket-detail { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.ticket-detail-title { font-size: 1.1rem; font-weight: 600; margin-bottom: .75rem; }
.ticket-meta-row { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 13px; color: var(--text-dim); margin-bottom: 1rem; }
.ticket-description { font-size: 14px; white-space: pre-wrap; color: var(--text); line-height: 1.6; }

/* ── Comments ────────────────────────────────────────────────────────── */
.comment-thread { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.5rem; }
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.comment.internal { background: #fffbea; border-color: #ffe066; }
.comment-header { display: flex; gap: .5rem; align-items: center; font-size: 12px; color: var(--text-dim); margin-bottom: .5rem; }
.comment-author { font-weight: 600; color: var(--text); }
.comment-body { font-size: 14px; white-space: pre-wrap; color: var(--text); line-height: 1.6; }

/* ── Ticket form ─────────────────────────────────────────────────────── */
.ticket-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; }
.form-group-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row  { margin-bottom: 1rem; }
.form-row label { display: block; font-size: 13px; font-weight: 500; margin-bottom: .35rem; color: var(--text-dim); }
.form-row .form-control { display: block; width: 100%; padding: .5rem .75rem; font-size: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.form-row .form-control:focus { border-color: var(--primary); background: #fff; outline: none; }
.flash { padding: .65rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 14px; }
.flash-error { background: #f8d7da; color: #842029; border: 1px solid #f5c2c7; }

/* ── Welcome / onboarding pages ─────────────────────────────────────── */
.welcome-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 80vh; padding: 2rem 1rem;
}
.welcome-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 2.5rem 2rem; text-align: center; max-width: 420px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: .75rem;
}
.welcome-card-wide { max-width: 520px; }
.welcome-icon    { font-size: 2.5rem; line-height: 1; margin-bottom: .25rem; }
.welcome-heading { font-size: 1.6rem; font-weight: 700; margin: 0; }
.welcome-sub     { color: var(--text-dim); font-size: 14px; margin: 0; }
.welcome-note    { color: var(--text-dim); font-size: 13px; margin: 0; }
.welcome-cta     { width: 100%; justify-content: center; }
.welcome-divider { width: 100%; border-top: 1px solid var(--border); margin: .5rem 0; }
.welcome-back    { align-self: flex-start; font-size: 13px; color: var(--text-dim); }
.welcome-back:hover { color: var(--primary); }
.wifi-creds {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-top: .5rem;
}
.wifi-cred-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.1rem; gap: 1rem;
}
.wifi-cred-row + .wifi-cred-row { border-top: 1px solid var(--border); }
.wifi-cred-label { font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.wifi-cred-value { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.wifi-pw-hidden  { filter: blur(5px); user-select: none; letter-spacing: .08em; }
.wifi-pw-toggle  {
  font-size: 11px; padding: .15rem .5rem; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-dim); cursor: pointer;
}
.wifi-pw-toggle:hover { border-color: var(--primary); color: var(--primary); }

/* ── Profile page ────────────────────────────────────────────────────── */
.form-page { display: flex; justify-content: center; padding: 2rem 1rem; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2rem; width: 100%; max-width: 480px; }
.form-card h1 { font-size: 1.4rem; margin: 0 0 1.5rem; }
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: .35rem; }
.form-group .form-control { display: block; width: 100%; padding: .5rem .75rem; font-size: 14px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); box-sizing: border-box; }
.form-group .form-control:focus { border-color: var(--primary); outline: none; }
.form-static { font-size: 14px; color: var(--text-dim); margin: 0; padding: .35rem 0; }
.radio-group { display: flex; gap: 1.5rem; margin-top: .25rem; }
.radio-label { display: flex; align-items: center; gap: .4rem; font-size: 14px; cursor: pointer; }
.form-actions { margin-top: 1.5rem; }
.alert { padding: .65rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 14px; }
.alert-success { background: #d1e7dd; color: #0a3622; border: 1px solid #a3cfbb; }
