/* ============================================
   ADCHTI Topshiriq tizimi — asosiy stillar
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #1D9E75;
  --green-dark:  #0F6E56;
  --green-light: #E1F5EE;
  --red:         #E24B4A;
  --red-light:   #FCEBEB;
  --red-dark:    #A32D2D;
  --amber:       #EF9F27;
  --amber-light: #FAEEDA;
  --blue:        #378ADD;
  --blue-light:  #E6F1FB;
  --blue-dark:   #185FA5;
  --gray-100:    #F5F5F3;
  --gray-200:    #E8E8E4;
  --gray-400:    #AEAEAD;
  --gray-600:    #6B6B68;
  --gray-900:    #1A1A18;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 1px 4px rgba(0,0,0,0.08);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--gray-100);
  line-height: 1.6;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Login ──────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E1F5EE 0%, #E6F1FB 100%);
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}
.login-logo {
  text-align: center;
  margin-bottom: 20px;
}
.login-logo .circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-light);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.login-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.login-sub   { font-size: 12px; color: var(--gray-600); text-align: center; margin-bottom: 24px; }
.alert-err   { background: var(--red-light); color: var(--red-dark); border-radius: var(--radius); padding: 9px 14px; font-size: 13px; margin-bottom: 14px; }
.alert-ok    { background: var(--green-light); color: var(--green-dark); border-radius: var(--radius); padding: 9px 14px; font-size: 13px; margin-bottom: 14px; }

/* ─── Forms ──────────────────────────────── */
.fg { margin-bottom: 14px; }
.fg label { font-size: 12px; font-weight: 500; color: var(--gray-600); display: block; margin-bottom: 4px; }
.fg input, .fg select, .fg textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius); font-size: 13px;
  background: #fff; color: var(--gray-900);
  font-family: inherit; transition: border-color .15s;
}
.fg input:focus, .fg select:focus, .fg textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}
.fg textarea { resize: vertical; min-height: 80px; }
.fg .hint { font-size: 11px; color: var(--gray-400); margin-top: 3px; }

/* ─── Buttons ────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.btn-primary   { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn-outline   { background: #fff; color: var(--gray-900); border-color: var(--gray-200); }
.btn-outline:hover { background: var(--gray-100); }
.btn-danger    { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red-dark); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* ─── Layout ─────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px; flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--gray-200);
  display: flex; flex-direction: column;
}
.sidebar-logo {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo .logo-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--green-light); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.sidebar-logo .logo-text { font-size: 13px; font-weight: 600; color: var(--gray-900); line-height: 1.3; }
.sidebar-logo .logo-sub  { font-size: 11px; color: var(--gray-600); }

.sidebar-section { padding: 10px 0; border-bottom: 1px solid var(--gray-200); }
.sidebar-section-title { font-size: 10px; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; padding: 4px 18px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px; cursor: pointer;
  font-size: 13px; color: var(--gray-600);
  transition: background .12s; border: none; background: none; width: 100%; text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--gray-100); color: var(--gray-900); }
.nav-item.active { background: var(--green-light); color: var(--green-dark); font-weight: 500; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 6px; }
.nav-item .icon { font-size: 16px; width: 18px; text-align: center; }

.user-block {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 10px;
}
.av { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.av-rector { background: var(--blue-light); color: var(--blue-dark); }
.av-prorektor { background: var(--green-light); color: var(--green-dark); }
.av-dekan  { background: var(--amber-light); color: #633806; }
.u-name  { font-size: 13px; font-weight: 500; }
.u-role  { font-size: 11px; color: var(--gray-600); }
.btn-logout-sm { margin-left: auto; background: none; border: none; color: var(--gray-400); cursor: pointer; font-size: 18px; padding: 4px; border-radius: 4px; }
.btn-logout-sm:hover { background: var(--gray-100); color: var(--red); }

/* ─── Main content ───────────────────────── */
.content { flex: 1; overflow-y: auto; }
.page-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.page-title { font-size: 18px; font-weight: 600; }
.page-sub   { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.page-body  { padding: 24px 28px; }

/* ─── Stat cards ─────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 16px 18px;
}
.stat-label { font-size: 11px; font-weight: 500; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }
.stat-num   { font-size: 28px; font-weight: 700; margin-top: 4px; }
.stat-num.green  { color: var(--green); }
.stat-num.red    { color: var(--red); }
.stat-num.amber  { color: var(--amber); }
.stat-num.blue   { color: var(--blue); }

/* ─── Task cards ─────────────────────────── */
.task-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.task-card:hover { border-color: var(--gray-400); box-shadow: var(--shadow); }
.task-card.urgent { border-color: var(--red); border-width: 2px; background: var(--red-light); }
.task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.task-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.task-card.urgent .task-title { color: var(--red-dark); }
.task-body  { font-size: 13px; color: var(--gray-600); margin: 6px 0; }
.task-meta  { font-size: 12px; color: var(--gray-400); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.rector-note {
  background: #FFF8E6; border: 1px solid #FAC775;
  border-radius: var(--radius); padding: 9px 13px;
  margin-top: 10px; font-size: 13px; color: #633806;
  display: flex; gap: 8px; align-items: flex-start;
}
.rector-note strong { white-space: nowrap; }
.task-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ─── Status badges ──────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 20px; }
.s-new      { background: var(--blue-light);   color: var(--blue-dark); }
.s-prog     { background: var(--amber-light);  color: #633806; }
.s-urg      { background: var(--red-light);    color: var(--red-dark); }
.s-done     { background: var(--green-light);  color: var(--green-dark); }

/* ─── Filter tabs ────────────────────────── */
.filter-tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-tab {
  padding: 6px 14px; border-radius: 20px; font-size: 12px;
  border: 1px solid var(--gray-200); background: #fff; cursor: pointer;
  color: var(--gray-600); transition: all .12s; text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.filter-tab:hover { border-color: var(--green); color: var(--green); text-decoration: none; }
.filter-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
.filter-tab .cnt { font-size: 10px; opacity: .8; }

/* ─── Table ──────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; background: #fff; }
th { font-size: 11px; font-weight: 600; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); text-align: left; background: var(--gray-100); }
td { padding: 11px 14px; border-bottom: 1px solid var(--gray-200); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }

/* ─── Modal ──────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius-lg);
  padding: 28px 28px 24px; width: 460px; max-width: 96vw;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  animation: slideUp .2s ease;
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.tg-banner {
  background: var(--blue-light); border-radius: var(--radius);
  padding: 10px 14px; font-size: 12px; color: var(--blue-dark);
  margin-bottom: 8px; display: flex; gap: 8px; align-items: flex-start;
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .page-body { padding: 16px; }
  .stats { grid-template-columns: repeat(2,1fr); }
}
