/* ============================================================
   EduConnect — site.css
   ASP.NET 3.5 Web Application Stylesheet
   ============================================================ */

:root {
  --green:       #25D366;
  --green-dark:  #128C7E;
  --green-light: #DCF8C6;
  --ink:         #0D1F1A;
  --ink-mid:     #2C3E38;
  --ink-soft:    #4A6560;
  --cream:       #F7F5F0;
  --cream-dark:  #EDE9E2;
  --white:       #FFFFFF;
  --accent:      #FF6B35;
  --accent-soft: #FFF0EB;
  --blue:        #1A73E8;
  --blue-soft:   #E8F0FE;
  --red:         #E53935;
  --red-soft:    #FFEBEE;
  --shadow-sm:   0 1px 4px rgba(13,31,26,0.08);
  --shadow-md:   0 4px 20px rgba(13,31,26,0.10);
  --shadow-lg:   0 12px 48px rgba(13,31,26,0.14);
  --radius:      14px;
  --radius-sm:   8px;
}

/* ── RESET ──────────────────────────────────────────────────── */
* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; }

/* ── SCROLLBAR ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 3px; }

/* ── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
  position: fixed; left:0; top:0; bottom:0; width: 260px;
  background: var(--ink);
  display: flex; flex-direction: column;
  z-index: 100;
  padding: 0 0 20px;
}

.sidebar-logo {
  padding: 28px 24px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.logo-mark { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--green);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 22px; height: 22px; fill: #fff; }
.logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 18px; font-weight: 800; color: #fff; line-height: 1;
}
.logo-sub { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; letter-spacing: 0.04em; }

.sidebar-section-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 20px 24px 8px;
  text-transform: uppercase;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 24px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-item .nav-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
  transition: background .2s;
}
.nav-item .nav-icon svg {
  width: 18px; height: 18px;
  stroke: rgba(255,255,255,0.5); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .2s;
}
.nav-item .nav-label {
  font-size: 14px; color: rgba(255,255,255,0.55);
  font-weight: 400; transition: color .2s;
}
.nav-item .nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600;
  background: rgba(255,107,53,0.25); color: var(--accent);
  padding: 2px 7px; border-radius: 20px;
}

.nav-item:hover .nav-label  { color: rgba(255,255,255,0.85); }
.nav-item:hover .nav-icon   { background: rgba(255,255,255,0.10); }
.nav-item:hover .nav-icon svg { stroke: rgba(255,255,255,0.8); }

.nav-item.active {
  border-left-color: var(--green);
}
.nav-item.active .nav-icon   { background: var(--green); }
.nav-item.active .nav-icon svg { stroke: #fff; }
.nav-item.active .nav-label  { color: #fff; font-weight: 500; }

.sidebar-bottom {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.user-name  { font-size: 13px; color: rgba(255,255,255,0.75); font-weight: 500; }
.user-role  { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ── MAIN CONTENT ─────────────────────────────────────────────── */
.main {
  margin-left: 260px;
  padding: 32px 36px;
  min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 26px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em;
}
.page-subtitle { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: none; transition: all .2s; font-family: inherit;
  text-decoration: none;
}
.btn-ghost {
  background: var(--white); color: var(--ink-mid);
  border: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--cream); }
.btn-green {
  background: var(--green); color: #fff;
  box-shadow: 0 4px 14px rgba(37,211,102,0.35);
}
.btn-green:hover { background: #20c05c; }
.btn svg {
  width: 16px; height: 16px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* WhatsApp send button */
.btn-wa {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px;
  background: var(--green); color: #fff;
  font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: all .2s;
}
.btn-wa:hover    { background: #20c05c; transform: translateY(-1px); }
.btn-wa:active   { transform: translateY(0); }
.btn-wa:disabled { opacity: .7; cursor: not-allowed; transform: none; }

/* ── STAT CARDS ───────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative; overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.stat-icon svg { width: 20px; height: 20px; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.green   { background: #E8FFF3; }
.stat-icon.orange  { background: var(--accent-soft); }
.stat-icon.blue    { background: var(--blue-soft); }
.stat-icon.red     { background: var(--red-soft); }
.stat-value {
  font-family: 'Syne', sans-serif;
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1;
}
.stat-label { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

/* ── CARD ─────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  margin-bottom: 0;
}
.card-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-title {
  font-family: 'Syne', sans-serif;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px 24px; }

/* ── LAYOUT HELPERS ───────────────────────────────────────────── */
.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── FORM CONTROLS ────────────────────────────────────────────── */
.form-select, .form-input {
  font-family: inherit; font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-dark);
  background: var(--cream); color: var(--ink);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.form-select:focus, .form-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(37,211,102,0.15);
  background: var(--white);
}
.form-textarea {
  width: 100%; font-family: inherit;
  font-size: 14px; padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cream-dark);
  background: var(--cream); color: var(--ink);
  resize: vertical; min-height: 100px; outline: none;
  transition: border-color .2s, box-shadow .2s; line-height: 1.6;
}
.form-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(37,211,102,0.15);
  background: var(--white);
}

.field-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--ink-soft);
  display: block; margin-bottom: 6px;
}
.filters-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── STUDENT GRID (Attendance) ────────────────────────────────── */
.student-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 10px;
}
.student-card {
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 13px 13px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all .18s;
  background: var(--white);
  text-decoration: none; color: inherit;
}
.student-card:hover   { border-color: #aaa; box-shadow: var(--shadow-sm); }
.student-card.absent  { border-color: var(--red); background: var(--red-soft); }
.s-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  background: var(--blue-soft); color: var(--blue);
  transition: background .18s;
}
.student-card.absent .s-avatar { background: rgba(229,57,53,0.15); color: var(--red); }
.s-name   { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-roll   { font-size: 11px; color: var(--ink-soft); }
.s-status { margin-left: auto; font-size: 17px; flex-shrink: 0; }

/* ── CHIPS ────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.chip-green  { background: #E8FFF3; color: #0F6E56; }
.chip-red    { background: var(--red-soft); color: var(--red); }
.chip-orange { background: var(--accent-soft); color: var(--accent); }
.chip-blue   { background: var(--blue-soft); color: var(--blue); }
.chip-gray   { background: var(--cream-dark); color: var(--ink-soft); }

/* ── TEMPLATE TAG ─────────────────────────────────────────────── */
.template-tag {
  display: inline-block;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  background: rgba(37,211,102,0.12); color: var(--green-dark);
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase;
}

/* ── MESSAGE BUBBLE ───────────────────────────────────────────── */
.msg-bubble {
  background: var(--green-light);
  border-radius: 16px 16px 0 16px;
  padding: 14px 18px;
  font-size: 14px; line-height: 1.7;
  max-width: 440px;
  border: 1px solid #c3e9b8;
}

/* ── UPLOAD ZONE ──────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--cream-dark);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer; transition: all .2s;
  background: var(--cream);
}
.upload-zone:hover { border-color: var(--green); background: #f0fef5; }
.upload-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: #E8FFF3; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
}
.upload-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.upload-sub   { font-size: 13px; color: var(--ink-soft); }

/* ── DATA TABLE (GridView) ────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .grid-header th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 10px 16px; text-align: left;
  border-bottom: 1px solid var(--cream-dark);
  background: var(--cream);
}
.data-table td, .grid-row td {
  padding: 12px 16px; font-size: 13px;
  border-bottom: 1px solid var(--cream-dark);
  vertical-align: middle;
}
.data-table tr:last-child td, .grid-row:last-child td { border-bottom: none; }
.data-table tr:hover td, .grid-row:hover td { background: var(--cream); }
.data-table .name-cell { font-weight: 500; }

/* ── SEND BAR ─────────────────────────────────────────────────── */
.send-bar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 20px;
  background: var(--ink); border-radius: var(--radius);
}
.send-bar-info { color: rgba(255,255,255,0.7); font-size: 13px; }
.send-bar-info strong { color: #fff; }

/* ── ACTIVITY LOG ─────────────────────────────────────────────── */
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--cream-dark);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 5px;
}
.activity-dot.green  { background: var(--green); }
.activity-dot.orange { background: var(--accent); }
.activity-dot.blue   { background: var(--blue); }
.activity-dot.red    { background: var(--red); }
.activity-dot.gray   { background: var(--ink-soft); }
.activity-text { font-size: 13px; line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

/* ── ALERT BOX ────────────────────────────────────────────────── */
.alert-box {
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 18px;
  display: block; border-left: 4px solid transparent;
}
.alert-success { background: #E8FFF3; color: #0F6E56; border-color: var(--green); }
.alert-error   { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.alert-info    { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }

/* ── VALIDATION ERRORS ────────────────────────────────────────── */
.val-error { color: var(--red); font-size: 12px; display: block; margin-top: 4px; }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: var(--ink); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: all .35s cubic-bezier(.34,1.56,.64,1);
  z-index: 9999;
  display: flex; align-items: center; gap: 10px;
  max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast-icon {
  width: 22px; height: 22px; background: var(--green); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ── PROGRESS BAR ─────────────────────────────────────────────── */
.progress-bar { height: 4px; background: var(--cream-dark); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .5s; }

/* ── PAGE ANIMATION ───────────────────────────────────────────── */
.main form > * { animation: fadeUp .3s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .two-col   { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar       { width: 0; overflow: hidden; }
  .main          { margin-left: 0; padding: 20px 16px; }
  .stats-row     { grid-template-columns: 1fr 1fr; }
  .student-grid  { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ── FILE CHOSEN BAR (upload result) ──────────────────────────
   Shows after user picks a file from the upload zone.
   Replaces the zone and shows filename + clear button.     */
.file-chosen-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #E8FFF3;
  border: 1.5px solid #b2e8ac;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.file-chosen-icon { font-size: 18px; flex-shrink: 0; }
.file-chosen-name {
  flex: 1;
  font-weight: 500;
  color: var(--ink-mid);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-chosen-clear {
  flex-shrink: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 15px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .15s, color .15s;
}
.file-chosen-clear:hover {
  background: var(--red-soft);
  color: var(--red);
}
.date-box {
    width: 180px;
    height: 32px;
    padding-right: 35px;
    font-size: 14px;
    font-family: inherit;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--cream-dark);
    background: var(--cream);
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.date-container {
    position: relative;
    display: inline-block;
}

.calendar-icon {
    position: absolute;
    right: 8px;
    top: 4px;
    cursor: pointer;
    font-size: 18px;
}