/* Internship Portal — shared styles. Mobile-first. */
:root {
  --navy: #1f3a5f; --teal: #2a7f7a; --bg: #f4f6f9; --card: #fff; --line: #dde3ea;
  --text: #1d2733; --muted: #6b7684; --ok: #1e7b45; --warn: #b26b00; --bad: #b3261e; --info: #1f5fa8;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .75rem; color: var(--navy); }
h2 { font-size: 1.15rem; margin: 1.25rem 0 .6rem; color: var(--navy); }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: .6rem 0; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .pre { white-space: pre-wrap; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.inline { display: inline; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; height: 54px; padding: 0 1rem; background: var(--navy); color: #fff; }
.topbar a, .topbar .linkbtn { color: #fff; }
.brand { font-weight: 700; font-size: 1.05rem; flex: 1; }
.who { display: flex; gap: .9rem; align-items: center; font-size: .9rem; }
.who .role { text-transform: capitalize; opacity: .8; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--info); }
.hamburger { display: none; cursor: pointer; font-size: 1.4rem; }
.navtoggle { display: none; }
.shell { display: flex; min-height: calc(100vh - 54px); }
.sidebar { width: 230px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: .75rem .5rem; position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; border-radius: 6px; color: var(--text); }
.sidebar a:hover { background: var(--bg); text-decoration: none; }
.sidebar a.active { background: #e6eef7; color: var(--navy); font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 1.25rem; max-width: 1200px; }
.content.solo { margin: 0 auto; }
@media (max-width: 820px) {
  .hamburger { display: block; }
  .hide-sm { display: none; }
  .sidebar { position: fixed; left: 0; top: 54px; z-index: 15; transform: translateX(-100%); transition: transform .2s; box-shadow: 2px 0 10px rgba(0,0,0,.1); }
  .navtoggle:checked ~ .shell .sidebar { transform: none; }
  .content { padding: .9rem; }
}

/* Cards & grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.card.narrow { max-width: 480px; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
a.stat:hover { text-decoration: none; border-color: var(--teal); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f0f3f7; font-weight: 600; color: #344255; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr.row-warn td { background: #fff8e6; } tr.row-bad td { background: #fdecea; } tr.row-ok td { background: #eef8f1; }

/* Forms */
label { display: block; margin-bottom: .8rem; font-weight: 500; font-size: .92rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=number], input[type=file], select, textarea {
  display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; border: 1px solid #c5ced8; border-radius: 6px; background: #fff;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc0e6; border-color: var(--info); }
.form-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { margin: 0; font-size: .82rem; }
.filters input, .filters select { width: auto; min-width: 140px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; color: var(--navy); padding: 0 .3rem; }
.check { display: flex; gap: .45rem; align-items: center; font-weight: 400; }
.check input { width: auto; margin: 0; }

/* Buttons */
.btn { display: inline-block; padding: .5rem .95rem; border: 1px solid #c5ced8; border-radius: 6px; background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; line-height: 1.3; }
.btn:hover { background: #f0f3f7; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #17304f; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: #fdecea; }
.btn.sm { padding: .25rem .6rem; font-size: .85rem; }
.btn.block { display: block; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Status pills & badges */
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--bad); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; text-transform: capitalize; background: #e8ecf1; color: #344255; white-space: nowrap; }
.pill.pending, .pill.submitted, .pill.draft, .pill.assigned { background: #fff1d6; color: var(--warn); }
.pill.verified, .pill.approved, .pill.accepted, .pill.active, .pill.completed { background: #dcf2e3; color: var(--ok); }
.pill.rejected, .pill.revise, .pill.rework, .pill.revoked, .pill.discontinued, .pill.overdue { background: #fbdcd9; color: var(--bad); }
.pill.info { background: #dde9f7; color: var(--info); }

/* Flash */
.flash { padding: .65rem .9rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; }
.flash.success { background: #eaf7ef; border-color: #b6e2c4; color: #145a32; }
.flash.error { background: #fdecea; border-color: #f3b8b2; color: #8a1c14; }
.flash.info { background: #e9f1fb; border-color: #b7cfee; color: #164a85; }

/* Login */
.login-wrap { min-height: 90vh; display: flex; align-items: center; justify-content: center; }
.card.login { width: 100%; max-width: 380px; }

/* Progress bar */
.bar { height: 8px; background: #e8ecf1; border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--teal); }

@media print { .topbar, .sidebar, .actions, .filters, .btn { display: none !important; } .content { padding: 0; } }
