/* MI Technical Institute — admin panel. Navy + orange brand. No build step needed. */
:root {
  --navy: #13284d; --navy-2: #1c3766; --navy-3: #284a85;
  --orange: #f39c12; --orange-dark: #d9840a; --orange-soft: #fff4e2;
  --bg: #f3f5f9; --card: #ffffff; --text: #1d2433; --muted: #6b7489; --line: #e4e8f0;
  --green: #16a34a; --green-soft: #e8f7ee; --red: #dc2626; --red-soft: #fdecec;
  --amber: #d97706; --amber-soft: #fff6e0; --blue: #2563eb; --blue-soft: #e8effd;
  --side-text: #c9d4ea; --side-muted: #8fa1c6;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 2px 6px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Inter, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); line-height: 1.45; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--navy); }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: var(--side-text); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; gap: 10px; align-items: center; }
.brand .logo { width: 40px; height: 40px; border-radius: 11px; background: var(--orange); color: #fff; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,.18); overflow: hidden; }
.brand .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand b { color: #fff; display: block; font-size: 15px; }
.brand small { font-size: 10px; letter-spacing: .12em; color: var(--side-muted); }
.nav { padding: 12px 10px; flex: 1; }
.nav .group { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--side-muted); opacity: .8; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 9px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 500; transition: background .15s, color .15s, transform .15s; }
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; transform: translateX(2px); }
.nav a.active { background: var(--orange); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.2); }
.nav a .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 10px; }
.nav svg { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.sidebar-foot b { color: #fff; display: block; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: rgba(255,255,255,.88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar .menu-btn { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--navy); }
.topbar .spacer { flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.avatar.navy { background: var(--navy-3); }
.content { padding: 24px 28px 40px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards & grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-head .muted { margin-left: auto; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.mb { margin-bottom: 16px; } .mt { margin-top: 16px; }
.stat { padding: 16px 18px; position: relative; overflow: hidden; }
.stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat .ico { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange-dark); }
.stat .ico svg { width: 19px; height: 19px; }
.stat .ico.blue { background: var(--blue-soft); color: var(--blue); }
.stat .ico.green { background: var(--green-soft); color: var(--green); }
.stat .ico.amber { background: var(--amber-soft); color: var(--amber); }
.stat .ico.navy { background: #eef1f8; color: var(--navy-3); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; color: var(--navy); margin: 4px 0 2px; }
.stat .delta { font-size: 12px; font-weight: 600; }
.up { color: var(--green); } .down { color: var(--red); } .muted { color: var(--muted); }
.small { font-size: 12px; } .bold { font-weight: 600; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #f8f9fc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.highlight td { background: var(--red-soft); }
.table tbody tr:hover td { background: #fafbfd; }
.table .person { display: flex; align-items: center; gap: 10px; }
.table .person .avatar { width: 30px; height: 30px; font-size: 11px; }

/* ---------- Badges, bars ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: #eef1f6; color: #475069; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.orange { background: var(--orange-soft); color: var(--orange-dark); }
.pill.navy { background: var(--navy); color: #fff; }
.bar { height: 8px; background: #edf0f5; border-radius: 6px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--navy-3); border-radius: 6px; }
.bar.orange > span { background: var(--orange); }
.bar.green > span { background: var(--green); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 50px; gap: 10px; align-items: center; margin-bottom: 10px; }
.score-big { font-size: 34px; font-weight: 800; color: var(--navy); }

/* ---------- Forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; transition: background .15s, box-shadow .15s, transform .1s; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none !important; line-height: 1.2; font-family: inherit; }
.btn:hover { background: #f6f7fa; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--orange) 35%, transparent); }
.btn:active { transform: translateY(1px); }
.btn.primary:hover { background: var(--orange-dark); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.navy:hover { background: var(--navy-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.red { background: #fff; border-color: #f3c3c3; color: var(--red); }
.btn.red:hover { background: var(--red-soft); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 5px; color: #394158; }
.field { margin-bottom: 14px; }
.input, select.input, textarea.input { width: 100%; padding: 9px 11px; border: 1px solid #d5dbe6; border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
.input:focus { outline: 3px solid color-mix(in srgb, var(--orange) 25%, transparent); border-color: var(--orange); }
textarea.input { min-height: 80px; resize: vertical; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error-text { color: var(--red); font-size: 12px; margin-top: 4px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters .input { width: auto; min-width: 140px; padding: 7px 10px; }
.inline-form { display: inline; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--orange); }
/* Toggle switch: <label class="switch"><input type="checkbox"><span></span> Text</label> */
.switch { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin: 0; }
.switch input { display: none; }
.switch span { width: 40px; height: 22px; border-radius: 22px; background: #cfd6e3; position: relative; flex-shrink: 0; transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 21px; }

/* ---------- Alerts ---------- */
.alert { padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert.success { background: var(--green-soft); color: #166534; border-color: #bfe6cc; }
.alert.error { background: var(--red-soft); color: #991b1b; border-color: #f5c2c2; }
.alert.info { background: var(--blue-soft); color: #1e40af; border-color: #c7d7f8; }
.alert.warn { background: var(--amber-soft); color: #92400e; border-color: #f7dca0; }
.alert ul { margin: 4px 0 0 18px; padding: 0; }

/* ---------- Misc ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--orange); text-decoration: none; }
.attention-item { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.attention-item:last-child { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--orange); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline .when { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.att-grid { border-collapse: collapse; font-size: 11px; }
.att-grid th, .att-grid td { border: 1px solid var(--line); padding: 4px; text-align: center; min-width: 28px; }
.att-grid td.name { text-align: left; min-width: 160px; padding: 6px 10px; font-size: 13px; white-space: nowrap; position: sticky; left: 0; background: #fff; }
.att-grid th.name { position: sticky; left: 0; background: #f8f9fc; }
.att-grid .s-on_time, .att-grid .s-grace { background: #d9f2e2; color: #166534; }
.att-grid .s-late { background: #fde0e0; color: #991b1b; }
.att-grid .s-absent { background: #f8b4b4; color: #7f1d1d; font-weight: 700; }
.att-grid .s-leave { background: #fdeccb; color: #92400e; }
.att-grid .s-holiday { background: #eef1f6; color: #9aa3b5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.stars { color: var(--orange); letter-spacing: 1px; }
.pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 14px 0 0; flex-wrap: wrap; }
.pagination a, .pagination span { display: block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 13px; }
.pagination .active span { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .disabled span { color: #b5bccb; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; }
details.box summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 14px; max-width: 520px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* ---------- Auth page (full photo background) ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; position: relative; background-color: var(--navy); background-size: cover; background-position: center; }
.auth-wrap::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, color-mix(in srgb, var(--navy) 92%, transparent) 0%, color-mix(in srgb, var(--navy) 70%, transparent) 55%, color-mix(in srgb, var(--navy) 35%, transparent) 100%); }
.auth-wrap > * { position: relative; }
.auth-side { color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; animation: rise .6s ease both; }
.auth-side .brand-row { display: flex; align-items: center; gap: 14px; }
.auth-side .brand-row .logo { width: 56px; height: 56px; border-radius: 15px; background: var(--orange); color: #fff; font-weight: 800; font-size: 20px; display: grid; place-items: center; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.auth-side .brand-row .logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.auth-side .brand-row b { font-size: 18px; display: block; }
.auth-side .brand-row small { color: rgba(255,255,255,.7); letter-spacing: .08em; }
.auth-side h1 { color: #fff; font-size: 40px; line-height: 1.15; margin: 34px 0 14px; max-width: 520px; letter-spacing: -.01em; }
.auth-side h1 em { font-style: normal; color: var(--orange); }
.auth-side p { color: rgba(255,255,255,.82); max-width: 470px; font-size: 15px; }
.auth-points { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; max-width: 470px; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); padding: 10px 14px; border-radius: 12px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.auth-points li i { width: 26px; height: 26px; border-radius: 8px; background: var(--orange); display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.auth-contact { margin-top: 28px; color: rgba(255,255,255,.7); font-size: 13px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-form .card { width: 100%; max-width: 420px; padding: 32px; border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); background: rgba(255,255,255,.97); animation: rise .6s .1s ease both; }
.auth-form .card .mobile-brand { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Dashboard hero ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; color: #fff; padding: 26px 28px; margin-bottom: 20px; background-color: var(--navy); background-size: cover; background-position: center 35%; min-height: 150px; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, color-mix(in srgb, var(--navy) 95%, transparent) 0%, color-mix(in srgb, var(--navy) 78%, transparent) 50%, color-mix(in srgb, var(--navy) 30%, transparent) 100%); }
.hero > * { position: relative; }
.hero h1 { color: #fff; font-size: 26px; }
.hero .sub { color: rgba(255,255,255,.8); margin-top: 4px; }
.hero .hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.hero .hero-chips span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.hero .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero .filters .input { background: rgba(255,255,255,.95); border-color: transparent; }

/* ---------- Smart insights ---------- */
.insights { display: grid; gap: 10px; }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: #f8f9fc; border: 1px solid var(--line); }
.insight .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; background: var(--blue-soft); }
.insight.good .dot { background: var(--green-soft); } .insight.warn .dot { background: var(--amber-soft); } .insight.bad .dot { background: var(--red-soft); }
.insight b { color: var(--navy); }

/* ---------- Branding page ---------- */
.img-pick { border: 1px dashed #cdd5e3; border-radius: 12px; overflow: hidden; background: #fafbfd; }
.img-pick .thumb { height: 120px; background: #e9edf4 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.img-pick .thumb.logo { background-size: contain; background-color: #fff; }
.img-pick .body { padding: 10px 12px; }
.img-pick input[type=file] { font-size: 12px; width: 100%; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 10px 6px 6px; display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit; }
.swatch i { width: 26px; height: 26px; border-radius: 7px; display: block; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 46px; height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.preview-box { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.preview-box .pv-top { padding: 16px; color: #fff; display: flex; gap: 10px; align-items: center; }
.preview-box .pv-logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.preview-box .pv-body { padding: 14px 16px; background: #fff; display: flex; gap: 8px; flex-wrap: wrap; }
.job-row { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.job-row:last-child { border-bottom: 0; }
.job-row .grow { flex: 1; min-width: 0; }
.job-row .input { width: 90px; }

@media (max-width: 1100px) {
  .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3, .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .sidebar { position: fixed; left: -260px; z-index: 40; transition: left .2s; }
  .sidebar.open { left: 0; }
  .topbar .menu-btn { display: block; }
  .content { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .g-2, .g-4, .g-5 { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-form { padding: 20px 16px; }
  .auth-form .card { padding: 24px 20px; }
  .auth-form .card .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
  .hero { padding: 20px; }
  .hero h1 { font-size: 21px; }
  .hero .actions { margin-left: 0; }
}
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
