/* QR-Based Employee Attendance System - Shared Stylesheet */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f9fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 0.75rem;
  line-height: 1.25;
  color: #0f172a;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.2rem;
}

code {
  background: #e2e8f0;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-main {
  padding: 1.25rem 0 2.5rem;
}

/* Top Navigation */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--bg);
  text-decoration: none;
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.nav-logout-form {
  display: inline;
  margin: 0;
}

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  h1 {
    font-size: 1.75rem;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-top: 0.25rem;
  color: #0f172a;
}

.stat-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Auth Layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-inline .form-group {
  margin-bottom: 0;
  flex: 1 1 160px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.96rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #15803d;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-outline {
  background: #fff;
  border-color: #cbd5e1;
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 0.38rem 0.7rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 1rem 1.5rem;
  font-size: 1.15rem;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

/* Alerts & Badges */
.alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.alert-success {
  background: var(--success-soft);
  color: #166534;
  border-color: #bbf7d0;
}

.alert-warning {
  background: var(--warning-soft);
  color: #92400e;
  border-color: #fde68a;
}

.alert-danger {
  background: var(--danger-soft);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-info {
  background: var(--primary-soft);
  color: #1e40af;
  border-color: #bfdbfe;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-success {
  background: var(--success-soft);
  color: #166534;
}

.badge-warning {
  background: var(--warning-soft);
  color: #92400e;
}

.badge-danger {
  background: var(--danger-soft);
  color: #991b1b;
}

.badge-neutral {
  background: #e2e8f0;
  color: #334155;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

th, td {
  padding: 0.72rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tbody tr:hover {
  background: #f8fafc;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
  align-items: center;
}

.page-link {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
}

.page-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* Scanner Page */
.scanner-box {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

#qr-reader {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  min-height: 260px;
}

/* Fullscreen Office QR Display */
body.kiosk-body {
  background: #0f172a;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.kiosk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.kiosk-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
}

.qr-frame {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 348px;
  min-height: 348px;
}

.kiosk-countdown {
  margin-top: 1.25rem;
  font-size: 1.15rem;
  color: #cbd5e1;
}

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
