/* =========================================================
   FiveM Platform – Frontend CSS
   Uses CSS custom properties set by BrandingService.
   ========================================================= */

/* ─── CSS Variables (overridden by admin theme settings) ── */
:root {
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --secondary:      #7c3aed;
  --accent:         #06b6d4;
  --bg:             #0a0a0f;
  --bg-surface:     #111118;
  --bg-elevated:    #1a1a24;
  --border:         rgba(255, 255, 255, 0.08);
  --text:           #e2e8f0;
  --text-muted:     #64748b;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --info:           #3b82f6;
  --radius:         10px;
  --radius-lg:      16px;
  --shadow:         0 4px 24px rgba(0, 0, 0, 0.4);
  --transition:     0.2s ease;
  --font-sans:      'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { opacity: .85; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── Container ──────────────────────────────────────────── */
.container        { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 800px;  margin: 0 auto; padding: 0 1.5rem; }

/* ─── Sections ───────────────────────────────────────────── */
.section    { padding: 5rem 0; }
.section-sm { padding: 2.5rem 0; }

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.prose p, .prose li { color: var(--text-muted); line-height: 1.8; }
.prose p + p { margin-top: 1rem; }
.prose h2, .prose h3 { margin: 1.5rem 0 .5rem; }
.prose ul, .prose ol { margin: .75rem 0 .75rem 1.5rem; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem; border-radius: var(--radius);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  border: none; transition: all var(--transition); text-decoration: none;
  white-space: nowrap;
}
.btn:hover    { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.btn:active   { transform: none; }
.btn-block    { width: 100%; justify-content: center; }
.btn-sm       { padding: .4rem .875rem; font-size: .8rem; }
.btn-lg       { padding: .875rem 1.75rem; font-size: 1rem; }

.btn-primary       { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary     { background: var(--secondary); color: #fff; }
.btn-outline       { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-discord       { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; color: #fff; }
.btn-danger        { background: var(--danger); color: #fff; }
.btn-danger-outline{ background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-success       { background: var(--success); color: #fff; }
.btn-warning       { background: var(--warning); color: #000; }

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.card-header h2, .card-header h3 { font-size: 1rem; }
.card-body  { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.p-3  { padding: 1rem; }

/* ─── Forms ──────────────────────────────────────────────── */
.form-group  { margin-bottom: 1.25rem; }
.form-label  { display: flex; justify-content: space-between; font-size: .875rem; font-weight: 500; margin-bottom: .375rem; color: #cbd5e1; }
.form-label-link { font-weight: 400; color: var(--text-muted); }
.form-control {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: .6rem .875rem;
  color: var(--text); font-size: .875rem; outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.form-control-lg  { font-size: 1rem; padding: .75rem 1rem; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right .75rem center; background-size: 1em; padding-right: 2.5rem; }
.check-label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .875rem; }
.form-check  { display: flex; align-items: center; }
.form-grid   { display: grid; gap: 1rem; }
.form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { padding: .875rem 1rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; }
.alert-success  { background: rgba(16,185,129,.1);  border: 1px solid rgba(16,185,129,.3);  color: #6ee7b7; }
.alert-error    { background: rgba(239,68,68,.1);   border: 1px solid rgba(239,68,68,.3);   color: #fca5a5; }
.alert-warning  { background: rgba(245,158,11,.1);  border: 1px solid rgba(245,158,11,.3);  color: #fcd34d; }
.alert-info     { background: rgba(59,130,246,.1);  border: 1px solid rgba(59,130,246,.3);  color: #93c5fd; }
.alert-secondary{ background: rgba(255,255,255,.05); border: 1px solid var(--border);       color: var(--text-muted); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: .2rem .625rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-primary   { background: rgba(79,70,229,.2);   color: #818cf8; }
.badge-success   { background: rgba(16,185,129,.2);  color: #34d399; }
.badge-danger    { background: rgba(239,68,68,.2);   color: #f87171; }
.badge-warning   { background: rgba(245,158,11,.2);  color: #fbbf24; }
.badge-secondary { background: rgba(255,255,255,.07); color: var(--text-muted); }
.badge-sm        { font-size: .65rem; padding: .1rem .4rem; }
.badge-lg        { font-size: .875rem; padding: .3rem .875rem; }

/* ─── Nav ────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}
.navbar-inner { display: flex; align-items: center; gap: 1.5rem; height: 64px; max-width: 1200px; margin: 0 auto; }
.navbar-brand { font-weight: 700; font-size: 1.125rem; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.navbar-brand img { height: 36px; width: auto; }
.navbar-links { display: flex; align-items: center; gap: .25rem; flex: 1; }
.navbar-links a { padding: .45rem .75rem; border-radius: 8px; font-size: .875rem; color: var(--text-muted); transition: all var(--transition); }
.navbar-links a:hover, .navbar-links a.active { background: rgba(255,255,255,.06); color: var(--text); }
.navbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: .5rem; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .navbar-links {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; background: var(--bg-surface);
    padding: 0.75rem; border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .navbar-links.nav-open { display: flex; }
  .navbar-links a { padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; min-height: 44px; display: flex; align-items: center; }
  .navbar-inner { gap: .75rem; }
  .navbar { padding: 0 1rem; }
}

/* ─── Announcement bar ───────────────────────────────────── */
.announcement-bar { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .6rem 1rem; font-size: .875rem; }
.announcement-bar.type-info    { background: rgba(59,130,246,.15); border-bottom: 1px solid rgba(59,130,246,.3); color: #93c5fd; }
.announcement-bar.type-warning { background: rgba(245,158,11,.15); border-bottom: 1px solid rgba(245,158,11,.3); color: #fcd34d; }
.announcement-bar.type-success { background: rgba(16,185,129,.15); border-bottom: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.announcement-bar.type-danger  { background: rgba(239,68,68,.15);  border-bottom: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.dismiss-bar { background: none; border: none; color: inherit; cursor: pointer; opacity: .6; font-size: 1.1rem; }

/* ─── Page Hero ──────────────────────────────────────────── */
.page-hero { padding: 7rem 0 3rem; text-align: center; background: linear-gradient(to bottom, var(--bg-elevated), var(--bg)); }
.page-hero-title    { margin-bottom: .5rem; }
.page-hero-subtitle { color: var(--text-muted); font-size: 1.1rem; }

/* ─── Status Banner ──────────────────────────────────────── */
.status-card { display: flex; align-items: center; gap: 1rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.5rem; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.status-indicator.online  { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-indicator.offline { background: var(--danger); }
.status-info { flex: 1; }
.status-label   { font-weight: 600; }
.status-players { color: var(--text-muted); font-size: .875rem; display: block; }
.server-ip { font-family: monospace; font-size: .85rem; color: var(--text-muted); }

/* ─── Gallery ────────────────────────────────────────────── */
.gallery-filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-btn { padding: .4rem .875rem; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted); font-size: .8rem; cursor: pointer; transition: all var(--transition); }
.filter-btn.active, .filter-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery-item { position: relative; aspect-ratio: 4/3; overflow: hidden; border-radius: var(--radius); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-icon { width: 32px; height: 32px; color: #fff; }

/* ─── News ───────────────────────────────────────────────── */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.news-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform var(--transition); }
.news-card:hover { transform: translateY(-3px); }
.news-thumb { display: block; aspect-ratio: 16/9; overflow: hidden; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 1.25rem; }
.news-category { font-size: .75rem; font-weight: 700; color: var(--primary); letter-spacing: .05em; text-transform: uppercase; }
.news-title { margin: .4rem 0 .6rem; font-size: 1.05rem; }
.news-title a { color: var(--text); }
.news-excerpt { color: var(--text-muted); font-size: .875rem; line-height: 1.6; }
.news-meta { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; font-size: .8rem; color: var(--text-muted); }
.article-header { margin-bottom: 2rem; }
.article-title  { margin: .5rem 0; }
.article-meta   { display: flex; gap: .5rem; color: var(--text-muted); font-size: .875rem; margin-top: .5rem; }
.article-banner { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 2rem; }
.article-content { margin-bottom: 3rem; }
.article-footer { border-top: 1px solid var(--border); padding-top: 1.5rem; }

/* ─── FAQ ────────────────────────────────────────────────── */
.faq-category { margin-bottom: 2.5rem; }
.faq-cat-title { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-question { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; cursor: pointer; font-weight: 500; list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-chevron { width: 18px; height: 18px; transition: transform var(--transition); flex-shrink: 0; }
details[open] .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 1.25rem 1rem; color: var(--text-muted); font-size: .9rem; line-height: 1.7; }

/* ─── Team Grid ──────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.team-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; }
.team-avatar { width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 1rem; overflow: hidden; }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--text-muted); border-radius: 50%; }
.avatar-placeholder.large { width: 80px; height: 80px; font-size: 1.5rem; }
.avatar-placeholder.xlarge{ width: 96px; height: 96px; font-size: 1.75rem; }
.avatar-placeholder.sm    { width: 36px; height: 36px; font-size: .875rem; border-radius: 50%; }
.team-name { font-size: 1rem; margin-bottom: .25rem; }
.team-role { font-size: .8rem; font-weight: 600; }
.team-desc { font-size: .8rem; color: var(--text-muted); margin-top: .5rem; }

/* ─── Auth ───────────────────────────────────────────────── */
.auth-section { min-height: calc(100vh - 64px); display: flex; align-items: center; padding: 3rem 0; }
.auth-card { max-width: 440px; margin: 0 auto; width: 100%; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo img { height: 48px; margin: 0 auto; }
.logo-text { font-size: 1.5rem; font-weight: 800; }
.auth-title    { font-size: 1.5rem; text-align: center; margin-bottom: .4rem; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.75rem; font-size: .9rem; }
.auth-divider  { position: relative; text-align: center; margin: 1.25rem 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { position: relative; background: var(--bg); padding: 0 .75rem; color: var(--text-muted); font-size: .8rem; }
.auth-footer { text-align: center; font-size: .875rem; color: var(--text-muted); margin-top: 1.5rem; }
.auth-footer a { color: var(--primary); }

/* ─── User Area ──────────────────────────────────────────── */
.user-layout { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 768px) { .user-layout { grid-template-columns: 1fr; } }
.user-sidebar { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; position: sticky; top: 80px; }
.sidebar-avatar { display: flex; align-items: center; gap: .875rem; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.sidebar-img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.sidebar-name { font-weight: 600; font-size: .9rem; display: block; }
.sidebar-role { font-size: .75rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar-link { display: flex; align-items: center; gap: .625rem; padding: .55rem .75rem; border-radius: 8px; color: var(--text-muted); font-size: .875rem; transition: all var(--transition); }
.sidebar-link:hover, .sidebar-link.active { background: rgba(79,70,229,.1); color: var(--text); }
.nav-icon { width: 16px; height: 16px; }
.sidebar-logout { display: block; margin-top: 1.5rem; padding: .55rem .75rem; text-align: center; background: rgba(239,68,68,.1); color: #f87171; border-radius: 8px; font-size: .875rem; }
.user-title { font-size: 1.5rem; margin-bottom: 1.5rem; }
.user-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.dash-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; gap: 1rem; align-items: flex-start; }
.dash-card-icon { font-size: 1.5rem; }
.dash-card-body h3 { font-size: .9rem; color: var(--text-muted); margin-bottom: .3rem; }
.dash-count { font-size: 1.25rem; font-weight: 700; }
.dash-link { font-size: .8rem; color: var(--primary); }

/* Tickets */
.tickets-list { display: flex; flex-direction: column; gap: .5rem; }
.ticket-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; transition: background var(--transition); }
.ticket-row:hover { background: var(--bg-elevated); }
.ticket-main { display: flex; align-items: center; gap: .75rem; }
.ticket-id { font-size: .75rem; color: var(--text-muted); font-family: monospace; }
.ticket-subject { font-weight: 500; }
.ticket-meta { display: flex; align-items: center; gap: .625rem; font-size: .8rem; color: var(--text-muted); }

/* Ticket messages */
.ticket-messages { display: flex; flex-direction: column; gap: 1rem; }
.ticket-message { display: flex; gap: 1rem; }
.msg-staff { flex-direction: row-reverse; }
.msg-staff .msg-body { background: rgba(79,70,229,.1); border-color: rgba(79,70,229,.2); }
.msg-internal .msg-body { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.2); }
.msg-body { flex: 1; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.msg-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .8rem; }
.msg-author { font-weight: 600; }
.msg-time { color: var(--text-muted); margin-left: auto; }
.msg-content { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.ticket-reply-form { margin-top: 1.5rem; }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: .375rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.page-btn { display: flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 .5rem; border-radius: 8px; background: var(--bg-surface); border: 1px solid var(--border); color: var(--text-muted); font-size: .875rem; transition: all var(--transition); }
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ─── Error pages ────────────────────────────────────────── */
.error-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.error-inner { text-align: center; max-width: 480px; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); opacity: .3; line-height: 1; margin-bottom: .5rem; }
.error-title { font-size: 1.75rem; margin-bottom: .75rem; }
.error-desc { color: var(--text-muted); margin-bottom: 2rem; }

/* ─── Empty states ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

/* ─── Spacing utilities ──────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2.5rem; }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-0  { padding: 0; }
.p-1  { padding: .25rem; }
.p-2  { padding: .5rem; }
.p-3  { padding: 1rem; }
.p-4  { padding: 1.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }

/* ─── Display utilities ──────────────────────────────────────── */
.d-flex          { display: flex; }
.d-grid          { display: grid; }
.d-none          { display: none; }
.d-block         { display: block; }
.flex-column     { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.align-center    { align-items: center; }
.align-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* ─── Text utilities ─────────────────────────────────────────── */
.text-left   { text-align: left; }
.text-right  { text-align: right; }
.text-sm     { font-size: .875rem; }
.text-xs     { font-size: .75rem; }
.text-lg     { font-size: 1.125rem; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning{ color: var(--warning); }
.text-info   { color: var(--info); }
.text-primary{ color: var(--primary); }

/* ─── Border / shape utilities ───────────────────────────────── */
.rounded      { border-radius: var(--radius); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 999px; }
.border       { border: 1px solid var(--border); }

/* ─── Width / sizing utilities ───────────────────────────────── */
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.w-auto   { width: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* ─── Detail list ────────────────────────────────────────── */
.detail-list { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: .875rem; }
.detail-list dt { color: var(--text-muted); }
.detail-list dd { font-weight: 500; }

/* ─── Footer ─────────────────────────────────────────────── */
footer { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { font-size: .875rem; font-weight: 700; margin-bottom: .875rem; color: var(--text); }
.footer-col ul { list-style: none; }
.footer-col li + li { margin-top: .4rem; }
.footer-col a { color: var(--text-muted); font-size: .875rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; gap: .5rem; }
.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-link { display: flex; align-items: center; gap: .375rem; padding: .4rem .75rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; color: var(--text-muted); transition: all var(--transition); }
.social-link:hover { border-color: var(--primary); color: var(--text); }

/* ─── RESPONSIVE – TABLET (≤ 1024px) ────────────────────── */
@media (max-width: 1024px) {
  .section { padding: 4rem 0; }
  .user-layout { grid-template-columns: 200px 1fr; gap: 1.5rem; }
  .news-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .team-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

/* ─── RESPONSIVE – MOBILE (≤ 768px) ─────────────────────── */
@media (max-width: 768px) {
  /* Container: tighter padding */
  .container,
  .container-narrow { padding: 0 1rem; }

  /* Typography: clamp values already handle this, but add minimums */
  h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
  h2 { font-size: clamp(1.2rem, 4vw, 1.75rem); }

  /* Sections: less vertical space */
  .section { padding: 3rem 0; }
  .section-sm { padding: 1.75rem 0; }

  /* Page hero: reduce top padding */
  .page-hero { padding: 4rem 0 2rem; }
  .page-hero-subtitle { font-size: .95rem; }

  /* Prevent iOS font zoom on form inputs – CRITICAL */
  .form-control,
  .form-control-lg,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="url"],
  input[type="search"],
  input[type="tel"],
  select,
  textarea { font-size: 16px; }

  /* Buttons: larger touch targets */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; font-size: .8rem; }

  /* User layout: stacked on mobile */
  .user-layout { grid-template-columns: 1fr; gap: 1.25rem; }

  /* User sidebar: not sticky on mobile (takes too much space) */
  .user-sidebar { position: static; }

  /* Ticket rows: stack subject + meta */
  .ticket-row { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .ticket-meta { flex-wrap: wrap; gap: .4rem; }

  /* Ticket messages: no avatar offset on mobile */
  .ticket-message { gap: .5rem; }
  .msg-staff { flex-direction: column-reverse; }

  /* Status card: wrap on narrow screens */
  .status-card { flex-wrap: wrap; gap: .75rem; padding: 1rem; }

  /* Detail list: single column on small screens */
  .detail-list { grid-template-columns: 1fr; }
  .detail-list dt { margin-top: .5rem; }
  .detail-list dt:first-child { margin-top: 0; }

  /* Gallery: smaller min tile */
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }

  /* Card: reduce padding */
  .card-body { padding: 1.25rem; }
  .card-header { padding: 1rem 1.25rem; }

  /* Footer */
  footer { padding: 2.5rem 0 1.25rem; }
  .footer-bottom { flex-direction: column; text-align: center; gap: 1rem; }
  .social-links { justify-content: center; }

  /* Auth page: less top space */
  .auth-section { padding: 2rem 0; }
  .auth-card { padding: 0 .5rem; }

  /* Pagination: smaller buttons */
  .page-btn { min-width: 32px; height: 32px; font-size: .8rem; }

  /* Error page */
  .error-code { font-size: 4rem; }
  .error-title { font-size: 1.4rem; }
}

/* ─── RESPONSIVE – SMALL MOBILE (≤ 480px) ───────────────── */
@media (max-width: 480px) {
  .container,
  .container-narrow { padding: 0 .875rem; }

  /* Sections */
  .section { padding: 2.25rem 0; }

  /* Hero */
  .page-hero { padding: 3rem 0 1.5rem; }

  /* News: single column */
  .news-grid { grid-template-columns: 1fr; gap: 1rem; }

  /* Team: 2 columns max */
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

  /* Gallery: 2 columns */
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: .5rem; }

  /* Cards */
  .card-body { padding: 1rem; }

  /* Buttons: full-width pattern */
  .btn-block-mobile { width: 100% !important; justify-content: center; }

  /* User sidebar: more compact */
  .user-sidebar { padding: 1rem; }
  .sidebar-avatar { margin-bottom: 1rem; padding-bottom: 1rem; }

  /* Announcement bar: center text, smaller font */
  .announcement-bar { font-size: .8rem; padding: .5rem .75rem; flex-wrap: wrap; }

  /* Footer columns: 2 per row */
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* ─── RESPONSIVE – VERY SMALL (≤ 360px) ─────────────────── */
@media (max-width: 360px) {
  .container,
  .container-narrow { padding: 0 .75rem; }
  .navbar { padding: 0 .75rem; }
  .team-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
