/* ============================================
   Abuse Center - Main Stylesheet
   Professional & Minimalist
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg:          #F8F7F4;
  --surface:     #FFFFFF;
  --surface-2:   #F1F0ED;
  --border:      #E2E0DB;
  --border-2:    #C9C7C0;
  --text:        #1A1916;
  --text-2:      #5C5A55;
  --text-3:      #9C9A94;
  --accent:      #1A1916;
  --accent-inv:  #F8F7F4;
  --red:         #C0392B;
  --orange:      #D35400;
  --green:       #1A7A4A;
  --blue:        #1A4B8C;
  --yellow:      #B7860B;
  --purple:      #6B21A8;
  --radius:      6px;
  --radius-lg:   10px;
  --shadow:      0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg:   0 4px 16px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);
  --transition:  150ms ease;
  --font:        'IBM Plex Sans', system-ui, sans-serif;
  --mono:        'IBM Plex Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Typography ─────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; }
p  { color: var(--text-2); }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
small { font-size: .8rem; color: var(--text-3); }
code  { font-family: var(--mono); font-size: .875em; background: var(--surface-2); padding: 1px 5px; border-radius: 3px; }

/* ── Layout ──────────────────────────────── */
.container    { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 680px; margin: 0 auto; padding: 0 24px; }

/* ── Public Nav ──────────────────────────── */
.pub-nav {
  background: var(--text);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.pub-nav .logo {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.pub-nav .logo span {
  font-weight: 300;
  opacity: .6;
}
.pub-nav-links { display: flex; gap: 4px; }
.pub-nav-links a {
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all var(--transition);
}
.pub-nav-links a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }

/* ── Hero ─────────────────────────────────── */
.hero {
  background: var(--text);
  color: #fff;
  padding: 72px 32px;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; color: #fff; margin-bottom: 16px; }
.hero p  { color: rgba(255,255,255,.65); font-size: 1.1rem; max-width: 520px; margin: 0 auto 32px; }

/* ── Cards ───────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; }

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 20px; }
label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-2);
}
label .req { color: var(--red); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(26,25,22,.08);
}
textarea { resize: vertical; min-height: 120px; }
select   { cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--text-3); margin-top: 4px; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover { background: #333; text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { background: var(--surface-2); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: #a93226; text-decoration: none; color: #fff; }
.btn-success { background: var(--green); color: #fff; border-color: var(--green); }
.btn-success:hover { background: #156b40; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Badges ──────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
  font-family: var(--mono);
  letter-spacing: 0.02em;
}
.badge-open     { background: #EBF5FB; color: #1A4B8C; border: 1px solid #BDD7F5; }
.badge-progress { background: #FEF9E7; color: #B7860B; border: 1px solid #FAE5A0; }
.badge-waiting  { background: #F4ECF7; color: #6B21A8; border: 1px solid #DABCF0; }
.badge-resolved { background: #EAFAF1; color: #1A7A4A; border: 1px solid #A9DFBF; }
.badge-closed   { background: #F2F3F4; color: #5C5A55; border: 1px solid #D5D8DC; }
.badge-spam     { background: #FDEDEC; color: #C0392B; border: 1px solid #F5B7B1; }

.prio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .75rem;
  font-weight: 600;
  font-family: var(--mono);
}
.prio-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.prio-low::before      { background: var(--green); }
.prio-medium::before   { background: var(--yellow); }
.prio-high::before     { background: var(--orange); }
.prio-critical::before { background: var(--red); }
.prio-low      { color: var(--green); }
.prio-medium   { color: var(--yellow); }
.prio-high     { color: var(--orange); }
.prio-critical { color: var(--red); }

/* ── Alert / Flash ───────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-success { background: #EAFAF1; color: #1A7A4A; border: 1px solid #A9DFBF; }
.alert-error   { background: #FDEDEC; color: #C0392B; border: 1px solid #F5B7B1; }
.alert-warning { background: #FEF9E7; color: #B7860B; border: 1px solid #FAE5A0; }
.alert-info    { background: #EBF5FB; color: #1A4B8C; border: 1px solid #BDD7F5; }

/* ── Table ───────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
table th {
  text-align: left;
  padding: 10px 14px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: var(--surface-2); }

/* ── Stats Grid ──────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: 6px; }
.stat-value { font-size: 2rem; font-weight: 700; font-family: var(--mono); letter-spacing: -0.04em; line-height: 1; }
.stat-sub   { font-size: .78rem; color: var(--text-3); margin-top: 4px; }

/* ── Pagination ──────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--surface);
  text-decoration: none;
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination .active { background: var(--text); color: #fff; border-color: var(--text); }
.pagination .disabled { opacity: .4; pointer-events: none; }

/* ── Category Chips ──────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 32px 0;
}
.cat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: block;
}
.cat-chip:hover { border-color: var(--text); box-shadow: var(--shadow-lg); text-decoration: none; transform: translateY(-1px); }
.cat-chip .cat-icon { font-size: 1.4rem; margin-bottom: 10px; }
.cat-chip .cat-name { font-weight: 600; font-size: .9rem; color: var(--text); margin-bottom: 4px; }
.cat-chip .cat-desc { font-size: .78rem; color: var(--text-3); line-height: 1.5; }

/* ── Admin Layout ────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background: var(--text);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo h1 { color: #fff; font-size: .95rem; font-weight: 700; }
.sidebar-logo p  { color: rgba(255,255,255,.4); font-size: .72rem; margin-top: 2px; }

.sidebar-nav { padding: 12px 0; flex: 1; }
.sidebar-section {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.35);
  padding: 16px 20px 6px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,.65);
  font-size: .85rem;
  transition: all var(--transition);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.07); text-decoration: none; }
.sidebar-nav a.active { color: #fff; background: rgba(255,255,255,.1); border-left-color: #fff; }
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .78rem;
  color: rgba(255,255,255,.4);
}

.admin-main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar h2 { font-size: 1rem; font-weight: 600; }
.admin-topbar .topbar-actions { display: flex; align-items: center; gap: 12px; }
.admin-topbar .user-info { font-size: .82rem; color: var(--text-2); }

.admin-content { padding: 28px; flex: 1; }

/* ── Filters Bar ─────────────────────────── */
.filters-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}
.filters-bar select, .filters-bar input {
  width: auto;
  padding: 7px 10px;
  font-size: .82rem;
}
.filters-bar .spacer { flex: 1; }

/* ── Ticket Detail ───────────────────────── */
.ticket-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
}
.ticket-meta { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; }
.ticket-meta-item { }
.ticket-meta-item dt { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ticket-meta-item dd { font-size: .875rem; color: var(--text); margin-top: 2px; }

.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.comment.internal { background: #FFFDE7; border-color: #FAE5A0; }
.comment.system   { background: var(--surface-2); border-style: dashed; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: .8rem; color: var(--text-3); }
.comment-author { font-weight: 600; color: var(--text); }
.comment-body p { color: var(--text); line-height: 1.6; white-space: pre-wrap; }

/* ── Login Page ──────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 1.3rem; }
.login-logo p  { font-size: .82rem; color: var(--text-3); margin-top: 4px; }

/* ── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { margin-left: 0; }
  .admin-wrap { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.8rem; }
}

/* ── Utility ─────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-3); }
.text-sm { font-size: .82rem; }
.mono { font-family: var(--mono); }
.text-right { text-align: right; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ── Divider ─────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Empty State ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
}
.empty-state svg { opacity: .3; margin-bottom: 16px; }
.empty-state h3 { color: var(--text-2); margin-bottom: 6px; }
