﻿:root {
  /* Colors - Deep Slate and Emerald Theme */
  --bg-primary: #060d1a;
  --bg-secondary: #111f34;
  --surface: rgba(27, 43, 68, 0.78);
  --surface-hover: rgba(38, 58, 86, 0.9);

  --accent-primary: #10b981;
  /* Emerald */
  --accent-secondary: #3b82f6;
  /* Blue */

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(148, 163, 184, 0.2);
  --border-glow: rgba(16, 185, 129, 0.38);

  --status-present: #10b981;
  --status-absent: #ef4444;
  --status-excused: #f59e0b;
  --status-late: #8b5cf6;
  --status-early: #ec4899;

  --shadow-lg: 0 18px 40px -14px rgba(2, 8, 23, 0.65), 0 8px 20px -10px rgba(2, 8, 23, 0.5);
  --glass-blur: blur(16px);

  --font-main: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;

  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(at 12% 6%, rgba(16, 185, 129, 0.16) 0px, transparent 56%),
    radial-gradient(at 88% 95%, rgba(14, 116, 144, 0.22) 0px, transparent 52%),
    linear-gradient(140deg, #040a14 0%, #051426 42%, #041225 100%);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* =============================================
   UTILITY CLASSES (replaces Tailwind CDN)
   ============================================= */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.w-full {
  width: 100%;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-xs {
  max-width: 20rem;
}

.max-w-md {
  max-width: 28rem;
}

.text-center {
  text-align: center;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.font-bold {
  font-weight: 700;
}

.font-extrabold {
  font-weight: 800;
}

.font-black {
  font-weight: 900;
}

.font-medium {
  font-weight: 500;
}

.uppercase {
  text-transform: uppercase;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-6 {
  margin-top: 1.5rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.space-y-4>*+* {
  margin-top: 1rem;
}

.space-y-2>*+* {
  margin-top: 0.5rem;
}

.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-\[200\] {
  z-index: 200;
}

.text-white {
  color: #fff;
}

.text-red-400 {
  color: #f87171;
}

.text-emerald-500 {
  color: #10b981;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.rounded-full {
  border-radius: 9999px;
}

.w-16 {
  width: 4rem;
}

.h-16 {
  height: 4rem;
}

.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

.border-4 {
  border-width: 4px;
}

.border-2 {
  border-width: 2px;
}

.border-emerald-500 {
  border-color: #10b981;
}

.border-t-transparent {
  border-top-color: transparent;
}

.border-t-white {
  border-top-color: #fff;
}

.border-white\/30 {
  border-color: rgba(255, 255, 255, 0.3);
}

.bg-black\/80 {
  background: rgba(0, 0, 0, 0.8);
}

.bg-bg-primary {
  background-color: #0a0f18;
}

.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .5;
  }
}



/* Glassmorphism */
.glass {
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.glass-card {
  border-radius: 1.5rem;
  padding: 2rem;
  overflow: visible;
  /* Позволяет выпадающим меню (Excel) отображаться поверх */
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 25px 40px -15px rgba(0, 0, 0, 0.6);
}

/* Sidebar */
.sidebar {
  width: 250px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
}

.sidebar nav {
  flex: 1;
  /* takes all remaining space so mt-auto works below */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Language toggle inside sidebar */
.sidebar-lang {
  display: flex;
  gap: 0.375rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.375rem;
}

.sidebar-lang-btn {
  flex: 1;
  padding: 0.4rem 0;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
  background: transparent;
  color: var(--text-muted);
}

.sidebar-lang-btn.active {
  background: #10b981;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), transparent);
  border-left: 3px solid var(--accent-primary);
}

.sidebar-brand {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* Main Content */
.main-content {
  margin-left: 250px;
  padding: 1.5rem 2rem;
  max-width: 1400px;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border: none;
  font-size: 0.9375rem;
}

.btn-primary {
  background: linear-gradient(135deg, #16c58d, #0f9f76);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Table Design */
.premium-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.75rem;
}

.premium-table th {
  padding: 1rem 1.5rem;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.premium-table tr td {
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  transition: all 0.2s ease;
}

.premium-table tr td:first-child {
  border-radius: 1rem 0 0 1rem;
  border-left: 1px solid var(--border-color);
}

.premium-table tr td:last-child {
  border-radius: 0 1rem 1rem 0;
  border-right: 1px solid var(--border-color);
}

.premium-table tr:hover td {
  background: var(--surface-hover);
  border-top: 1px solid var(--border-glow);
  border-bottom: 1px solid var(--border-glow);
}

/* Status Badges */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-present {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-absent {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* Меню экспорта Excel всегда поверх остальных блоков */
#export-menu {
  position: absolute;
  z-index: 9999;
  overflow: visible;
}

/* Хедер с Excel-кнопкой должен не обрезать дочерние элементы */
header {
  overflow: visible;
  position: relative;
  z-index: 200;
}

/* Inputs */
.input-premium {
  background: rgba(12, 21, 35, 0.78);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 0.875rem 1.25rem;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-premium:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

/* Tab Management */
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.tab-content.active {
  display: block;
}

/* Bottom Nav (Mobile Only) */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  z-index: 100;
  justify-content: space-around;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    width: 80px;
    padding: 1.5rem 0.5rem;
  }

  .sidebar .nav-text,
  .sidebar .brand-text {
    display: none;
  }

  .main-content {
    margin-left: 80px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem 1rem 5.5rem;
    /* bottom учитывает мобильный nav */
  }

  .mobile-nav {
    display: flex;
  }

  .premium-table thead {
    display: none;
  }

  .premium-table tr {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .premium-table td {
    background: var(--surface);
    padding: 1rem !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 1rem !important;
  }

  .flex-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
  }

  /* Единый отступ для карточек на мобильном */
  .glass-card {
    padding: 1.25rem;
    border-radius: 1.25rem;
    margin-bottom: 0.75rem;
  }
}

/* Mobile Student Cards */
.student-card {
  background: var(--surface);
  border-radius: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.student-card:hover {
  border-color: var(--accent-primary);
  background: var(--surface-hover);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.status-btn {
  height: 3.5rem;
  border-radius: 1rem;
  font-weight: 800;
  font-size: 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.status-btn span:last-child {
  font-size: 0.65rem;
  opacity: 0.8;
  text-transform: uppercase;
}

.status-btn.active {
  transform: scale(0.98);
}

.status-btn-present.active {
  background: var(--status-present);
  color: white;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.status-btn-absent.active {
  background: var(--status-absent);
  color: white;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.status-btn-excused.active {
  background: var(--status-excused);
  color: white;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.status-btn:not(.active) {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

.status-btn:active {
  transform: scale(0.95);
}

/* Button Loading State */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* =============================================
   JOURNAL: MOBILE vs DESKTOP VISIBILITY
   ============================================= */

/* По умолчанию (мобильный): показываем карточки, скрываем таблицу */
.journal-mobile-list {
  display: block;
  margin-bottom: 1rem;
}

.journal-desktop-table {
  display: none;
}

/* Десктоп: скрываем карточки, показываем таблицу */
@media (min-width: 769px) {
  .journal-mobile-list {
    display: none;
  }

  .journal-desktop-table {
    display: block;
    margin-bottom: 1.5rem;
  }
}

/* =============================================
   JOURNAL HEADER & TOOLBAR
   ============================================= */
.journal-header {
  margin-bottom: 1rem;
}

.title-responsive {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
}

.journal-toolbar {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.journal-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.export-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.btn-export {
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.input-date {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  min-width: 0;
  flex: 1;
}

.input-group-select {
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  width: 100%;
}

@media (min-width: 769px) {
  .journal-header {
    margin-bottom: 0.5rem;
  }

  .title-responsive {
    font-size: 2.25rem;
  }

  .journal-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
  }

  .input-date {
    width: auto;
    flex: none;
  }

  .export-wrapper {
    width: auto;
  }

  .input-group-select {
    width: auto;
    min-width: 160px;
  }
}

/* =============================================
   EXCEL DROPDOWN (fixed — вне любых overflow)
   ============================================= */
.export-dropdown-fixed {
  position: fixed;
  z-index: 99999;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  min-width: 200px;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.export-dropdown-title {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0.875rem 1rem 0.5rem;
}

.export-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.export-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.export-dropdown-item:last-child {
  padding-bottom: 0.875rem;
}

/* =============================================
   MOBILE JOURNAL CARDS (jc-card)
   ============================================= */
.jc-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s ease;
}

.jc-card:active {
  border-color: var(--border-glow);
}

.jc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.875rem;
  gap: 0.5rem;
}

.jc-card-info {
  flex: 1;
  min-width: 0;
}

.jc-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jc-card-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.jc-card-btns {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  flex-shrink: 0;
}

.jc-btn-opts {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jc-btn-opts:active {
  background: rgba(255, 255, 255, 0.12);
}

.jc-btn-del {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.625rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.jc-btn-del:active {
  background: rgba(239, 68, 68, 0.25);
}

/* =============================================
   ADD STUDENT CARD
   ============================================= */
.add-student-card {
  margin-top: 0.75rem;
}

.add-student-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #10b981;
  margin-bottom: 0.75rem;
}

.add-student-row {
  display: flex;
  gap: 0.5rem;
}

.add-student-row .input-premium {
  flex: 1;
  padding: 0.75rem 1rem;
}

.add-student-row .btn {
  flex-shrink: 0;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
}

/* =============================================
   LARGER TOUCH TARGETS (MOBILE GLOBAL)
   ============================================= */
@media (max-width: 768px) {
  .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
  }

  .input-premium {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    /* prevents iOS zoom on focus */
  }

  .glass-card {
    padding: 1.25rem;
    border-radius: 1.25rem;
    margin-bottom: 0.75rem;
  }

  /* Don't lift cards on mobile (bad UX) */
  .glass-card:hover {
    transform: none;
  }
}

/* =============================================
   STATUS BUTTONS (replaces Tailwind inline)
   ============================================= */
.status-btn-row {
  display: flex;
  gap: 0.375rem;
  width: 100%;
}

.status-btn-row--mobile {
  gap: 0.375rem;
}

.status-btn {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.25rem;
  border-radius: 0.75rem;
  font-weight: 800;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  border: 1px solid transparent;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-btn-row--mobile .status-btn {
  padding: 0.8rem 0.25rem;
  font-size: 10px;
}

.status-btn-inactive {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

.status-btn-inactive:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.status-btn-present {
  background: #10b981;
  color: white;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.status-btn-absent {
  background: #ef4444;
  color: white;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.status-btn-excused {
  background: #f59e0b;
  color: white;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}

.status-btn-loading {
  opacity: 0.5;
  pointer-events: none;
}

/* =============================================
   LANGUAGE SWITCHER
   ============================================= */
.lang-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.05em;
  margin: 0 0.125rem;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.lang-btn-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

.lang-switcher-sidebar {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.lang-switcher-header {
  display: flex;
  gap: 0;
}

.lang-switcher-header .lang-btn {
  margin: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 0;
}

.lang-switcher-header .lang-btn:first-child {
  border-radius: 0.5rem 0 0 0.5rem;
}

.lang-switcher-header .lang-btn:last-child {
  border-radius: 0 0.5rem 0.5rem 0;
  border-left: none;
}

/* =============================================
   FLOATING LANGUAGE TOGGLE
   Always visible in top-right corner on mobile.
   On desktop (>=769px) it's hidden because sidebar has the switcher.
   ============================================= */
.lang-float {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  background: rgba(10, 15, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.lang-float-btn {
  min-width: 48px;
  height: 34px;
  padding: 0 0.8rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lang-float-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.lang-float-btn.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

body.app-auth .lang-float {
  top: 0.9rem;
}

@media (max-width: 768px) {
  .lang-float {
    top: 0.75rem;
    right: 0.75rem;
  }

  .lang-float-btn {
    min-width: 44px;
    height: 32px;
    padding: 0 0.7rem;
  }
}


.weekend-note {
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-btn-disabled {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(0.2);
}



/* ===== Final UI Overrides ===== */
button {
  font-family: var(--font-main);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
}

/* Cleaner journal action buttons (remove browser default white style) */
.row-option-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(12, 25, 40, 0.72);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.row-option-btn:hover {
  color: #f8fafc;
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.12);
}

.row-delete-btn {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(239, 68, 68, 0.42);
  background: rgba(127, 29, 29, 0.2);
  color: #f87171;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.16s ease;
}

.row-delete-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fecaca;
}

/* Strong, clear status buttons */
.status-btn-row {
  gap: 0.45rem;
}

.status-btn {
  min-height: 2.35rem;
  padding: 0.7rem 0.45rem;
  border-radius: 0.72rem;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border: 1px solid rgba(148, 163, 184, 0.24);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.status-btn-inactive {
  background: rgba(16, 30, 49, 0.82);
  color: #9fb0c9;
}

.status-btn-inactive:hover {
  background: rgba(24, 40, 64, 0.95);
  color: #d7e1ef;
  border-color: rgba(148, 163, 184, 0.4);
}

.status-btn-present {
  background: linear-gradient(135deg, #16c58d, #0f9f76);
  border-color: rgba(16, 185, 129, 0.68);
  color: #f0fdfa;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.26), 0 0 22px rgba(16, 185, 129, 0.38);
}

.status-btn-absent {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: rgba(248, 113, 113, 0.68);
  color: #fff1f2;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.24), 0 0 22px rgba(239, 68, 68, 0.32);
}

.status-btn-excused {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: rgba(251, 191, 36, 0.68);
  color: #fffbeb;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22), 0 0 22px rgba(245, 158, 11, 0.28);
}

.status-btn:active {
  transform: scale(0.98);
}

/* Login language switch — centered and safe on all widths */
body:not(.app-auth) .lang-float {
  left: 50%;
  right: auto;
  top: 0.75rem;
  transform: translateX(-50%);
  max-width: calc(100vw - 1rem);
}

body:not(.app-auth) .lang-float-btn {
  min-width: 56px;
}

select, option {
  background: #0f1d31;
  color: var(--text-primary);
}

/* Mobile reliability + tap targets */
@media (max-width: 768px) {
  .journal-mobile-list {
    padding-bottom: 0.5rem;
  }

  .jc-card {
    padding: 1rem;
    border-radius: 1rem;
  }

  .status-btn-row--mobile {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .status-btn-row--mobile .status-btn {
    min-height: 48px;
    padding: 0.72rem 0.3rem;
    font-size: 12px;
    letter-spacing: 0.01em;
    touch-action: manipulation;
  }

  .row-option-btn {
    min-height: 36px;
    padding: 0.45rem 0.65rem;
    font-size: 0.72rem;
  }

  .row-delete-btn {
    min-width: 36px;
    min-height: 36px;
  }
}
