/* Kiosk dashboard — shared hosting friendly helpers (Tailwind handles the shell) */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif !important;
}

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --black: #0f172a;
  --brand: #0d9488;
  --brand-dark: #0f766e;
  --gradient: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  --radius: 1rem;
  --radius-sm: 0.75rem;
  --pill: 999px;
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
}

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

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  color: var(--text);
  direction: rtl;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* Auth pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: #f3f4f6;
  border-radius: 28px;
  padding: 40px 36px 32px;
}

.auth-card h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
}

.auth-card .subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.auth-card .otp-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  text-align: center;
}

.auth-card .otp-phone {
  display: inline-block;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.02em;
}

.auth-card .otp-edit-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .15s ease;
}

.auth-card .otp-edit-phone:hover {
  color: var(--brand-dark);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #555;
}

.input {
  width: 100%;
  height: 52px;
  border: 1px solid #d7d9de;
  border-radius: var(--pill);
  padding: 0 20px;
  background: #fff;
  outline: none;
  font-size: 15px;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15); }
.textarea {
  width: 100%;
  min-height: 110px;
  border: 1px solid #d7d9de;
  border-radius: 18px;
  padding: 14px 18px;
  resize: vertical;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost {
  background: #fff;
  color: var(--black);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: #ef4444; color: #fff; }
.link-muted {
  display: block;
  text-align: center;
  margin: 14px 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

/* Content helpers used by create/show/manager pages */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card + .card { margin-top: 18px; }
.card-title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.stat-card {
  background: var(--black);
  color: #fff;
  border-radius: 1rem;
  padding: 16px;
  min-height: 110px;
}
.stat-card .label { font-size: 13px; opacity: .9; }
.stat-card .value { font-size: 22px; margin-top: 18px; font-weight: 700; }
.stat-card select {
  margin-top: 8px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: var(--pill);
  padding: 4px 10px;
  font-size: 11px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.pill-select {
  height: 40px;
  border-radius: var(--pill);
  border: 1px solid var(--border);
  background: #fff;
  padding: 0 14px;
  font-size: 13px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  text-align: right;
  padding: 14px 10px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.table th { color: var(--muted); font-weight: 500; }
.table tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: var(--radius);
}
.empty-state .icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: #e8f3ff;
  display: grid;
  place-items: center;
  color: #3b82f6;
  font-size: 34px;
}
.empty-state p {
  color: #555;
  margin: 0 0 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: 12px;
  background: #eee;
}
.badge-active { background: #10b981; color: #fff; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-suspended, .badge-expired, .badge-revoked { background: #fee2e2; color: #991b1b; }
.badge-unused { background: #e0e7ff; color: #3730a3; }

.license-box {
  background: #111;
  color: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  font-family: ui-monospace, monospace;
  letter-spacing: 1px;
  margin: 6px 0;
}

.chart-wrap {
  background: #f7f8fa;
  border-radius: 22px;
  padding: 18px;
  min-height: 320px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  position: relative;
}
.modal h3 { margin: 0 0 18px; text-align: center; }
.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
  margin-top: 18px;
}

/* Pagination polish inside Tailwind cards */
nav[role="navigation"] svg { display: inline-block; width: 1.25rem; height: 1.25rem; }

@media (max-width: 980px) {
  .grid-3, .form-grid { grid-template-columns: 1fr; }
}
