/* icSmartGrid 2026 — Paper Evaluation System (spec §14) */

:root {
  --navy: #0f2a4a;
  --teal: #0e7c66;
  --amber: #d97706;
  --bg: #f4f6f9;
  --card: #fff;
  --line: #dfe5ec;
  --ink: #1c2733;
  --muted: #5b6b7c;
  --danger: #b3261e;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--teal); }
a:hover { color: #0a5f4e; }

h1, h2, h3 { color: var(--navy); line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 12px; }

.muted, small.muted { color: var(--muted); font-size: 0.86rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--teal); }
.warn-text { color: var(--amber); }
.danger-text { color: var(--danger); }

/* ---------- Top banner ---------- */

.top-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(135deg, #0f2a4a 0%, #143a66 60%, #16497e 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 42, 74, 0.25);
}

.banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-logo {
  flex: none;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.banner-logo img { display: block; width: 150px; height: auto; }

/* System-wide (Colak Academia) logo is portrait — size by height instead. */
.banner-logo--system img { width: auto; height: 52px; }

.banner-title { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.2px; }
.banner-sub { font-size: 0.78rem; opacity: 0.85; margin-top: 2px; }

/* ---------- Navigation ---------- */

.main-nav {
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 42, 74, 0.06);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 12px;
}

.main-nav a {
  display: inline-block;
  padding: 11px 12px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.89rem;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover { color: var(--teal); background: #f4faf8; }
.main-nav a.active { color: var(--teal); border-bottom-color: var(--teal); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-user { color: var(--muted); font-size: 0.85rem; font-weight: 600; padding: 4px 0; }

.nav-conf {
  background: #e3edfb;
  color: #1d4ed8;
  border: 1px solid #c6dbf6;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.main-nav a.nav-logout { color: var(--danger); border-bottom-color: transparent; }
.main-nav a.nav-logout:hover { background: #fdf1f0; }

/* ---------- Layout ---------- */

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 42, 74, 0.08);
  padding: 18px 20px;
  margin: 0 0 20px;
}

.card > h1:first-child, .card > h2:first-child, .card > h3:first-child { margin-top: 2px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.login-card { max-width: 440px; margin: 44px auto; }

.help {
  background: #eef6f3;
  border: 1px solid #cde5de;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.86rem;
  color: #2a4a42;
  margin: 12px 0;
}

.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 18px 12px 30px;
}

/* ---------- Stat cards (admin dashboard) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card, .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 42, 74, 0.08);
  padding: 14px 16px;
  text-align: center;
}

.stat-card .num, .stat .num {
  display: block;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
}

.stat-card .lbl, .stat .lbl {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ---------- Buttons ---------- */

.btn, button.btn {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 9px 16px;
  font: inherit;
  font-size: 0.89rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.btn:hover { background: #0a6553; border-color: #0a6553; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--teal);
}
.btn-outline:hover { background: #eaf5f2; color: var(--teal); }

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #921d16; border-color: #921d16; }

.btn-sm { padding: 5px 10px; font-size: 0.8rem; border-radius: 6px; }
.btn-block { display: block; width: 100%; text-align: center; }

.btn[disabled], button[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ---------- Badges & status ---------- */

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-f { background: #fdf1de; color: var(--amber); border: 1px solid #f2dcb3; }
.badge-o { background: #e3edfb; color: #1d4ed8; border: 1px solid #c6dbf6; }

.status-done { color: var(--teal); font-weight: 600; white-space: nowrap; }
.status-pending { color: var(--muted); white-space: nowrap; }

.progress {
  background: #e6ebf1;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  min-width: 80px;
}

.progress > span, .progress .fill {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}

/* ---------- Tables ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  background: transparent;
}

th, td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.89rem;
}

thead th {
  background: #f0f3f7;
  color: var(--navy);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 2px solid var(--line);
}

tbody tr:nth-child(even) { background: #fafbfd; }
tbody tr:hover { background: #eef6f3; }

td.actions, th.actions { white-space: nowrap; text-align: right; }
td.num, th.num { text-align: right; white-space: nowrap; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Forms ---------- */

label { font-weight: 600; font-size: 0.87rem; color: var(--navy); }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 5px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c7d0da;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, 0.15);
}

textarea { min-height: 110px; resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 14px;
}

.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Session assignment checkboxes (admin/chairs.php) */

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.checkbox-grid label, .check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  background: #fff;
}

.checkbox-grid label:hover, .check-label:hover { border-color: var(--teal); }

label.suggested, .suggested {
  background: #fdf3e0;
  border-color: var(--amber) !important;
}

input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
  cursor: pointer;
}

/* ---------- Score radio matrix (evaluate.php) ---------- */

.score-table th, .score-table td { text-align: center; vertical-align: middle; }
.score-table th.crit, .score-table td.crit { text-align: left; width: 40%; }

.score-table thead th { background: var(--navy); color: #fff; }
.score-table .cap { font-size: 0.72rem; font-weight: 600; opacity: 0.9; display: block; }

.score-table td.opt { padding: 4px 2px; }

.score-table td.opt label {
  display: block;
  padding: 12px 6px;
  cursor: pointer;
  border-radius: 6px;
}

.score-table td.opt label:hover { background: #eaf5f2; }

.score-table input[type="radio"] { width: 22px; height: 22px; }

/* ---------- Flash messages ---------- */

.flash {
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0 0 16px;
  font-weight: 500;
  font-size: 0.92rem;
  background: #e6f4ee;
  border: 1px solid #b9e0d1;
  color: #14563f;
}

.flash-ok, .flash.ok, .flash.success {
  background: #e6f4ee;
  border-color: #b9e0d1;
  color: #14563f;
}

.flash-error, .flash.error, .flash-err, .flash.danger {
  background: #fdecea;
  border-color: #f3c1bd;
  color: #7f1d16;
}

/* ---------- Session cards (chair dashboard) ---------- */

.session-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.session-meta { color: var(--muted); font-size: 0.86rem; margin-bottom: 8px; }

.progress-note { color: var(--muted); font-size: 0.86rem; margin: 2px 0 8px; flex-basis: 100%; }
.progress-note strong { color: var(--teal); }

.form-logo { display: block; width: 160px; height: auto; margin-bottom: 8px; }

/* ---------- Chair responsibilities note (chair dashboard) ---------- */

.duties-card {
  border-left: 4px solid var(--amber);
  background: #fffdf7;
}

.duties-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  font-size: 1rem;
  list-style: none;
}

.duties-summary::-webkit-details-marker { display: none; }
.duties-summary::after {
  content: "\25BE";
  margin-left: auto;
  color: var(--muted);
  font-size: 0.9rem;
}
.duties-card:not([open]) .duties-summary::after { content: "\25B8"; }

.duties-icon { font-size: 1.15rem; }

.duties-list { margin: 12px 0 2px; padding-left: 22px; }
.duties-list > li { margin-bottom: 10px; }

.duties-how {
  display: block;
  margin-top: 3px;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 400;
}
.duties-how em { color: var(--teal); font-style: normal; font-weight: 600; }

/* ---------- Certificate projection view (certificate.php) ---------- */

.cert-body {
  margin: 0;
  min-height: 100vh;
  background: #0b1622;
  color: #eef3f8;
  display: flex;
  flex-direction: column;
}

.cert-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #0f2a4a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cert-bar-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cert-paper { font-weight: 700; }
.cert-presenter { color: #bcd0e6; }
.cert-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cert-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cert-img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.cert-frame {
  width: 100%;
  height: calc(100vh - 88px);
  border: 0;
  border-radius: 6px;
  background: #fff;
}

.cert-missing { max-width: 640px; text-align: center; color: #dbe6f2; }
.cert-missing-icon { font-size: 3rem; margin-bottom: 6px; }
.cert-missing h1 { color: #fff; }
.cert-missing-sub { color: #9db4cd; }
.cert-missing-note { color: #9db4cd; }
.cert-missing code {
  background: rgba(255, 255, 255, 0.12);
  color: #ffe1b0;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
}

@media print {
  .cert-body { background: #fff; color: #000; }
  .cert-stage { padding: 0; }
  .cert-img { max-height: none; box-shadow: none; }
}

/* ---------- Mobile (chairs may use phones) ---------- */

@media (max-width: 720px) {
  body { font-size: 14px; }

  .container { padding: 12px 10px 30px; }
  .card { padding: 13px 12px; border-radius: 8px; }
  .banner-inner { padding: 8px 12px; gap: 10px; }
  .banner-logo { padding: 4px 7px; border-radius: 6px; }
  .banner-logo img { width: 96px; }
  .banner-logo--system img { width: auto; height: 40px; }
  .banner-title { font-size: 0.9rem; }
  .banner-sub { font-size: 0.72rem; }

  .nav-inner { padding: 0 4px; }
  .main-nav a { padding: 10px 8px; font-size: 0.82rem; }
  .nav-user { display: none; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .btn { flex: 1 1 auto; text-align: center; }

  /* Generic tables scroll horizontally so nothing is cut off. */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 8px 7px; font-size: 0.84rem; }

  /* The score matrix must stay usable without scrolling: tighten cells,
     keep large touch targets on the radio labels. */
  .score-table { display: table; width: 100%; }
  .score-table th.crit, .score-table td.crit { width: 36%; font-size: 0.8rem; }
  .score-table td.opt { padding: 2px 1px; }
  .score-table td.opt label { padding: 12px 2px; }
  .score-table input[type="radio"] { width: 21px; height: 21px; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; color: #000; }

  .top-banner { position: static; box-shadow: none; }

  .main-nav,
  .no-print,
  .btn,
  button,
  .flash,
  .site-footer { display: none !important; }

  .container { max-width: none; padding: 0; }

  .card {
    box-shadow: none;
    border-color: #aaa;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  tbody tr:hover { background: transparent; }

  a { color: inherit; text-decoration: none; }
}
