/* HP International School Badaun - Substitute System Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:    #185FA5;
  --blue-dk: #0C447C;
  --green:   #22a94a;
  --amber:   #e6a817;
  --red:     #d93025;
  --gray:    #f5f5f5;
  --border:  #ddd;
  --text:    #222;
  --muted:   #888;
}

body { font-family: Arial, sans-serif; background: var(--gray); color: var(--text); font-size: 14px; }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  flex-wrap: wrap;
  gap: 8px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo   { font-size: 24px; }
.nav-title  { font-size: 15px; font-weight: 700; line-height: 1.2; }
.nav-sub    { font-size: 10px; opacity: .7; }
.nav-links  { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: #fff; text-decoration: none; padding: 5px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; opacity: .85; transition: background .2s;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.2); opacity: 1; }
.nav-user { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 0 8px; }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.btn-logout {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: 5px 12px; border-radius: 6px; font-size: 12px; cursor: pointer;
  text-decoration: none; transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.25); }
.notif-link { position: relative; font-size: 16px; padding: 5px 8px; }
.notif-badge {
  position: absolute; top: 0; right: 0; background: var(--red); color: #fff;
  border-radius: 50%; width: 16px; height: 16px; font-size: 9px;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.badge-red {
  background: var(--red); color: #fff; border-radius: 10px;
  padding: 1px 6px; font-size: 10px; font-weight: 700; margin-left: 4px;
}

/* ===== FLASH MESSAGES ===== */
.flash {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 1.5rem; font-size: 13px; font-weight: 600;
}
.flash button { background: none; border: none; cursor: pointer; font-size: 16px; opacity: .6; }
.flash-success { background: #d4edda; color: #155724; }
.flash-danger  { background: #f8d7da; color: #721c24; }
.flash-warning { background: #fff3cd; color: #856404; }
.flash-info    { background: #d1ecf1; color: #0c5460; }

/* ===== LAYOUT ===== */
.main-wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 1.2rem; color: var(--blue); }
.site-footer { text-align: center; padding: 20px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 2rem; }

/* ===== CARDS ===== */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 1.2rem 1.4rem; margin-bottom: 1rem;
}
.card-title { font-size: 14px; font-weight: 700; margin-bottom: 1rem; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== STAT CARDS ===== */
.stat-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 1.2rem; text-align: center;
}
.stat-num  { font-size: 32px; font-weight: 700; color: var(--blue); }
.stat-lbl  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.stat-card.green .stat-num { color: var(--green); }
.stat-card.amber .stat-num { color: var(--amber); }
.stat-card.red   .stat-num { color: var(--red); }

/* ===== BUTTONS ===== */
.btn {
  padding: 7px 16px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none; display: inline-block; transition: background .15s;
  font-family: Arial, sans-serif;
}
.btn:hover      { background: #f0f0f0; }
.btn-primary    { background: var(--blue); color: #fff; border-color: var(--blue-dk); }
.btn-primary:hover { background: var(--blue-dk); }
.btn-success    { background: var(--green); color: #fff; border-color: #1a7a37; }
.btn-success:hover { background: #1a7a37; }
.btn-danger     { background: var(--red); color: #fff; border-color: #a82020; }
.btn-danger:hover  { background: #a82020; }
.btn-warning    { background: var(--amber); color: #fff; border-color: #b07d10; }
.btn-warning:hover { background: #b07d10; }
.btn-sm  { padding: 4px 10px; font-size: 11px; }
.btn-xs  { padding: 3px 8px; font-size: 11px; }
.btn-lg  { padding: 10px 22px; font-size: 14px; }

/* ===== FORMS ===== */
.form-group  { margin-bottom: 1rem; }
.form-label  { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.form-control {
  width: 100%; padding: 8px 10px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--text); font-family: Arial, sans-serif;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,95,165,.1); }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--red); margin-top: 4px; }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { background: #1a1a2e; color: #fff; padding: 9px 10px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:nth-child(even) td { background: #fafafa; }
tr:hover td { background: #f0f5ff; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-accepted { background: #d4edda; color: #155724; }
.badge-info     { background: #d1ecf1; color: #0c5460; }
.badge-blue     { background: #E6F1FB; color: var(--blue); }

/* ===== STATUS DOTS ===== */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red   { background: var(--red); }

/* ===== PERIOD DOTS (numbered) ===== */
.pd-wrap { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.pd {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.pd-free { background: var(--green); }
.pd-own  { background: var(--red); }
.pd-sub  { background: var(--amber); }

/* ===== LOGIN PAGE ===== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, var(--blue) 100%);
  padding: 20px;
}
.login-card {
  background: #fff; border-radius: 14px; padding: 2.5rem 2rem;
  width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo  { text-align: center; font-size: 42px; margin-bottom: 8px; }
.login-title { text-align: center; font-size: 18px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.login-sub   { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 1.8rem; }

/* ===== ARRANGE PAGE ===== */
.ptab {
  padding: 5px 12px; font-size: 11px; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer; color: var(--muted); background: #fff;
}
.ptab.active { background: var(--blue); color: #fff; border-color: var(--blue-dk); }
.period-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 1rem; }
.trow {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #eee; gap: 8px;
}
.trow:last-child { border-bottom: none; }
.tname  { font-size: 13px; font-weight: 700; }
.tclass { font-size: 11px; color: var(--blue); font-weight: 600; margin-top: 2px; }
.tmeta  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.workload { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.period-row {
  display: grid; grid-template-columns: 90px 1fr 100px;
  gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee;
}
.period-row:last-child { border-bottom: none; }
.abs-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; background: #f0f0f0; border-radius: 20px; font-size: 12px; margin: 3px;
}
.abs-chip button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 14px; }
.asgn-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; gap: 8px;
  background: #f7f7f7;
}
.asgn-row.conflict { background: #fdecea; border: 1px solid #e57373; }
.conflict-badge { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.conflict-alert { background: #fdecea; border: 1px solid #e57373; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; font-size: 12px; color: var(--red); }
.sec-title { font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; margin: 8px 0 4px; letter-spacing: .04em; }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal {
  background: #fff; border-radius: 12px; padding: 1.4rem; min-width: 280px;
  max-width: 420px; width: 92%; max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.modal-opt { padding: 10px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; border: 1px solid var(--border); margin-bottom: 6px; }
.modal-opt:hover { background: #f5f5f5; }

/* ===== ACCEPT BUTTON (teacher) ===== */
.accept-box {
  background: #f0faf4; border: 1px solid #b2dfca; border-radius: 8px;
  padding: 12px 16px; margin-bottom: 8px;
}
.accepted-stamp {
  color: var(--green); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}

/* ===== PRINT ===== */
@media print {
  body { background: #fff; }
  .navbar, .site-footer, .flash, .no-print { display: none !important; }
  .main-wrap { padding: 0; max-width: 100%; }
  @page { size: A4 landscape; margin: 15mm; }
  .print-table th { background: #1a1a2e !important; color: #fff !important; -webkit-print-color-adjust: exact; }
  .sign-box { border: 1px solid #aaa; min-height: 36px; width: 120px; display: inline-block; position: relative; border-radius: 3px; }
  .sign-label { font-size: 9px; color: #888; display: block; text-align: center; margin-top: 20px; }
  .badge { -webkit-print-color-adjust: exact; }
}

/* ===== MISC ===== */
.text-muted  { color: var(--muted); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }
.text-blue   { color: var(--blue); }
.fw-bold     { font-weight: 700; }
.fs-sm       { font-size: 11px; }
.mt-1        { margin-top: .5rem; }
.mt-2        { margin-top: 1rem; }
.mb-1        { margin-bottom: .5rem; }
.mb-2        { margin-bottom: 1rem; }
.d-flex      { display: flex; }
.gap-1       { gap: 6px; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
