/* ============================================================
   LAYANAN MAHASISWA — style.css
   Tema: Institutional Clean · Accent Biru Tua & Kuning Kampus
   Font: Sora (display) + Plus Jakarta Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:          #F0F4FA;
  --surface:     #FFFFFF;
  --surface2:    #EAF0FB;
  --border:      #D4DDF0;
  --primary:     #1A3A6B;
  --primary-lt:  #2C5BAD;
  --accent:      #F5B800;
  --accent-dk:   #D49F00;
  --danger:      #D63031;
  --success:     #00897B;
  --warn:        #E67E22;
  --text:        #1A2340;
  --text-muted:  #6B7A99;
  --shadow:      0 2px 16px rgba(26,58,107,.10);
  --shadow-lg:   0 8px 40px rgba(26,58,107,.18);
  --radius:      14px;
  --radius-sm:   8px;
  --transition:  .22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ── Header / Navbar ────────────────────────────────────── */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.navbar-brand {
  display: flex; align-items: center; gap: .75rem;
  font-family: 'Sora', sans-serif;
  font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em;
}
.navbar-brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.navbar-actions { display: flex; align-items: center; gap: .75rem; }

/* ── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.card-sm { padding: 1.25rem 1.5rem; }
.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--primary); margin-bottom: 1rem;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem; border: none; border-radius: var(--radius-sm);
  padding: .65rem 1.4rem; font-size: .95rem; font-weight: 600;
  transition: var(--transition); white-space: nowrap;
}
.btn-primary   { background: var(--primary);   color: #fff; }
.btn-primary:hover { background: var(--primary-lt); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(26,58,107,.25); }
.btn-accent    { background: var(--accent);    color: var(--primary); }
.btn-accent:hover { background: var(--accent-dk); transform: translateY(-1px); }
.btn-danger    { background: var(--danger);    color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-success   { background: var(--success);   color: #fff; }
.btn-success:hover { opacity: .88; }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--surface2); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface2); color: var(--primary); }
.btn-lg        { padding: .9rem 2.2rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm        { padding: .4rem .9rem; font-size: .84rem; }
.btn-icon      { width: 38px; height: 38px; padding: 0; border-radius: 50%; }
.btn:disabled  { opacity: .45; pointer-events: none; }
.btn-block     { width: 100%; }

/* ── Badge / Status ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .75rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; letter-spacing: .03em;
}
.badge-menunggu { background: #FFF3CD; color: #856404; }
.badge-diproses { background: #CCE5FF; color: #004085; }
.badge-selesai  { background: #D4EDDA; color: #155724; }
.badge-eskalasi { background: #F8D7DA; color: #721C24; }
.badge-online   { background: #D4EDDA; color: #155724; }
.badge-offline  { background: #E2E6EA; color: #495057; }
.badge .dot-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(.75); }
}

/* ── Form ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 1.15rem; }
.form-label  { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--primary); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .65rem .95rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(44,91,173,.13);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-hint { font-size: .82rem; color: var(--text-muted); margin-top: .3rem; }

/* ── Ticket Card ────────────────────────────────────────── */
.ticket-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.ticket-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px; background: var(--accent);
  border-radius: 4px 0 0 4px;
}
.ticket-card.status-menunggu::before { background: var(--accent); }
.ticket-card.status-diproses::before { background: var(--primary-lt); }
.ticket-card.status-selesai::before  { background: var(--success); }
.ticket-card.status-eskalasi::before { background: var(--danger); }
.ticket-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.ticket-id {
  font-family: 'Sora', monospace; font-size: .78rem; font-weight: 700;
  color: var(--text-muted); letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: .5rem;
}
.ticket-name { font-size: 1.05rem; font-weight: 700; color: var(--primary); }
.ticket-nim  { font-size: .88rem; color: var(--text-muted); }
.ticket-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: .75rem; font-size: .85rem;
}
.ticket-meta-item {
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: .25rem .6rem; color: var(--text-muted);
}
.ticket-actions {
  display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap;
}

/* ── Page Container ─────────────────────────────────────── */
.page-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
.page-header { margin-bottom: 2rem; }
.page-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.7rem; font-weight: 800; color: var(--primary);
  line-height: 1.2;
}
.page-sub { color: var(--text-muted); margin-top: .35rem; font-size: .95rem; }

/* ── Grid ───────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── Stat Box ───────────────────────────────────────────── */
.stat-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem 1.5rem;
  display: flex; align-items: center; gap: 1.1rem;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.yellow { background: #FFF3CD; }
.stat-icon.blue   { background: #CCE5FF; }
.stat-icon.green  { background: #D4EDDA; }
.stat-icon.red    { background: #F8D7DA; }
.stat-value { font-family: 'Sora', sans-serif; font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .85rem; color: var(--text-muted); margin-top: .2rem; }

/* ── QR / Scanner Area ──────────────────────────────────── */
.scanner-wrapper {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.5rem; padding: 2rem;
}
#qr-reader {
  width: 100% !important; max-width: 400px;
  border-radius: var(--radius); overflow: hidden;
  border: 3px solid var(--primary);
}
.scanner-manual {
  width: 100%; max-width: 400px;
}
.scan-divider {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: .85rem; width: 100%; max-width: 400px;
}
.scan-divider::before, .scan-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Ticket Display (mahasiswa) ─────────────────────────── */
.ticket-display {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lt) 100%);
  color: #fff; border-radius: var(--radius);
  padding: 2rem; text-align: center; position: relative; overflow: hidden;
}
.ticket-display::after {
  content: '';
  position: absolute; right: -30px; bottom: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.ticket-number {
  font-family: 'Sora', sans-serif;
  font-size: 3.5rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--accent); line-height: 1;
}
.ticket-display-name { font-size: 1.3rem; font-weight: 700; margin-top: .5rem; }
.ticket-display-nim  { opacity: .75; margin-top: .25rem; }
.ticket-display-status { margin-top: 1.25rem; }

/* ── Alert / Toast ──────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm); padding: .85rem 1.15rem;
  font-size: .93rem; font-weight: 500; margin-bottom: 1rem;
  display: flex; align-items: flex-start; gap: .75rem;
}
.alert-success { background: #D4EDDA; color: #155724; border-left: 4px solid var(--success); }
.alert-danger  { background: #F8D7DA; color: #721C24; border-left: 4px solid var(--danger); }
.alert-info    { background: #CCE5FF; color: #004085; border-left: 4px solid var(--primary-lt); }
.alert-warn    { background: #FFF3CD; color: #856404; border-left: 4px solid var(--accent); }

#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column; gap: .6rem; min-width: 280px;
}
.toast {
  background: var(--surface); border-radius: var(--radius-sm);
  padding: .85rem 1.15rem; box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary-lt);
  font-size: .9rem; font-weight: 500;
  animation: slideInRight .25s var(--transition);
}
.toast.success { border-color: var(--success); }
.toast.danger  { border-color: var(--danger); }
.toast.warn    { border-color: var(--warn); }
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 200; display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 2rem; max-width: 480px; width: 95%;
  box-shadow: var(--shadow-lg);
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { transform: scale(.95) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-title {
  font-family: 'Sora', sans-serif; font-size: 1.2rem; font-weight: 700;
  color: var(--primary); margin-bottom: 1.25rem;
}
.modal-actions { display: flex; gap: .75rem; margin-top: 1.5rem; justify-content: flex-end; }

/* ── Loader ─────────────────────────────────────────────── */
.loader {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Table ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  background: var(--primary); color: #fff; padding: .75rem 1rem;
  text-align: left; font-weight: 600; font-size: .83rem;
  letter-spacing: .04em; text-transform: uppercase;
}
td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--surface2); }
tr:last-child td { border-bottom: none; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; gap: .25rem; background: var(--surface2); border-radius: var(--radius-sm); padding: .3rem; margin-bottom: 1.5rem; }
.tab-btn {
  flex: 1; border: none; background: transparent;
  padding: .55rem 1rem; border-radius: 6px; font-weight: 600; font-size: .88rem;
  color: var(--text-muted); transition: var(--transition);
}
.tab-btn.active {
  background: var(--surface); color: var(--primary);
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
}

/* ── Empty State ────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: .75rem; opacity: .4; }
.empty-state-msg  { font-size: 1rem; font-weight: 500; }

/* ── Login Page ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-lt) 60%, #3a7bd5 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.login-box {
  background: var(--surface); border-radius: 20px;
  padding: 2.5rem 2rem; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative; z-index: 1;
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo-title {
  font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 800;
  color: var(--primary); line-height: 1.2;
}
.login-logo-sub { color: var(--text-muted); font-size: .88rem; margin-top: .3rem; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .page-container { padding: 1.25rem .85rem; }
  .card { padding: 1.25rem; }
  .ticket-number { font-size: 2.5rem; }
  .navbar { padding: 0 1rem; }
  .page-title { font-size: 1.35rem; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .navbar, .btn, .ticket-actions { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}