/* TVET College TMS — institutional theme */
:root {
  --green-900: #123528;
  --green-800: #1a4735;
  --green-700: #21503d;
  --green-600: #2c6a4f;
  --gold: #d9a441;
  --red: #b3372f;
  --ink: #1d2521;
  --muted: #64716a;
  --line: #dde4df;
  --bg: #f3f6f4;
  --card: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 "Segoe UI", "Noto Sans Ethiopic", Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--green-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .35rem; }
h2 { font-size: 1.12rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
.page-sub { color: var(--muted); margin: 0 0 1.2rem; font-size: .9rem; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--green-900); color: #cfe0d6;
  padding: 0 0 2rem; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 1.1rem 1.1rem .9rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .logo { display: flex; align-items: center; gap: .6rem; }
.brand .logo-badge {
  width: 34px; height: 34px; border-radius: 8px; background: var(--gold);
  color: var(--green-900); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.brand strong { color: #fff; font-size: .95rem; display: block; }
.brand small { color: #9db8aa; font-size: .7rem; }
.nav-group { padding: .8rem .7rem 0; }
.nav-group .nav-title {
  font-size: .66rem; letter-spacing: .12em; text-transform: uppercase;
  color: #7fa08e; padding: 0 .45rem .3rem;
}
.sidebar a.nav-link {
  display: flex; align-items: center; gap: .5rem; color: #cfe0d6;
  padding: .42rem .55rem; border-radius: 7px; font-size: .84rem; margin-bottom: 1px;
}
.sidebar a.nav-link:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.sidebar a.nav-link.active { background: var(--green-600); color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 1.4rem; position: sticky; top: 0; z-index: 20;
}
.topbar .user-chip { display: flex; align-items: center; gap: .7rem; font-size: .84rem; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--green-700);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
}
.role-tag { background: #e8f0eb; color: var(--green-700); border-radius: 20px; padding: .1rem .6rem; font-size: .7rem; font-weight: 600; }
.lang-switch a { font-size: .78rem; padding: .15rem .45rem; border-radius: 5px; border: 1px solid var(--line); }
.lang-switch a.on { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.content { padding: 1.5rem 1.6rem 3rem; max-width: 1280px; }

/* Cards & stats */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; margin-bottom: 1.1rem; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: .9rem 1.1rem; border-left: 4px solid var(--green-600);
}
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--green-800); }
.stat .lbl { color: var(--muted); font-size: .78rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } .sidebar { width: 200px; } }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: var(--card); font-size: .84rem; }
table.data th {
  background: var(--green-800); color: #fff; text-align: left;
  padding: .5rem .65rem; font-weight: 600; font-size: .76rem; letter-spacing: .02em;
}
table.data td { padding: .48rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:nth-child(even) td { background: #f7faf8; }
table.data tr:hover td { background: #eef5f0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 1rem; }
.table-wrap table.data { margin: 0; border: 0; }

/* Progress chart */
table.progress-chart td.num, table.progress-chart th.num { text-align: right; }
table.progress-chart tfoot td { font-weight: 700; background: #e8f0eb !important; }

/* Badges */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 20px; font-size: .7rem; font-weight: 700; }
.badge.ok, .badge.pass, .badge.competent, .badge.active, .badge.approved, .badge.completed, .badge.resolved, .badge.admitted { background: #dcefe2; color: #1c6b3c; }
.badge.fail, .badge.rejected, .badge.expired, .badge.overdue, .badge.not_yet_competent { background: #f7dedc; color: #a03028; }
.badge.warn, .badge.pending, .badge.open, .badge.waitlisted, .badge.in_review, .badge.scheduled, .badge.pending_approval, .badge.draft { background: #f8ecd4; color: #8a6116; }
.badge.muted, .badge.unknown, .badge.not_taken, .badge.retired, .badge.closed, .badge.withdrawn, .badge.cancelled { background: #e7ebe8; color: #5b675f; }
.badge.info, .badge.graduated, .badge.employed { background: #dde9f6; color: #27567e; }

/* Forms */
form.stack { display: grid; gap: .8rem; max-width: 640px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
label { font-size: .8rem; font-weight: 600; color: #37423c; display: block; margin-bottom: .2rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .48rem .6rem; border: 1px solid #c8d2cb; border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(44,106,79,.35); border-color: var(--green-600); }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; gap: .5rem; align-items: center; font-size: .84rem; }
.check input { width: auto; }
.btn {
  display: inline-block; background: var(--green-700); color: #fff !important; border: 0;
  padding: .5rem 1.05rem; border-radius: 8px; font: inherit; font-weight: 600; font-size: .84rem;
  cursor: pointer; text-decoration: none !important;
}
.btn:hover { background: var(--green-600); }
.btn.secondary { background: #e7ebe8; color: var(--ink) !important; }
.btn.danger { background: var(--red); }
.btn.gold { background: var(--gold); color: var(--green-900) !important; }
.btn.sm { padding: .25rem .6rem; font-size: .74rem; border-radius: 6px; }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .8rem 0; }
.inline-form { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
.inline-form select, .inline-form input { width: auto; padding: .25rem .4rem; font-size: .78rem; }

/* Flash */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .86rem; border: 1px solid transparent; }
.flash.success { background: #e2f2e7; border-color: #bfe0cb; color: #1c5c34; }
.flash.error { background: #f9e4e2; border-color: #eec4c0; color: #8c2b23; }

/* Compliance callouts */
.callout { border-left: 4px solid var(--gold); background: #fbf5e8; padding: .7rem 1rem; border-radius: 8px; font-size: .82rem; margin-bottom: 1rem; }
.callout.green { border-color: var(--green-600); background: #eaf3ee; }
.callout.red { border-color: var(--red); background: #f9e9e7; }
.source-label { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 5px; display: inline-block; margin-bottom: .5rem; }
.source-label.institutional { background: var(--green-700); color: #fff; }
.source-label.external { background: #7a4f9e; color: #fff; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green-900), var(--green-600)); padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2.2rem 2.4rem; width: 420px; max-width: 95vw; box-shadow: 0 18px 60px rgba(0,0,0,.3); }
.login-card h1 { text-align: center; }
.login-brand { text-align: center; margin-bottom: 1rem; }
.login-brand .logo-badge { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; margin: 0 auto .6rem; display: flex; align-items: center; justify-content: center; background: var(--gold); color: var(--green-900); font-weight: 800; }
.demo-logins { margin-top: 1.2rem; border-top: 1px dashed var(--line); padding-top: .9rem; }
.demo-logins summary { cursor: pointer; font-size: .8rem; color: var(--muted); }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-top: .6rem; }
.demo-grid button { font-size: .72rem; padding: .35rem .4rem; border-radius: 6px; border: 1px solid var(--line); background: #f4f7f5; cursor: pointer; }
.demo-grid button:hover { background: #e7f0ea; }

/* Misc */
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.pagination { display: flex; gap: .3rem; margin: 1rem 0; }
.pagination a, .pagination span { padding: .3rem .65rem; border: 1px solid var(--line); border-radius: 6px; font-size: .8rem; background: #fff; }
.pagination .current { background: var(--green-700); color: #fff; border-color: var(--green-700); }
details.acc { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .9rem; margin-bottom: .6rem; background: #fff; }
details.acc summary { cursor: pointer; font-weight: 600; font-size: .86rem; }
.json-diff { font-size: .7rem; white-space: pre-wrap; word-break: break-all; max-width: 340px; }
.footer-note { color: var(--muted); font-size: .72rem; padding: 1rem 1.6rem; border-top: 1px solid var(--line); }
@media print { .sidebar, .topbar, .actions-row, .btn { display: none !important; } .content { padding: 0; } }
