/* Shared design system for the whole app — login screens, the employee
   app, and the admin panel. Keeping tokens (colors, radius, shadow,
   spacing) in one place is what makes separate pages feel like one
   product instead of a pile of separately-built screens. */

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;

  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-success-text: #15803d;

  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #b91c1c;

  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #92400e;

  --color-bg: #f4f5f8;
  --color-surface: #ffffff;
  --color-border: #e5e7eb;
  --color-border-strong: #d8dce3;

  --color-text: #111827;
  --color-text-secondary: #4b5563;
  --color-text-muted: #9199a6;

  /* Employee app brand color (slate blue) vs. admin (near-black + amber
     accent) — a deliberate visual difference so no one mistakes which
     area of the system they're in. */
  --header-bg: #1e293b;
  --header-bg-admin: #14171f;
  --accent-admin: #d97706;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.18), 0 4px 12px rgba(15, 23, 42, 0.08);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --transition-fast: 120ms ease;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Reusable brand mark: a rounded square with initials/glyph ---- */
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary), #1e40af);
  color: white; font-weight: 700; font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.brand-mark.admin {
  background: linear-gradient(135deg, #374151, #111827);
  box-shadow: 0 0 0 2px var(--accent-admin), var(--shadow-sm);
}

/* ---- Auth screens (login / admin-login) ---- */
.auth-page {
  min-height: 100vh; margin: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top left, #1e3a8a 0%, #0f172a 55%, #0b1120 100%);
  padding: 24px;
}
.auth-page.admin-theme {
  background: radial-gradient(circle at top left, #3f3f46 0%, #18181b 55%, #09090b 100%);
}
.auth-card {
  background: var(--color-surface);
  padding: 36px 34px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 360px;
  max-width: 100%;
}
.auth-card .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-card h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.auth-card .subtitle { font-size: 12.5px; color: var(--color-text-muted); margin: 2px 0 0; }
.auth-card label { font-size: 12.5px; font-weight: 600; color: var(--color-text-secondary); display: block; margin: 0 0 6px; }
.auth-card input {
  width: 100%; padding: 11px 12px; margin-bottom: 16px; border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm); font-size: 14.5px; font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.auth-card input:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.auth-card button.primary-btn {
  width: 100%; padding: 11px; background: var(--color-primary); color: white; border: none;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14.5px; font-weight: 600;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.auth-card button.primary-btn:hover { background: var(--color-primary-hover); }
.auth-card button.primary-btn:active { transform: translateY(1px); }
.auth-page.admin-theme .auth-card button.primary-btn { background: #1f2937; }
.auth-page.admin-theme .auth-card button.primary-btn:hover { background: #111827; }

.auth-card .error {
  color: var(--color-danger-text); background: var(--color-danger-bg); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 13px; margin-bottom: 14px; display: none;
}
.auth-card .hint {
  font-size: 12px; color: var(--color-text-muted); margin-top: 18px; line-height: 1.7;
  border-top: 1px solid var(--color-border); padding-top: 14px;
}
.auth-card .hint b { color: var(--color-text-secondary); }
.auth-card .back-link {
  display: block; text-align: center; margin-top: 16px; font-size: 12.5px;
  color: var(--color-text-muted); text-decoration: none;
}
.auth-card .back-link:hover { color: var(--color-text-secondary); }

/* ---- Shared header bar (app.html / admin.html) ---- */
.app-header {
  background: var(--header-bg); color: white; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); position: relative; z-index: 5;
}
.app-header.admin-theme { background: var(--header-bg-admin); border-bottom: 3px solid var(--accent-admin); }
.app-header .brand-row { display: flex; align-items: center; gap: 12px; }
.app-header h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.app-header .header-right { display: flex; gap: 10px; align-items: center; }

.btn-outline {
  background: transparent; border: 1px solid rgba(255,255,255,0.28); color: #e5e7eb;
  padding: 7px 13px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.45); }

/* ---- Mobile: comfortable auth form controls, 16px input text avoids
   iOS Safari auto-zooming the page on focus ---- */
@media (max-width: 480px) {
  .auth-page { padding: 16px; }
  .auth-card { padding: 28px 20px 24px; }
  .auth-card input { font-size: 16px; padding: 13px 12px; }
  .auth-card button.primary-btn { padding: 13px; font-size: 16px; }
}
