:root {
  /* Aligned to HR-Attendance's exact palette so every page sharing this stylesheet —
     Admin, Patients, Queue Staff/Settings, all of Inventory, Dashboard, Login —
     reads as the same product instead of a slightly-different blue each time. */
  --navy: #0b1a3a; --navy-dark: #10214a; --blue: #2563eb; --blue-light: #3b82f6;
  --teal: #0d9488; --green-600: #16a34a; --red-600: #dc2626; --amber-600: #d97706;
  --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0; --gray-400: #94a3b8;
  --gray-500: #64748b; --gray-600: #475569; --gray-700: #334155; --gray-900: #0f172a;
  --white: #fff; --radius: 12px; --shadow-sm: 0 1px 3px rgba(0,0,0,.08); --shadow-lg: 0 20px 50px rgba(0,0,0,.18);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--gray-50); color: var(--gray-900); }
a { color: inherit; }

/* ---------- Login (split screen, matches reference) ---------- */
.hms-login-wrap { min-height: 100vh; display: flex; background: linear-gradient(135deg, #eef4ff, #e0ecff); }
.hms-login-left { flex: 1.1; display: flex; flex-direction: column; justify-content: center; padding: 60px 64px; position: relative; overflow: hidden; }
.hms-login-left::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(23,54,92,.06), rgba(13,148,136,.05));
}
.hms-brand-badge { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--navy); position: relative; z-index: 1; }
.hms-brand-badge i { color: var(--teal); }
.hms-brand-sub { color: var(--gray-500); font-size: 12.5px; margin: 2px 0 34px; position: relative; z-index: 1; }
.hms-headline { font-size: 34px; font-weight: 800; line-height: 1.25; margin: 0 0 18px; position: relative; z-index: 1; }
.hms-headline .l1 { color: var(--navy); display: block; }
.hms-headline .l2 { color: var(--blue); display: block; }
.hms-headline .l3 { color: var(--teal); display: block; }
.hms-tagline { color: var(--gray-600); font-size: 14.5px; margin-bottom: 30px; position: relative; z-index: 1; }
.hms-module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; position: relative; z-index: 1; }
.hms-module-chip { background: rgba(255,255,255,.85); border: 1px solid var(--gray-200); border-radius: 10px; padding: 14px 10px; text-align: center; font-size: 12px; font-weight: 700; color: var(--gray-700); }
.hms-module-chip i { display: block; font-size: 20px; margin-bottom: 6px; color: var(--blue); }
.hms-login-footnote { margin-top: 30px; font-size: 12px; color: var(--gray-500); position: relative; z-index: 1; display: flex; gap: 18px; flex-wrap: wrap; }
.hms-login-footnote span { display: flex; align-items: center; gap: 6px; }

.hms-login-right { width: 460px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 30px; }
.hms-login-card { background: #fff; border-radius: 18px; padding: 34px 34px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.hms-login-clinic { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.hms-login-clinic .icon { width: 44px; height: 44px; border-radius: 50%; background: #ecfeff; color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.hms-login-clinic h2 { font-size: 15.5px; margin: 0; color: var(--navy); }
.hms-login-welcome { text-align: center; font-weight: 700; color: var(--navy); font-size: 16px; margin: 18px 0 2px; }
.hms-login-sub { text-align: center; color: var(--gray-500); font-size: 12.5px; margin-bottom: 20px; }
.hms-login-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--gray-500); border-top: 1px solid var(--gray-100); margin-top: 20px; padding-top: 14px; }
.hms-login-meta .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-600); display: inline-block; margin-right: 4px; }

/* ---------- Generic form/UI (shared by shell + new modules) ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-input, textarea.form-input, select.form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 13.5px; font-family: inherit; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
.btn { display: inline-flex; align-items: center; justify-content:center; gap: 7px; padding: 10px 18px; border-radius: 8px; border: none; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.btn-primary { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-danger { background: #fee2e2; color: var(--red-600); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 10px; }
.alert-error { background: #fee2e2; color: var(--red-600); }
.alert-success { background: #d1fae5; color: #047857; }
.alert-info { background: #e0f2fe; color: #0369a1; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.b-green { background: #dcfce7; color: #15803d; }
.b-red { background: #fee2e2; color: var(--red-600); }
.b-amber { background: #fef3c7; color: #92400e; }
.b-gray { background: var(--gray-100); color: var(--gray-600); }
.b-blue { background: #dbeafe; color: #1e40af; }

.hms-toast { position: fixed; bottom: 20px; right: 20px; background: #fff; border-left: 4px solid var(--teal); padding: 12px 18px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 13.5px; opacity: 0; transform: translateY(10px); transition: all .25s ease; z-index: 999; }
.hms-toast.show { opacity: 1; transform: translateY(0); }
.hms-toast.error { border-left-color: var(--red-600); }
.hms-toast.warning { border-left-color: var(--amber-600); }

.modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: 90vh; display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--gray-200); font-weight: 700; color: var(--navy); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--gray-200); display: flex; justify-content: flex-end; gap: 10px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; padding: 10px 12px; background: var(--gray-50); color: var(--gray-600); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--gray-200); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.panel { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.panel-title { font-weight: 700; font-size: 15px; color: var(--navy); }

/* ---------- Dashboard shell ---------- */
.hms-topbar { display: flex; align-items: center; gap: 14px; padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--gray-200); }
.hms-topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--navy); font-size: 16px; flex: 1; }
.hms-topbar .brand i { color: var(--teal); }
.hms-topbar .user { font-size: 13px; color: var(--gray-600); }
.hms-page { padding: 26px; max-width: 1200px; margin: 0 auto; }
.hms-welcome { margin-bottom: 22px; }
.hms-welcome h1 { font-size: 22px; color: var(--navy); margin: 0 0 4px; }
.hms-welcome p { color: var(--gray-500); margin: 0; font-size: 13.5px; }
.hms-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.hms-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 14px; padding: 22px 18px; text-align: center;
  text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; cursor: pointer;
}
.hms-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.1); }
.hms-card .icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 12px; }
.hms-card .title { font-weight: 700; color: var(--gray-900); font-size: 14.5px; }
.hms-card .sub { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.hms-card.disabled { opacity: .55; cursor: not-allowed; }
.hms-card.disabled:hover { transform: none; box-shadow: var(--shadow-sm); }

@media (max-width: 900px) {
  .hms-login-left { display: none; }
  .hms-login-right { width: 100%; }
}
