/* Moodale portal — dark theme matching the original Moodale dashboard */
:root {
  color-scheme: dark;
  --brand: #ff6a00;
  --brand-2: #ff8c1a;
  --brand-dark: #e55f00;
  --brand-soft: rgba(255, 106, 0, 0.14);
  --brand-glow: rgba(255, 106, 0, 0.35);
  --ink: #f1f1f1;
  --ink-2: #c9c9cc;
  --muted: #8d8d93;
  --line: #2a2a2d;
  --line-2: #38383c;
  --bg: #0d0d0d;
  --card: #161616;
  --card-2: #1c1c1e;
  --side: #0f0f0f;
  --side-2: #1a1a1a;
  --field: #121212;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.14);
  --amber: #facc15;
  --amber-soft: rgba(250, 204, 21, 0.13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.14);
  --purple: #c084fc;
  --purple-soft: rgba(192, 132, 252, 0.14);
  --radius: 12px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.01), 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 14px rgba(255, 106, 0, 0.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 106, 0, 0.07), transparent 30%),
    radial-gradient(circle at 85% 85%, rgba(255, 106, 0, 0.05), transparent 35%),
    linear-gradient(145deg, #0d0d0d 0%, #161616 100%);
  background-attachment: fixed;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: #ffa64d; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 16px; font-weight: 650; color: var(--brand); text-shadow: 0 0 10px rgba(255, 106, 0, 0.35); }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; }
code { background: #222; padding: 1px 6px; border-radius: 6px; font-size: 13px; color: #ffb84d; }
::selection { background: rgba(255, 106, 0, 0.4); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #333 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #ff6a00; }

/* Decorative background (glow rings, like the original dashboard) */
.bg-fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.bg-fx .ring {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  border: 2px solid rgba(255, 106, 0, 0.16); box-shadow: 0 0 60px rgba(255, 106, 0, 0.16);
  animation: pulse 7s ease-in-out infinite;
}
.bg-fx .ring.tr { top: -60px; right: -60px; }
.bg-fx .ring.bl { bottom: -90px; left: 180px; width: 320px; height: 320px; animation-delay: -3s; }
.bg-fx .blob {
  position: absolute; top: 45%; left: 55%; width: 420px; height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 106, 0, 0.08), transparent 70%); filter: blur(50px);
}
@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .bg-fx .ring { animation: none; } }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: 250px; flex-shrink: 0; background: rgba(15, 15, 15, 0.92); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 20px; color: var(--ink); }
.brand small { display: block; color: var(--muted); font-size: 11.5px; }
.nav { padding: 4px 12px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #5f5f66; padding: 14px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; position: relative;
  color: #d4d4d8; font-weight: 500; margin-bottom: 3px; transition: background 0.2s, color 0.2s;
}
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: var(--side-2); color: var(--brand); }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); box-shadow: 0 0 10px var(--brand);
}
.nav .ico { width: 18px; text-align: center; opacity: 0.9; }
.nav .count {
  margin-left: auto; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px; box-shadow: 0 0 10px var(--brand-glow);
}
.side-foot { padding: 12px 12px 18px; border-top: 1px solid var(--line); }
.side-foot a, .side-foot button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; margin-top: 6px;
  color: #c4c4c8; background: transparent; border: 1px solid var(--line-2); font: inherit; cursor: pointer; text-align: left;
}
.side-foot a:hover, .side-foot button:hover { background: var(--side-2); color: #fff; border-color: #4a4a4f; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 16px 28px;
  background: rgba(13, 13, 13, 0.75); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.who strong { display: block; font-size: 13.5px; }
.who small { display: block; font-size: 12px; margin-top: -2px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  border: 1px solid rgba(255, 106, 0, 0.35);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.avatar.lg { width: 68px; height: 68px; font-size: 23px; box-shadow: 0 0 20px rgba(255, 106, 0, 0.25); }
.menu-btn { display: none; background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 16px; cursor: pointer; }
.content { padding: 26px 28px 56px; max-width: 1300px; width: 100%; }

/* ---------- Cards & grids ---------- */
.card {
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.92), rgba(20, 20, 21, 0.92));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.card-head a { font-size: 13px; font-weight: 500; }
.card-body { padding: 0 18px 18px; }
.card-body.pad { padding: 20px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: inherit;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
a.stat:hover { color: inherit; border-color: rgba(255, 106, 0, 0.45); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 106, 0, 0.12); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-ico {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #262626; color: var(--brand); font-size: 16px;
}
.stat .num { font-size: 30px; font-weight: 750; letter-spacing: -0.5px; line-height: 1; }
.stat .lbl { color: var(--ink-2); font-size: 13px; }
.stat.warn .num { color: var(--red); }
.stat.warn .stat-ico { background: var(--red-soft); color: var(--red); }
.stat.accent .num { color: var(--brand); text-shadow: 0 0 12px rgba(255, 106, 0, 0.35); }
.stat.accent .stat-ico { background: var(--brand-soft); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--ink-2); }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); }
.list .sub { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 13.5px; }
.empty.big { padding: 44px 0; }

.date-chip { width: 48px; flex-shrink: 0; text-align: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #111; }
.date-chip .m { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.date-chip .d { font-size: 17px; font-weight: 750; padding: 2px 0 3px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.7px; color: var(--muted); font-weight: 600; background: rgba(255, 255, 255, 0.02); border-top: 0; white-space: nowrap; }
tbody tr { transition: background 0.15s; }
tbody tr:hover td { background: rgba(255, 106, 0, 0.035); }
td .title { font-weight: 600; color: var(--ink); }
td a.title:hover { color: var(--brand-2); }
td .sub { color: var(--muted); font-size: 12.5px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 32px; height: 32px; font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #262626; color: #c9c9cc; border: 1px solid transparent; }
.b-todo { background: #262626; color: #c9c9cc; }
.b-in_progress { background: var(--blue-soft); color: var(--blue); }
.b-review { background: var(--purple-soft); color: var(--purple); }
.b-done, .b-approved, .b-active { background: var(--green-soft); color: var(--green); }
.b-pending { background: var(--amber-soft); color: var(--amber); }
.b-rejected, .b-inactive { background: var(--red-soft); color: var(--red); }
.b-cancelled { background: #222; color: var(--muted); }
.b-high { background: #dc2626; color: #fff; }
.b-medium { background: var(--amber-soft); color: var(--amber); }
.b-low { background: #262626; color: #a1a1aa; }
.b-admin { background: var(--brand-soft); color: var(--brand); border-color: rgba(255, 106, 0, 0.3); }
.b-employee { background: #262626; color: #c9c9cc; }
.b-important { background: #dc2626; color: #fff; }
.b-event { background: #1d4ed8; color: #fff; }
.b-policy { background: #7c3aed; color: #fff; }
.b-general { background: #262626; color: #c9c9cc; }
.overdue { color: var(--red); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #1c1c1e; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  white-space: nowrap; line-height: 1.2; transition: all 0.2s ease;
}
.btn:hover { background: #262628; border-color: #4a4a4f; color: #fff; }
.btn:disabled { cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, #ff6a00, #ff8c1a); border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #ff7a1a, #ffa64d); border-color: transparent; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 106, 0, 0.45); }
.btn-primary:disabled { transform: none; opacity: 0.95; }
.btn-danger { color: #f87171; border-color: rgba(239, 68, 68, 0.4); background: transparent; }
.btn-danger:hover { background: var(--red-soft); color: #fca5a5; border-color: rgba(239, 68, 68, 0.6); }
.btn-green { background: #16a34a; border-color: #16a34a; color: #fff; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25); }
.btn-green:hover { background: #15803d; border-color: #15803d; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn-link { background: none; border: 0; color: var(--brand-2); padding: 0; font: inherit; cursor: pointer; font-weight: 600; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="url"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; color: var(--ink);
  background: var(--field); transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: #66666c; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.18); }
select option { background: #161616; color: var(--ink); }
input[type="file"] { color: var(--ink-2); font: inherit; font-size: 13px; }
input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--line-2);
  background: #1f1f21; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--brand); font-weight: 700; margin: 10px 0 -2px; }
.people-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 9px; padding: 12px; background: var(--field); }

/* Filters bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type="search"] { width: 260px; }
.filters select { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 4px; background: #141414; border: 1px solid var(--line); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 7px; color: var(--ink-2); font-weight: 600; font-size: 13px; transition: background 0.15s; }
.tabs a:hover { color: #fff; background: #1f1f21; }
.tabs a.on { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px rgba(255, 106, 0, 0.35); }
.tabs .n { color: var(--muted); font-weight: 500; margin-left: 4px; }
.tabs a.on .n { color: #ffb380; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; border-left-width: 4px; font-weight: 500; }
.alert-success { background: var(--green-soft); border-color: rgba(34, 197, 94, 0.35); border-left-color: var(--green); color: #86efac; }
.alert-error { background: var(--red-soft); border-color: rgba(239, 68, 68, 0.35); border-left-color: var(--red); color: #fca5a5; }
.alert-info { background: var(--brand-soft); border-color: rgba(255, 106, 0, 0.35); border-left-color: var(--brand); color: #ffc79e; }

/* ---------- Detail pages ---------- */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 22px 18px; }
.profile-head h2 { font-size: 21px; color: var(--ink); text-shadow: none; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink-2); }
.comment { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; }
.comment .avatar { width: 32px; height: 32px; font-size: 12px; }
.comment .meta { font-size: 12.5px; color: var(--muted); }
.comment .meta strong { color: var(--ink); font-size: 13.5px; margin-right: 6px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.file-row:first-child { border-top: 0; }
.file-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 800; flex-shrink: 0; border: 1px solid rgba(255, 106, 0, 0.3); }

/* Announcements: coloured left edge like the original "Important Updates" cards */
.announce { padding: 13px 14px; margin-top: 10px; border: 1px solid var(--line); border-left: 4px solid #3f3f46; border-radius: 10px; background: rgba(255, 255, 255, 0.015); }
.announce:first-child { margin-top: 0; }
.announce.t-important { border-left-color: #dc2626; }
.announce.t-event { border-left-color: #3b82f6; }
.announce.t-policy { border-left-color: #a855f7; }
.announce.t-general { border-left-color: #facc15; }
.announce .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { width: auto; padding: 5px 8px; font-size: 13px; }
.decide { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.decide input[type="text"] { width: 180px; padding: 6px 10px; font-size: 13px; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; position: relative; z-index: 1; }
.auth-art { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; border-right: 1px solid var(--line); }
.auth-art .brand { padding: 0; }
.auth-art h2 { font-size: 40px; font-weight: 800; line-height: 1.12; max-width: 460px; color: var(--ink); text-shadow: none; }
.auth-art h2 span { color: var(--brand); text-shadow: 0 0 24px rgba(255, 106, 0, 0.5); }
.auth-art p { color: var(--ink-2); max-width: 420px; font-size: 15px; margin-top: 14px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-box {
  width: 100%; max-width: 380px; padding: 32px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.95), rgba(18, 18, 19, 0.95));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 106, 0, 0.08);
}
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box > p { color: var(--ink-2); margin-bottom: 22px; }
.auth-box .field { margin-bottom: 14px; }
.auth-box .btn { width: 100%; padding: 11px; margin-top: 6px; }
.auth-note { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }

.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.center-page .card { max-width: 440px; width: 100%; padding: 30px; text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; z-index: 30; transition: left 0.2s; background: #0f0f0f; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .menu-btn { display: inline-block; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 12px 16px; }
  .who { display: none; }
  .grid-2, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .dl { grid-template-columns: 110px 1fr; }
  .filters input[type="search"] { width: 100%; }
}

/* Wordmark logo */
.wordmark { display: flex; flex-direction: column; gap: 4px; }
.wordmark img { height: 22px; width: auto; display: block; filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.25)); }
.wordmark small { color: var(--muted); font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }
.auth-art .wordmark img { height: 30px; }

/* Permission checkboxes */
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.perm-group { grid-column: 1 / -1; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.perm {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--field); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.perm:hover { border-color: #55555b; }
.perm input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.perm strong { display: block; font-size: 13.5px; }
.perm small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.perm:has(input:checked) { border-color: rgba(255, 106, 0, 0.55); background: rgba(255, 106, 0, 0.07); }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Org chart */
.org-tree { display: flex; flex-direction: column; gap: 8px; }
.org-node { margin-left: calc(var(--depth) * 26px); position: relative; }
.org-node .org-node { margin-left: 26px; margin-top: 8px; padding-left: 0; }
.org-node .org-node::before { content: ""; position: absolute; left: -16px; top: -8px; bottom: 50%; width: 12px; border-left: 2px solid #333; border-bottom: 2px solid #333; border-bottom-left-radius: 8px; }
.org-node { margin-left: 0; }
.org-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); }
.org-card .title { font-weight: 600; }
.org-card .badge { margin-left: auto; }
@media (max-width: 860px) { .perm-grid { grid-template-columns: minmax(0, 1fr); } }

/* Certificates & letters */
.doc-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.doc-option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--ink); transition: border-color 0.15s, transform 0.15s; }
.doc-option:hover { color: var(--ink); border-color: rgba(255, 106, 0, 0.45); transform: translateY(-1px); }
.doc-option.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 0 18px rgba(255, 106, 0, 0.18); }
.doc-option.soon { opacity: 0.6; }
.doc-option strong { display: block; font-size: 14px; }
.doc-option small { display: block; color: var(--muted); font-size: 12.5px; }
.doc-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.doc-frame { width: 100%; height: calc(100vh - 230px); min-height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #f4f5f7; display: block; }
@media (max-width: 1050px) { .doc-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Popup (e.g. reason for rejecting leave) */
dialog.modal { border: 1px solid var(--line-2); border-radius: 14px; background: var(--card); color: var(--ink); padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(2px); }
.modal-body { padding: 22px; }
.modal-body h3 { margin: 0 0 4px; font-size: 17px; }
.modal-body .sub { margin: 0 0 14px; }
.modal-body textarea { width: 100%; box-sizing: border-box; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Meeting form: who's free */
.avail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.avail-sum { font-weight: 600; margin-bottom: 10px; }
.avail-sum.good { color: var(--green); }
.avail-sum.bad { color: #fca5a5; }
.avail-alt { margin: -2px 0 12px; border-color: rgba(34, 197, 94, 0.45); color: #86efac; }
.avail-grid { border: 1px solid var(--line-2); border-radius: 10px; padding: 6px 12px 10px; background: var(--field, #111); }
.avail-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.avail-row.avail-ticks { border-top: 0; padding: 4px 0 2px; }
.avail-name { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.avail-name .nm { font-weight: 600; font-size: 13px; }
.avail-name .sub { font-size: 12px; }
.avail-name .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--green); }
.avail-row.busy .dot { background: var(--red); }
.avail-row.leave .dot { background: var(--amber); }
.avail-bar { position: relative; height: 26px; border-radius: 6px; background: #1d1d20; overflow: hidden; }
.avail-bar.ticks { height: 16px; background: none; overflow: visible; }
.avail-bar.ticks span { position: absolute; transform: translateX(-50%); font-size: 10px; color: #77777d; white-space: nowrap; }
.avail-bar .blk { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: #52525b; }
.avail-bar .blk.portal { background: #8b5a2b; }
.avail-bar .blk.leave { top: 0; bottom: 0; border-radius: 0; background: repeating-linear-gradient(45deg, rgba(245,158,11,.25) 0 6px, rgba(245,158,11,.1) 6px 12px); }
.avail-bar .slot { position: absolute; top: 0; bottom: 0; border: 2px solid var(--brand); border-radius: 5px; background: rgba(255, 106, 0, 0.12); }
.avail-row.busy .avail-bar .slot { border-color: var(--red); background: rgba(239, 68, 68, 0.15); }
.avail-tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; background: #26262a; color: #8a8a90; margin-left: 4px; vertical-align: 1px; }
.avail-tag.ok { background: rgba(34, 197, 94, 0.12); color: #86efac; }
@media (max-width: 640px) { .avail-row { grid-template-columns: 1fr; gap: 4px; } }

/* Grouped admin pages (Employees | Reporting lines, Meetings | Google Meet) */
.section-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: -6px 0 20px; }
.section-tabs a { padding: 10px 2px; color: var(--ink-2); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.section-tabs a:hover { color: #fff; }
.section-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.st-dot { width: 7px; height: 7px; border-radius: 50%; background: #55555b; display: inline-block; }
.st-dot.on { background: var(--green); }

/* Dashboard */
.stats.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .stats.stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.today-line { margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line-2); }
.chip.ok { color: #86efac; border-color: rgba(34, 197, 94, 0.35); background: var(--green-soft); }
.chip.warn { color: #fde68a; border-color: rgba(250, 204, 21, 0.35); background: var(--amber-soft); }
.list .title .badge { margin-left: 6px; vertical-align: 1px; }
.quick-post { margin-bottom: 14px; }
.quick-post > summary { list-style: none; display: inline-flex; cursor: pointer; }
.quick-post > summary::-webkit-details-marker { display: none; }
.quick-post[open] > summary { display: none; }
.quick-post-form { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--field); }
.announce .head { display: flex; align-items: center; gap: 8px; }
.announce .head strong { flex: 1; min-width: 0; }
.ann-del button { background: none; border: 0; color: #6b6b72; cursor: pointer; font-size: 13px; padding: 2px 4px; border-radius: 5px; }
.ann-del button:hover { color: #fca5a5; background: var(--red-soft); }

/* Profile photos */
.avatar { overflow: hidden; }
.avatar.has-photo { background: #111; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit { display: flex; align-items: center; gap: 16px; }
.photo-edit label.btn { cursor: pointer; }
.finance-note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--field); border: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.sig-frame { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: 14px; display: block; background: #0b0b0d; overflow: hidden; }
/* Photo cropper */
.crop-modal .modal-body { display: grid; justify-items: center; }
.crop-modal .modal-body > h3, .crop-modal .modal-body > .sub { justify-self: start; }
.crop-stage { position: relative; overflow: hidden; border-radius: 12px; background: #000; cursor: grab; touch-action: none; user-select: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.85); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 280px; margin-top: 14px; color: var(--muted); font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: var(--brand); }
.crop-modal .modal-actions { justify-self: stretch; }
/* People: short note & departments */
.short-note { margin-top: 3px; font-size: 12px; color: #fcd34d; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.short-note::before { content: "✎ "; opacity: .7; }
.dept-rename { display: flex; gap: 8px; align-items: center; max-width: 360px; }
.dept-rename input { flex: 1; }

/* M Connect public form */
.talent { position: relative; max-width: 780px; margin: 0 auto; padding: 34px 18px 50px; display: grid; gap: 16px; }
.talent-brand { display: flex; justify-content: center; padding: 6px 0 4px; }
.talent-brand img { height: 42px; }
.talent-intro { border-top: 4px solid var(--brand); }
.talent-intro h1 { font-size: 26px; line-height: 1.25; margin: 0 0 12px; }
.talent-intro h1 span { color: var(--ink-2); font-weight: 600; font-size: 20px; display: block; margin-top: 4px; }
.talent-intro p { color: var(--ink-2); margin: 0 0 10px; }
.talent-hi { background: var(--brand-soft); border: 1px solid rgba(255,106,0,.3); border-radius: 10px; padding: 10px 12px; color: #ffd2b0 !important; }
.talent-tip { color: #fde68a !important; }
.talent-form { display: grid; gap: 16px; }
.talent-form label i, .talent-consent i { color: #fca5a5; font-style: normal; }
.talent-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 16px; padding: 4px 0; }
.talent-other { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.talent-other input[type=text] { flex: 1; max-width: 360px; }
.talent-consent { align-items: flex-start; line-height: 1.5; }
.talent-consent input { margin-top: 3px; }
.talent-foot { text-align: center; color: var(--muted); font-size: 12.5px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* People → M Connect */
.copy-row { display: flex; gap: 8px; }
.copy-row input { flex: 1; }
.connect-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.connect-bar .btn { margin-left: auto; }
.break { word-break: break-all; }
.talent-other input[type=text] { width: auto; height: auto; flex: 1; max-width: 360px; }
body:has(.talent) .bg-fx { position: fixed; }
/* Stipends */
.month-nav { display: flex; align-items: center; gap: 10px; }
.stipend-table tr.is-paid td { opacity: .78; }
.upi code { font-size: 12.5px; }
.btn-link { background: none; border: 0; color: var(--brand); cursor: pointer; font-size: 12px; padding: 0 4px; }
.qr-box { background: #fff; border-radius: 12px; padding: 12px; width: 240px; height: 240px; margin: 6px auto 10px; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.only-phone { display: none; }
@media (max-width: 760px), (pointer: coarse) { .only-phone { display: inline-flex; } .only-desktop { display: none; } }

/* ---------- Login (v2): brand everywhere, phone-first ---------- */
.auth-page { min-height: 100vh; }
.auth { min-height: 100vh; min-height: 100dvh; grid-template-columns: 1.15fr 1fr; }
.auth-art { padding: 44px 52px; gap: 28px; }
.auth-logo img { height: 34px; width: auto; display: block; filter: drop-shadow(0 0 14px rgba(255, 106, 0, 0.3)); }
.auth-pitch { max-width: 520px; }
.auth-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border: 1px solid rgba(255, 106, 0, 0.3); padding: 5px 10px; border-radius: 20px; margin-bottom: 16px; }
.auth-art h2 { font-size: 44px; max-width: 520px; }
.auth-features { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.02); }
.auth-features i { font-style: normal; width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--brand-soft); color: var(--brand); border: 1px solid rgba(255, 106, 0, 0.3); font-weight: 700; }
.auth-features b { display: block; font-size: 14.5px; }
.auth-features small { color: var(--ink-2); font-size: 13px; }
.auth-foot { color: var(--muted); font-size: 12.5px; }
.auth-foot a { color: var(--ink-2); }
.auth-form { flex-direction: column; gap: 18px; }
.auth-box { max-width: 400px; }
.auth-box h1 { font-size: 26px; }
.wave { display: inline-block; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.pw-toggle:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.forgot-box { margin: 2px 0 14px; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.55; color: #ffd9bf; background: var(--brand-soft); border: 1px solid rgba(255, 106, 0, 0.3); }
.forgot-box b { color: #fff; }
.auth-mobile-brand, .auth-chips, .auth-foot-mobile { display: none; }
.btn:disabled { opacity: .7; cursor: progress; }

@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-form { justify-content: flex-start; padding: calc(28px + env(safe-area-inset-top)) 18px 26px; }
  .auth-mobile-brand { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 4px; }
  .auth-mobile-brand img { height: 36px; width: auto; filter: drop-shadow(0 0 16px rgba(255, 106, 0, 0.35)); margin-bottom: 14px; }
  .auth-mobile-brand .auth-tag { margin-bottom: 10px; }
  .auth-mobile-brand p { font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--ink); max-width: 300px; }
  .auth-mobile-brand p span { color: var(--brand); text-shadow: 0 0 20px rgba(255, 106, 0, 0.45); }
  .auth-box { padding: 24px 20px; }
  .auth-box h1 { font-size: 22px; }
  .auth-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0; }
  .auth-chips li { font-size: 12.5px; color: var(--ink-2); padding: 6px 11px; border-radius: 20px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); }
  .auth-foot-mobile { display: block; text-align: center; padding-bottom: env(safe-area-inset-bottom); }
  /* 16px text stops iPhones zooming into the fields */
  .auth-box input { font-size: 16px; }
}

/* ---------- Phones: brand in the top bar, tables as cards, tidy tabs ---------- */
.topbar-logo { display: none; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .topbar-logo { display: inline-flex; align-items: center; margin-right: auto; }
  .topbar-logo img { height: 20px; width: auto; filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.3)); }
  .topbar h1 { order: 5; flex-basis: 100%; font-size: 19px; }
  input, select, textarea { font-size: 16px; } /* stops iPhones zooming into fields */
  .section-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; gap: 18px; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tabs a { white-space: nowrap; }
  .page-head { flex-wrap: wrap; gap: 12px; }
  .page-head .btn-row { flex-wrap: wrap; }
  .modal-body { padding: 18px; }
  dialog.modal { max-height: calc(100dvh - 24px); overflow: auto; }
}
@media (max-width: 640px) {
  .table-wrap { overflow: visible; }
  table.stack-mobile, table.stack-mobile tbody, table.stack-mobile tr, table.stack-mobile td { display: block; width: 100%; }
  table.stack-mobile thead { display: none; }
  table.stack-mobile tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.stack-mobile tr:last-child { border-bottom: 0; }
  table.stack-mobile td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 5px 0; border: 0; text-align: right; white-space: normal; }
  table.stack-mobile td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; text-align: left; flex-shrink: 0; padding-top: 3px; }
  table.stack-mobile td[data-label=""]::before { display: none; }
  table.stack-mobile td[data-label=""] { justify-content: flex-end; }
  /* The main cell (person / task / first column) reads like a card title */
  table.stack-mobile td:first-child, table.stack-mobile td:has(.person) { display: block; text-align: left; padding-bottom: 8px; }
  table.stack-mobile td:first-child::before, table.stack-mobile td:has(.person)::before { display: none; }
  table.stack-mobile td:has(> input[type=checkbox]:only-child) { display: inline-block; width: auto; padding: 0 10px 0 0; vertical-align: top; }
  table.stack-mobile td .sub { text-align: inherit; }
  table.stack-mobile td.right, table.stack-mobile td .btn-row { justify-content: flex-end; flex-wrap: wrap; }
  .person { min-width: 0; }
}
@media (max-width: 640px) {
  /* List rows with buttons (meetings, leave to approve…): buttons go on their own line */
  .list li { flex-wrap: wrap; }
  .list li > .grow { flex: 1 1 190px; min-width: 0; }
  .list li > .btn-row, .list li > form.btn-row, .list li > .decide { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}
