/* ==========================================================================
   ZIN-NUR AKADEMIYASI - USTOZA PANELI (TEACHER PORTAL) STYLESHEET
   Brand Palette: Emerald #0F8A5F, Deep Emerald #0B6B49, Ink #04231A, Mint #E8F8F1
   ========================================================================== */

:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Bricolage Grotesque', sans-serif;

  --emerald-900: #04231A;
  --emerald-800: #072B20;
  --emerald-700: #0B6B49;
  --emerald-600: #0F8A5F;
  --emerald-500: #10B981;
  --emerald-400: #3DD68C;
  --emerald-100: #D1FAE5;
  --mint-50: #E8F8F1;
  --mint-100: #DCF3E9;

  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --radius-full: 9999px;

  --transition-fast: 0.18s ease;
  --transition-normal: 0.26s ease;
}

html[data-theme="light"] {
  --bg-app: #F5F9F7;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --text-main: #0B291F;
  --text-soft: #52675E;
  --text-muted: #849990;
  --border-color: #E2EBE6;
  --border-hover: #CBD9D1;
  --card-shadow: 0 4px 20px rgba(11, 41, 31, 0.05), 0 1px 3px rgba(11, 41, 31, 0.03);
  --header-bg: #FFFFFF;
  --header-border: #E8F0EB;
  --table-header-bg: #F3F8F5;
  --table-hover-row: #F7FCFA;
  --badge-bg: #E8F8F1;
  --badge-text: #0B6B49;
}

html[data-theme="dark"] {
  --bg-app: #061611;
  --bg-surface: #0C2019;
  --bg-card: #0E251D;
  --text-main: #EAF7F1;
  --text-soft: #A3BD82;
  --text-muted: #738F84;
  --border-color: #1A362D;
  --border-hover: #294D41;
  --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  --header-bg: #0C2019;
  --header-border: #1A362D;
  --table-header-bg: #091A14;
  --table-hover-row: #122F25;
  --badge-bg: rgba(16, 185, 129, 0.15);
  --badge-text: #3DD68C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-primary);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* ================= LOGIN SCREEN ================= */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(15, 138, 95, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 90% 80%, rgba(61, 214, 140, 0.08) 0%, transparent 50%),
              var(--bg-app);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: 0 20px 50px rgba(4, 35, 26, 0.08);
  animation: cardFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--mint-50);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 138, 95, 0.15);
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}
.login-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.login-header p {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}
.form-control {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  border-color: var(--emerald-600);
  box-shadow: 0 0 0 3px rgba(15, 138, 95, 0.12);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-700));
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition-fast), filter var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 4px 14px rgba(15, 138, 95, 0.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(15, 138, 95, 0.35);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ================= TEACHER DASHBOARD LAYOUT ================= */
.teacher-app {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.teacher-app.active {
  display: flex;
}

/* HEADER */
.teacher-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--card-shadow);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.teacher-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.t-avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald-600), var(--emerald-400));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.t-details h1 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.t-schedule-badge {
  font-size: 0.78rem;
  color: var(--emerald-600);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-outline:hover {
  background: var(--table-hover-row);
  border-color: var(--border-hover);
}
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-icon:hover {
  background: var(--table-hover-row);
}
.btn-icon svg {
  width: 17px;
  height: 17px;
}

/* MAIN CONTENT */
.teacher-main {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 60px;
  flex: 1;
}

/* STATS ROW */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
}
.stat-icon.emerald { background: rgba(15, 138, 95, 0.12); color: var(--emerald-600); }
.stat-icon.blue { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.stat-icon.amber { background: rgba(245, 158, 11, 0.12); color: #F59E0B; }
.stat-icon.purple { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }

.stat-content {
  display: flex;
  flex-direction: column;
}
.stat-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-soft);
}
.stat-number {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--text-main);
  line-height: 1.2;
}

/* FILTER & SEARCH BAR */
.filter-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--card-shadow);
}

.date-pill-group {
  display: flex;
  background: var(--table-header-bg);
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}
.date-pill {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}
.date-pill.active {
  background: var(--emerald-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 138, 95, 0.3);
}

.filter-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}
.search-box {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 320px;
}
.search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
}
.search-box input:focus {
  border-color: var(--emerald-600);
}
.search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.select-filter {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.86rem;
  outline: none;
}

/* BOOKINGS CARDS LIST */
.bookings-section-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bookings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.booking-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}
.booking-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}
.booking-card.is-today {
  border-left: 4px solid var(--emerald-600);
}

.booking-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.student-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}
.course-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--emerald-600);
  background: var(--badge-bg);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
}

.slot-highlight {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  background: var(--table-header-bg);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}
.slot-highlight svg {
  width: 17px;
  height: 17px;
  color: var(--emerald-600);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(15, 138, 95, 0.08);
  color: var(--emerald-600);
  text-decoration: none;
  border: 1px solid rgba(15, 138, 95, 0.2);
  transition: var(--transition-fast);
  flex: 1;
}
.btn-phone:hover {
  background: var(--emerald-600);
  color: #fff;
}
.btn-telegram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: rgba(41, 168, 234, 0.1);
  color: #29A8EA;
  text-decoration: none;
  border: 1px solid rgba(41, 168, 234, 0.25);
  transition: var(--transition-fast);
}
.btn-telegram:hover {
  background: #29A8EA;
  color: #fff;
}

.booking-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-select {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  outline: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-select.yangi {
  background: #EFF6FF;
  color: #2563EB;
  border-color: #BFDBFE;
}
.status-select.boglanildi {
  background: #FFFBEB;
  color: #D97706;
  border-color: #FDE68A;
}
.status-select.otildi {
  background: #ECFDF5;
  color: #059669;
  border-color: #A7F3D0;
}
.status-select.kelmadi {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FECACA;
}

.registered-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-xl);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}
.empty-state h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.empty-state p {
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--emerald-700);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.3s ease;
}
.toast.error {
  background: #DC2626;
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-inputs {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: 100%;
  }
}
