/* ── PVD Consulting Design System ── */
@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #f4f6fb;
  --white: #ffffff;
  --surface: #ffffff;
  --surface2: #f0f3f9;
  --border: #dde3f0;
  --border-light: #eef1f8;
  --blue: #1a3a6b;
  --blue-mid: #2352a0;
  --blue-light: #3b6fd4;
  --blue-pale: #e8edf8;
  --red: #c8152a;
  --red-light: #e8192f;
  --red-pale: #fdecea;
  --text: #111827;
  --text-mid: #374151;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(26,58,107,0.08), 0 4px 16px rgba(26,58,107,0.06);
  --shadow-lg: 0 4px 24px rgba(26,58,107,0.12), 0 1px 4px rgba(26,58,107,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Figtree', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; -webkit-font-smoothing: antialiased; }
body::before { content: ''; position: fixed; inset: 0; background-image: radial-gradient(circle, rgba(26,58,107,0.05) 1px, transparent 1px); background-size: 24px 24px; pointer-events: none; z-index: 0; }

/* HEADER */
header { position: sticky; top: 0; z-index: 100; background: var(--blue); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 62px; box-shadow: 0 2px 12px rgba(26,58,107,0.3); }
.logo { font-family: 'Figtree', sans-serif; font-weight: 800; font-size: 1.1rem; letter-spacing: -0.3px; display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.logo-badge { background: var(--red); color: #fff; font-size: 0.6rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; padding: 3px 8px; border-radius: 4px; }
.logo-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }
.logo-sub { font-size: 0.75rem; font-weight: 400; color: rgba(255,255,255,0.65); }

/* BUTTONS */
.btn { font-family: 'Figtree', sans-serif; font-size: 0.875rem; font-weight: 600; border: none; border-radius: var(--radius); padding: 10px 22px; cursor: pointer; transition: all 0.18s; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn-primary { background: var(--blue-light); color: #fff; box-shadow: 0 2px 8px rgba(59,111,212,0.35); }
.btn-primary:hover { background: var(--blue-mid); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,111,212,0.4); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(200,21,42,0.3); }
.btn-red:hover { background: var(--red-light); transform: translateY(-1px); }
.btn-secondary { background: var(--surface2); color: var(--text-mid); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: rgba(255,255,255,0.8); border: 1px solid rgba(255,255,255,0.25); font-size: 0.8rem; padding: 6px 14px; }
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-danger { background: var(--red-pale); color: var(--red); border: 1px solid rgba(200,21,42,0.2); }
.btn-danger:hover { background: rgba(200,21,42,0.15); }

/* FORM */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem; }
label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
input, select, textarea { background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: 'Figtree', sans-serif; font-size: 0.9rem; padding: 10px 14px; outline: none; width: 100%; transition: border-color 0.18s, box-shadow 0.18s; }
input::placeholder, textarea::placeholder { color: var(--muted-light); }
input:focus, select:focus, textarea:focus { border-color: var(--blue-light); box-shadow: 0 0 0 3px rgba(59,111,212,0.12); }
select option { background: var(--surface); }
textarea { resize: vertical; min-height: 100px; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow); }
.card-blue-top { overflow: hidden; position: relative; }
.card-blue-top::before { content: ''; display: block; height: 3px; margin: -1.75rem -1.75rem 1.5rem; background: linear-gradient(90deg, var(--blue), var(--blue-light)); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }

/* BADGES */
.badge { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3px; padding: 3px 10px; border-radius: 20px; display: inline-flex; align-items: center; }
.badge-open     { background: #dbeafe; color: #1d4ed8; }
.badge-progress { background: #fef3c7; color: #b45309; }
.badge-resolved { background: #dcfce7; color: #15803d; }
.badge-closed   { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge-high     { background: var(--red-pale); color: var(--red); }
.badge-medium   { background: #fef3c7; color: #b45309; }
.badge-low      { background: #dcfce7; color: #15803d; }

/* TOAST */
.toast { position: fixed; bottom: 2rem; right: 2rem; z-index: 9999; background: var(--white); border-radius: 10px; padding: 1rem 1.5rem; font-size: 0.875rem; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; transform: translateX(120%); transition: transform 0.3s ease; border-left: 4px solid var(--blue-light); }
.toast.show { transform: translateX(0); }
.toast.success { border-left-color: #16a34a; }
.toast.error   { border-left-color: var(--red); }

/* LABELS */
.mono-label { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; letter-spacing: 1.5px; color: var(--blue-light); text-transform: uppercase; }
.section-title { font-size: 0.7rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* HERO */
.page-hero { margin-bottom: 2rem; }
.page-hero h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.5px; color: var(--blue); margin-bottom: 6px; }
.page-hero p { color: var(--muted); font-size: 0.95rem; }

/* STATS */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
.stat-card.blue::after  { background: var(--blue-light); }
.stat-card.red::after   { background: var(--red); }
.stat-card.green::after { background: #16a34a; }
.stat-val { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-card.blue  .stat-val { color: var(--blue); }
.stat-card.red   .stat-val { color: var(--red); }
.stat-card.green .stat-val { color: #16a34a; }
.stat-lbl { font-size: 0.75rem; color: var(--muted); font-weight: 500; }

/* FILTER PILLS */
.filter-pill { font-size: 0.78rem; font-weight: 600; background: transparent; border: 1.5px solid var(--border); color: var(--muted); padding: 5px 14px; border-radius: 20px; cursor: pointer; transition: all 0.18s; }
.filter-pill:hover { border-color: var(--blue-light); color: var(--blue-light); }
.filter-pill.active { border-color: var(--blue-light); color: var(--blue-light); background: var(--blue-pale); }

/* TICKET ROWS */
.ticket-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; cursor: pointer; transition: all 0.18s; position: relative; overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); margin-bottom: 8px; }
.ticket-row:hover { border-color: var(--blue-light); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.ticket-row .prio-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.ticket-row.high   .prio-bar { background: var(--red); }
.ticket-row.medium .prio-bar { background: #f59e0b; }
.ticket-row.low    .prio-bar { background: #16a34a; }
.ticket-id-badge { font-family: 'IBM Plex Mono', monospace; font-size: 0.68rem; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
.ticket-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; color: var(--blue); }
.ticket-meta { font-size: 0.78rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }
.ticket-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ticket-time { font-family: 'IBM Plex Mono', monospace; font-size: 0.65rem; color: var(--muted-light); }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(17,24,39,0.5); backdrop-filter: blur(4px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(16px); transition: transform 0.2s; }
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header { padding: 1.5rem 1.5rem 0; display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--blue); }
.modal-close { background: var(--surface2); border: 1px solid var(--border); color: var(--muted); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 0 1.5rem 1.5rem; }

/* PRIORITY BTNS */
.priority-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.prio-btn { background: var(--surface2); border: 1.5px solid var(--border); border-radius: var(--radius); color: var(--muted); font-family: 'Figtree', sans-serif; font-size: 0.8rem; font-weight: 600; padding: 8px; cursor: pointer; text-align: center; transition: all 0.18s; }
.prio-btn:hover { border-color: var(--muted); color: var(--text-mid); }
.prio-btn.sel-low    { border-color: #16a34a; color: #15803d; background: #dcfce7; }
.prio-btn.sel-medium { border-color: #f59e0b; color: #b45309; background: #fef3c7; }
.prio-btn.sel-high   { border-color: var(--red); color: var(--red); background: var(--red-pale); }

/* COMMENTS */
.comment { border-left: 3px solid var(--border); padding-left: 12px; margin-bottom: 14px; }
.comment.admin-c { border-color: var(--blue-light); }
.c-meta { font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; font-family: 'IBM Plex Mono', monospace; }
.c-meta .who { color: var(--text); font-weight: 600; }
.comment.admin-c .c-meta .who { color: var(--blue); }

/* MSGS */
.error-msg { background: var(--red-pale); border: 1px solid rgba(200,21,42,0.2); border-radius: var(--radius); padding: 10px 14px; font-size: 0.82rem; color: var(--red); margin-bottom: 1rem; display: none; }
.error-msg.show { display: block; }
.success-msg { background: #dcfce7; border: 1px solid #86efac; border-radius: var(--radius); padding: 10px 14px; font-size: 0.82rem; color: #15803d; margin-bottom: 1rem; display: none; }
.success-msg.show { display: block; }

/* ANIMATIONS */
@keyframes fadeUp { from { opacity:0; transform: translateY(16px); } to { opacity:1; transform: translateY(0); } }
.fade-up   { animation: fadeUp 0.4s ease both; }
.fade-up-1 { animation: fadeUp 0.4s 0.08s ease both; }
.fade-up-2 { animation: fadeUp 0.4s 0.16s ease both; }
.fade-up-3 { animation: fadeUp 0.4s 0.24s ease both; }

/* LAYOUT */
.container    { max-width: 1100px; margin: 0 auto; padding: 2rem; position: relative; z-index: 1; }
.container-sm { max-width: 460px; margin: 0 auto; padding: 2rem; position: relative; z-index: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.full { grid-column: 1 / -1; }

/* SPINNER */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; animation: spin 0.7s linear infinite; display: inline-block; }
.spinner.dark { border-color: var(--border); border-top-color: var(--blue-light); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .container { padding: 1.25rem 1rem; }
  .stats-row { grid-template-columns: 1fr; gap: 8px; }
  .ticket-row { grid-template-columns: 1fr; }
  .ticket-right { flex-direction: row; align-items: center; }
}
