/**
 * ============================================
 * Cooperative Saving System - Stylesheet
 * ระบบสหกรณ์ออมทรัพย์
 * Developed by 237 Solutions Group Co., Ltd.
 * ============================================
 */

/* ─── CSS Custom Properties ──────────────────────────────────────────────── */
:root {
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --primary-gradient: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
  --success: #059669;
  --success-light: #10b981;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  
  --bg-body: #f0f4f8;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-dark: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(26, 86, 219, 0.15);
  
  --transition: all 0.2s ease;
  --sidebar-width: 260px;
}

/* ─── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Sans Thai', 'Inter', -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

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

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand .brand-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
}

.sidebar-brand h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: -0.02em;
}

.sidebar-brand p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  color: #cbd5e1;
  font-size: 0.87rem;
  font-weight: 500;
  transition: var(--transition);
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-link.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary-light);
}

.nav-link .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-footer p {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* ─── Main Content ───────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

/* ─── Top Bar ────────────────────────────────────────────────────────────── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb .separator {
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

/* ─── Content ────────────────────────────────────────────────────────────── */
.content {
  padding: 28px 32px;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 22px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: #eff6ff; color: #2563eb; }
.stat-icon.green  { background: #ecfdf5; color: #059669; }
.stat-icon.purple { background: #faf5ff; color: #7c3aed; }
.stat-icon.amber  { background: #fffbeb; color: #d97706; }

.stat-content h4 {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.stat-content .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-content .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 0.87rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}

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

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

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue     { background: #eff6ff;  color: #2563eb; }
.badge-green    { background: #ecfdf5;  color: #059669; }
.badge-purple   { background: #f5f3ff;  color: #7c3aed; }
.badge-amber    { background: #fffbeb;  color: #b45309; }
.badge-red      { background: #fef2f2;  color: #dc2626; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #047857;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: #f1f5f9;
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.87rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* ─── Search Bar ─────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 38px;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--border-radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition);
}

.pagination a:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: var(--primary-light);
}

.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ─── Member Card ────────────────────────────────────────────────────────── */
.member-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.member-avatar {
  width: 72px;
  height: 72px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.member-info h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.member-info p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

.member-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  padding: 24px;
  background: #f8fafc;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-item label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-item span {
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 2px;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  padding: 0 24px;
  gap: 4px;
}

.tab {
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  padding: 24px;
}

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

/* ─── Deposit Amount Buttons ─────────────────────────────────────────────── */
.amount-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.amount-btn {
  padding: 6px 16px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.amount-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ─── Account Item ───────────────────────────────────────────────────────── */
.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.account-item:hover {
  border-color: var(--primary-light);
  background: #f0f4ff;
}

.account-item.selected {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.2);
}

.account-item input[type="radio"] {
  margin-right: 10px;
  accent-color: var(--primary);
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* ─── Receipt ────────────────────────────────────────────────────────────── */
.receipt-container {
  max-width: 800px;
  margin: 0 auto;
}

.receipt {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.receipt-header {
  text-align: center;
  padding: 30px;
  background: var(--primary-gradient);
  color: #fff;
}

.receipt-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.receipt-header p {
  font-size: 0.82rem;
  opacity: 0.85;
}

.receipt-body {
  padding: 32px;
}

.receipt-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-color);
}

.receipt-info-item h4 {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-info-item p {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

.receipt-table {
  width: 100%;
  margin-bottom: 24px;
}

.receipt-table th {
  background: #f8fafc;
  padding: 10px 14px;
}

.receipt-table td {
  padding: 12px 14px;
}

.receipt-total {
  display: flex;
  justify-content: flex-end;
  padding: 16px 0;
  border-top: 2px solid var(--text-primary);
  margin-top: 16px;
}

.receipt-total-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 40px;
}

.receipt-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.receipt-footer {
  text-align: center;
  padding: 20px 30px;
  border-top: 1px dashed var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.receipt-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ─── Empty State ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Autocomplete ───────────────────────────────────────────────────────── */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 250px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.autocomplete-list.show {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f0f4ff;
}

.autocomplete-item .item-name {
  font-weight: 600;
  font-size: 0.87rem;
}

.autocomplete-item .item-detail {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* ─── Print Styles ───────────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .topbar,
  .receipt-actions,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  .content {
    padding: 0 !important;
  }

  .receipt-container {
    max-width: 100%;
  }

  .receipt {
    border: none;
    box-shadow: none;
  }

  body {
    background: #fff;
  }

  @page {
    margin: 15mm;
    size: A4;
  }
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 12px 16px;
  }

  .member-header {
    flex-direction: column;
    text-align: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-in {
  animation: slideIn 0.3s ease;
}

/* ─── Utility ────────────────────────────────────────────────────────────── */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.font-mono { font-family: 'SF Mono', 'Roboto Mono', monospace; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-sm { font-size: 0.8rem; }
.fw-bold { font-weight: 700; }

/* ─── Login Page ─────────────────────────────────────────────────────────── */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 30%, #1a365d 60%, #1e40af 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
  animation: float 20s ease-in-out infinite;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  top: -150px;
  right: -100px;
  animation-delay: 0s;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #059669, #0891b2);
  bottom: -100px;
  left: -80px;
  animation-delay: -7s;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #d97706, #dc2626);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(30px, -30px) scale(1.05); }
  50%      { transform: translate(-20px, 20px) scale(0.95); }
  75%      { transform: translate(10px, -10px) scale(1.02); }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 20px;
}

.login-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.login-header {
  text-align: center;
  padding: 32px 24px 20px;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(26, 86, 219, 0.4);
}

.login-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.login-header p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

.login-form {
  padding: 8px 24px 24px;
}

/* Role Selector */
.role-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.role-option input[type="radio"] {
  display: none;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition);
}

.role-option input[type="radio"]:checked + .role-card {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.role-icon {
  font-size: 1.4rem;
}

.role-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

/* Login Form Inputs */
.login-form .form-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  font-size: 0.95rem;
  z-index: 1;
  pointer-events: none;
}

.login-input {
  padding-left: 40px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

.login-input:focus {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.login-input::placeholder {
  color: rgba(255, 255, 255, 0.35) !important;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 0.95rem;
  opacity: 0.6;
  transition: var(--transition);
}

.password-toggle:hover {
  opacity: 1;
}

.login-form .form-hint {
  color: rgba(255, 255, 255, 0.4);
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 0.95rem;
  background: var(--primary-gradient) !important;
  box-shadow: 0 4px 15px rgba(26, 86, 219, 0.4);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 86, 219, 0.5);
}

.login-footer {
  text-align: center;
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.login-footer p {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.3);
}

/* ─── User Dropdown & Auth UI ────────────────────────────────────────────── */
.user-dropdown {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.user-badge-admin {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}

.user-badge-member {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  color: #0c4a6e;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logout-btn {
  color: var(--danger) !important;
  border-color: #fecaca !important;
  font-size: 0.75rem !important;
  padding: 4px 10px !important;
}

.logout-btn:hover {
  background: #fef2f2 !important;
  border-color: var(--danger) !important;
}

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
}
