:root {
  --bg: #eef4f8;
  --ink: #172033;
  --muted: #697386;
  --line: #d7e1e8;
  --panel: #ffffff;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #ea580c;
  --danger: #b42318;
  --blue: #2563eb;
  --green: #059669;
  --amber: #d97706;
  --rose: #e11d48;
  --violet: #7c3aed;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, .18), transparent 32rem),
    radial-gradient(circle at top right, rgba(37, 99, 235, .12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a { color: var(--primary); }

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

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #123c45 100%);
  box-shadow: 12px 0 34px rgba(15, 23, 42, .15);
  color: #fff;
  height: 100vh;
  overflow-y: auto;
  padding: 22px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 22px;
  font-weight: 700;
  gap: 10px;
  margin-bottom: 22px;
  text-decoration: none;
}

.brand::before {
  background: linear-gradient(135deg, #14b8a6, #f59e0b);
  border-radius: 8px;
  content: "";
  display: inline-block;
  height: 34px;
  width: 34px;
}

.identity {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  margin-bottom: 18px;
  padding: 14px;
}

.identity span {
  color: #b7c0d2;
  font-size: 13px;
}

nav {
  display: grid;
  gap: 6px;
}

nav a {
  border-radius: 8px;
  color: #d9e2f2;
  padding: 10px 12px;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

nav a:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
  transform: translateX(2px);
}

.content {
  min-width: 0;
  padding: 30px;
}

h1 {
  font-size: 30px;
  margin: 0 0 22px;
}

h2 {
  font-size: 19px;
  margin: 0 0 16px;
}

.panel,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(16,24,40,.07);
  padding: 20px;
}

.login-panel {
  align-items: center;
  display: grid;
  gap: 42px;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 60px);
}

.login-panel h1 {
  font-size: 42px;
  line-height: 1.08;
  max-width: 720px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted { color: var(--muted); }

.form {
  display: grid;
  gap: 14px;
}

.compact {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-bottom: 18px;
}

label {
  color: #344054;
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .16);
  outline: none;
}

textarea { resize: vertical; }

.check {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.check input { width: auto; }

.btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

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

.btn.primary {
  background: linear-gradient(135deg, var(--primary), #14b8a6);
  border-color: var(--primary);
  box-shadow: 0 12px 26px rgba(15, 118, 110, .22);
  color: #fff;
}

.btn.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn.small {
  min-height: 34px;
  padding: 6px 10px;
}

.btn.danger {
  border-color: #f3b8b2;
  color: var(--danger);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-panel {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(17, 94, 89, .90)),
    #0f172a;
  border-radius: 8px;
  color: #fff;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 26px;
  position: relative;
}

.employee-hero {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(37, 99, 235, .88)),
    #0f766e;
}

.hero-panel::after {
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  content: "";
  height: 190px;
  position: absolute;
  right: -70px;
  top: -80px;
  width: 190px;
}

.hero-panel > * {
  position: relative;
  z-index: 1;
}

.hero-panel h1 {
  color: #fff;
  font-size: 34px;
  line-height: 1.12;
  margin: 4px 0 8px;
}

.hero-panel p {
  color: #dbeafe;
  margin: 0;
  max-width: 640px;
}

.stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 20px;
}

.stats article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stats strong {
  display: block;
  font-size: 34px;
}

.stats span { color: var(--muted); }

.dashboard-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
  overflow: hidden;
  position: relative;
}

.stat-card::before {
  border-radius: 999px;
  content: "";
  height: 78px;
  opacity: .14;
  position: absolute;
  right: -26px;
  top: -26px;
  width: 78px;
}

.stat-card strong {
  color: #111827;
  line-height: 1;
  margin: 8px 0;
}

.stat-card span {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card small {
  color: var(--muted);
  display: block;
}

.stat-card.green { border-color: #a7f3d0; }
.stat-card.green span { color: var(--green); }
.stat-card.green::before { background: var(--green); }
.stat-card.blue { border-color: #bfdbfe; }
.stat-card.blue span { color: var(--blue); }
.stat-card.blue::before { background: var(--blue); }
.stat-card.amber { border-color: #fed7aa; }
.stat-card.amber span { color: var(--amber); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.rose { border-color: #fecdd3; }
.stat-card.rose span { color: var(--rose); }
.stat-card.rose::before { background: var(--rose); }
.stat-card.violet { border-color: #ddd6fe; }
.stat-card.violet span { color: var(--violet); }
.stat-card.violet::before { background: var(--violet); }

.dashboard-grid {
  align-items: stretch;
  display: grid;
  gap: 18px;
  grid-template-columns: 1.5fr .9fr;
}

.quick-panel,
.insight-panel {
  min-height: 154px;
}

.quick-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.quick-actions a {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  padding: 13px 14px;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.quick-actions a:hover {
  background: #ecfeff;
  border-color: #67e8f9;
  color: #0e7490;
  transform: translateY(-2px);
}

.big-value {
  color: var(--primary);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin: 8px 0;
}

.two-col,
.attendance-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(280px, 420px) 1fr;
}

.section-gap { margin-top: 18px; }
.quota-grid { margin-bottom: 18px; }

.settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.setting-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.05);
  color: var(--ink);
  display: grid;
  gap: 6px;
  padding: 18px;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.setting-card:hover {
  border-color: #99f6e4;
  box-shadow: 0 14px 34px rgba(20, 184, 166, .14);
  transform: translateY(-2px);
}

.setting-card span {
  color: var(--muted);
  font-size: 14px;
}

.attendance-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  display: grid;
  gap: 16px;
}

.attendance-head {
  background: #0f172a;
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 2px;
  padding: 16px;
}

.attendance-head .eyebrow { color: #fbbf24; }
.attendance-head strong { font-size: 24px; }
.attendance-head span:last-child { color: #cbd5e1; }

.photo-picker { cursor: pointer; }

.photo-source {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.photo-frame {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #ecfdf3;
  border: 2px dashed #34d399;
  border-radius: 8px;
  color: #065f46;
  display: grid;
  gap: 6px;
  justify-items: center;
  overflow: hidden;
  padding: 18px;
  position: relative;
  text-align: center;
}

.photo-frame img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.photo-frame strong,
.photo-frame small {
  position: relative;
  z-index: 1;
}

.photo-frame img:not([hidden]) ~ strong,
.photo-frame img:not([hidden]) ~ small {
  background: rgba(15, 23, 42, .72);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
}

.status-pills {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.status-pills span {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  text-align: center;
}

.status-pills span.ready {
  background: #ecfdf3;
  border-color: #86efac;
  color: #166534;
}

.attendance-actions .btn { width: 100%; }

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475467;
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr { transition: background .16s ease; }
tbody tr:hover { background: #f8fafc; }

.alert {
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(16,24,40,.06);
  margin-bottom: 18px;
  padding: 12px 14px;
}

.alert.success { background: #ecfdf3; color: #067647; }
.alert.danger { background: #fef3f2; color: var(--danger); }

.badge {
  background: #eef4ff;
  border-radius: 999px;
  color: #3538cd;
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
}

.filters {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.inline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  padding-top: 14px;
}

.pagination-form,
.pagination-buttons {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination label {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.pagination select { min-width: 82px; }

@media (max-width: 900px) {
  .shell { display: block; }

  .sidebar {
    border-bottom: 1px solid rgba(255,255,255,.12);
    height: auto;
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .brand {
    font-size: 18px;
    margin-bottom: 10px;
  }

  .brand::before {
    height: 28px;
    width: 28px;
  }

  .identity {
    margin-bottom: 10px;
    padding: 10px;
  }

  nav {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    overflow-x: auto;
    padding: 0 16px 4px;
    scrollbar-width: thin;
  }

  nav a {
    background: rgba(255,255,255,.08);
    flex: 0 0 auto;
    font-size: 13px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  nav a:hover { transform: none; }

  .content { padding: 18px; }

  .login-panel,
  .two-col,
  .attendance-grid,
  .dashboard-grid,
  .stats,
  .filters,
  .compact {
    grid-template-columns: 1fr;
  }

  .login-panel { min-height: auto; }
  .login-panel h1 { font-size: 32px; }

  h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .hero-panel {
    align-items: stretch;
    display: grid;
    padding: 20px;
  }

  .hero-panel h1 { font-size: 27px; }
  .hero-panel .btn { width: 100%; }

  .panel,
  .card {
    padding: 16px;
  }

  .toolbar,
  .filters {
    align-items: stretch;
  }

  .toolbar .btn,
  .filters .btn,
  .capture-form .btn.primary {
    width: 100%;
  }

  table {
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 0;
  }

  thead { display: none; }

  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  tr {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
  }

  td {
    border-bottom: 0;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(96px, 40%) 1fr;
    padding: 7px 0;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
  }

  td:not([data-label])::before { content: "Data"; }

  .inline {
    align-items: stretch;
    display: grid;
  }

  .inline .btn,
  .inline input,
  .inline select {
    width: 100%;
  }

  .pagination,
  .pagination-form,
  .pagination-buttons,
  .pagination label {
    align-items: stretch;
    display: grid;
    width: 100%;
  }
}

@media (max-width: 520px) {
  body { background: #eef2f7; }
  .content { padding: 14px; }
  .stats { gap: 10px; }
  .stats article { padding: 14px; }
  .stats strong { font-size: 28px; }
  .hero-panel { margin-bottom: 14px; }
  .hero-panel h1 { font-size: 24px; }
  .quick-actions { grid-template-columns: 1fr 1fr; }

  input,
  select,
  textarea,
  .btn {
    min-height: 44px;
  }

  td {
    gap: 2px;
    grid-template-columns: 1fr;
  }
}
