@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;600;700&display=swap');

:root {
  --blue: #0095c9;
  --yellow: #fff24b;
  --red: #db3832;
  --ink: #1a1a1a;
  --paper: #f7fbfe;
  --card: #ffffff;
  --shadow: rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #e8f6fc, #fefefe 55%),
    linear-gradient(135deg, #fff24b22, #0095c915);
}

.admin-body {
  background: #f2f6f9;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

.header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 8px 24px var(--shadow);
}

.header img {
  height: 52px;
}

.header h1 {
  font-size: 1.35rem;
  margin: 0;
}

.subtitle {
  color: #4c6069;
  font-size: 0.95rem;
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 20px var(--shadow);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand img {
  height: 48px;
  background: white;
  border-radius: 10px;
  padding: 6px;
}

.brand-title {
  font-weight: 700;
  color: #fff;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: #94a3b8;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-nav a {
  text-decoration: none;
  color: #cbd5f5;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

.admin-nav a.active {
  background: #0095c9;
  color: #fff;
}

.admin-sidebar-footer {
  margin-top: auto;
}

.admin-content {
  padding: 24px 28px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.admin-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 6px 18px var(--shadow);
}

.stat-label {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 600;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 6px 0;
}

.stat-meta {
  font-size: 0.85rem;
  color: #64748b;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-bar label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.filter-bar input,
.filter-bar select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1dbe4;
}

.period-hint {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed #cbd5f5;
  background: #f8fafc;
  font-size: 0.85rem;
  color: #475569;
}

.rate-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 10px;
}

.inline-form {
  margin: 0;
}

.divider {
  height: 1px;
  background: #e5edf3;
  margin: 16px 0;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-weight: 600;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-field {
  flex: 1;
  min-width: 220px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #d6e2ea;
  font-size: 1rem;
  font-family: inherit;
  background: #fbfdff;
}


.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-link {
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--yellow);
  color: #1b1b1b;
  font-weight: 700;
  font-size: 0.9rem;
}

.password-input {
  border-color: #c9e8f6;
  background: linear-gradient(180deg, #f7fbff, #ffffff 55%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.password-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 149, 201, 0.2);
}

.fine-row {
  border: 1px dashed #d7e4ec;
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 10px;
}

.fine-row .toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.fine-details {
  margin-top: 10px;
  display: none;
}

.fine-details.active {
  display: block;
}

.summary {
  background: #f0fbff;
  border: 1px solid #c9e8f6;
  border-radius: 16px;
  padding: 12px;
}

.summary.locked {
  background: #eef7f2;
  border-color: #cfe6da;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #db3832;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.summary ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.summary li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #d9eef8;
}

.summary li:last-child {
  border-bottom: none;
}

.total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 10px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

button {
  padding: 12px 18px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 8px 18px rgba(0, 149, 201, 0.35);
}

button.secondary {
  background: var(--yellow);
  color: #1b1b1b;
}

button.alert {
  background: var(--red);
  color: white;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.notice {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7d6;
  font-size: 0.95rem;
}

.ticket-box {
  border: 1px solid #d0e4ee;
  border-radius: 16px;
  padding: 12px;
  background: #f6fbff;
}

.ticket-box h3 {
  margin: 0 0 6px;
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header img {
    height: 46px;
  }

  .actions button {
    width: 100%;
  }
}

.print-body {
  width: 80mm;
  padding: 8mm 6mm;
  font-family: "Barlow", "Segoe UI", sans-serif;
  color: #000;
}

.print-header {
  text-align: center;
  margin-bottom: 8px;
}

.print-header img {
  max-height: 40px;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.print-table th,
.print-table td {
  padding: 4px 0;
  border-bottom: 1px dashed #333;
}

.print-total {
  font-weight: 700;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
}

.qr-block {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
}

.qr-block img {
  width: 90px;
  height: 90px;
}

.qr-caption {
  margin-top: 4px;
  font-weight: 600;
}

.qr-link {
  word-break: break-all;
  color: #333;
}

@media print {
  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }
}
