/* ==========================================================
   DRM Hospital Mandya -- HMS console
   ========================================================== */

:root {
  --green-900: #041f1c;
  --green-800: #07332f;
  --green-700: #0d4a44;
  --green-600: #14615a;
  --green-100: #dff0ec;
  --coral:     #f7a582;
  --coral-600: #e8825a;
  --gold:      #d9a441;
  --ink:       #17211f;
  --ink-600:   #566360;
  --ink-400:   #8a9491;
  --line:      #e3e8e7;
  --bg:        #f4f7f6;
  --white:     #fff;
  --ok:        #1c6b45;
  --warn:      #96591a;
  --err:       #a12b22;
  --radius:    12px;
  --shadow:    0 2px 12px rgba(7,51,47,.07);
  --sidebar:   248px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--coral-600); }

h1, h2, h3 { color: var(--green-800); margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--sidebar);
  background: var(--green-800);
  color: #c3d6d2;
  flex: none;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.side__brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.side__mark {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--coral), var(--gold));
  color: var(--green-900); display: grid; place-items: center;
  font-weight: 800; font-size: .85rem;
}
.side__name { color: #fff; font-weight: 700; font-size: .95rem; line-height: 1.15; }
.side__sub  { color: #8fa9a5; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }

.side__nav { padding: 14px 10px; flex: 1; }
.side__label {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: #6f8b87; padding: 14px 10px 6px;
}
.side__nav a {
  display: flex; align-items: center; gap: .6rem;
  color: #cfe0dc; padding: .58rem .7rem; border-radius: 9px;
  font-size: .92rem; margin-bottom: 2px;
}
.side__nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side__nav a.is-active { background: var(--green-600); color: #fff; font-weight: 600; }
.side__nav .ico { width: 20px; text-align: center; flex: none; }

.side__foot {
  border-top: 1px solid rgba(255,255,255,.09);
  padding: 14px 18px; font-size: .84rem;
}
.side__foot b { color: #fff; display: block; }
.side__foot span { color: #8fa9a5; font-size: .78rem; }
.side__foot a { color: var(--coral); font-size: .84rem; }

.main { flex: 1; min-width: 0; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.25rem; }
.topbar__meta { color: var(--ink-400); font-size: .86rem; }

.content { padding: 26px; }

.menu-btn {
  display: none; background: var(--green-800); color: #fff; border: 0;
  width: 38px; height: 38px; border-radius: 9px; font-size: 1.1rem; cursor: pointer;
}

/* ---------- cards / panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.panel__head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 16px;
}
.panel__head h2 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.stat b { display: block; font-size: 1.85rem; color: var(--green-800); font-weight: 800; line-height: 1.15; }
.stat span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-400); }
.stat--gold b  { color: var(--gold); }
.stat--coral b { color: var(--coral-600); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tbl th {
  text-align: left; padding: .65rem .7rem;
  background: #eef3f2; color: var(--green-800);
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: .68rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.tbl tr:hover td { background: #fafcfb; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tfoot td { font-weight: 700; background: #eef3f2; border-top: 2px solid var(--line); }
.empty { padding: 34px; text-align: center; color: var(--ink-400); }

/* ---------- forms ---------- */
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--green-800); margin-bottom: .28rem; }
.field label .req { color: var(--coral-600); }
.field input, .field select, .field textarea {
  width: 100%; padding: .58rem .7rem;
  border: 1.5px solid var(--line); border-radius: 9px;
  font: inherit; font-size: .92rem; background: var(--white); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(20,97,90,.12);
}
.field textarea { min-height: 78px; resize: vertical; }
.field__hint { font-size: .76rem; color: var(--ink-400); margin-top: .22rem; }
.row { display: grid; gap: 0 14px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }
.row-4 { grid-template-columns: repeat(4, 1fr); }

.btn {
  display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
  padding: .58rem 1.1rem; border-radius: 9px; border: 1.5px solid transparent;
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.btn--primary { background: var(--green-800); color: #fff; }
.btn--primary:hover { background: var(--green-700); color: #fff; }
.btn--gold { background: var(--gold); color: var(--green-900); }
.btn--outline { border-color: var(--line); background: var(--white); color: var(--green-800); }
.btn--outline:hover { border-color: var(--green-600); color: var(--green-700); }
.btn--danger { background: #fdeceb; color: var(--err); border-color: #f6c9c5; }
.btn--sm { padding: .34rem .7rem; font-size: .82rem; }
.btn--block { width: 100%; }

.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; }
.toolbar .field { margin-bottom: 0; }

.alert { padding: .8rem 1rem; border-radius: 9px; margin-bottom: 1rem; font-size: .9rem; border: 1.5px solid transparent; }
.alert--ok  { background: #e8f5ef; border-color: #b9e0cd; color: var(--ok); }
.alert--err { background: #fdeceb; border-color: #f6c9c5; color: var(--err); }
.alert--info{ background: var(--green-100); border-color: #bcdcd5; color: var(--green-700); }

/* ---------- pills ---------- */
.pill { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.pill--ok      { background: #e3f2ea; color: var(--ok); }
.pill--warn    { background: #fff3e0; color: var(--warn); }
.pill--err     { background: #fdeceb; color: var(--err); }
.pill--muted   { background: #eceff1; color: var(--ink-600); }
.pill--info    { background: var(--green-100); color: var(--green-700); }

.muted { color: var(--ink-400); }
.small { font-size: .84rem; }
.mono  { font-variant-numeric: tabular-nums; }
.right { text-align: right; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(900px 460px at 70% 10%, var(--green-700), var(--green-900));
  padding: 24px;
}
.login-card {
  background: var(--white); border-radius: 18px; padding: 34px;
  width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.login-card .side__mark { width: 46px; height: 46px; font-size: .95rem; margin-bottom: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
  }
  .side.is-open { transform: none; }
  .menu-btn { display: block; }
  .row-2, .row-3, .row-4 { grid-template-columns: 1fr; }
  .content { padding: 18px; }
}

/* DRM wordmark on a white chip, so the blue "D" reads on dark green */
.side__logo {
  flex: none;
  background: #fff;
  border-radius: 9px;
  padding: 6px 9px;
  display: grid;
  place-items: center;
  line-height: 0;
}
.side__logo img { width: 62px; height: auto; }
