/* ============================================
   Kante Microfinance - TheTouron Theme
   Main Stylesheet
   ============================================ */

/* CSS Variables - Professional Financial Color Scheme */
:root {
  /* Primary Colors - Deep Navy Blue (Trust, Stability, Professionalism) */
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-hover: #2563eb;
  
  /* Secondary Colors - Emerald Green (Growth, Prosperity, Money) */
  --secondary: #10b981;
  --secondary-dark: #059669;
  --secondary-light: #34d399;
  
  /* Accent Colors - Gold/Amber (Value, Premium) */
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-light: #fbbf24;
  
  /* Background Colors - Professional Dark Blue-Gray */
  --background: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --surface-hover: #475569;
  
  /* Text Colors */
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-light: #cbd5e1;
  
  /* Status Colors */
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.1);
  --error: #ef4444;
  --error-light: rgba(239, 68, 68, 0.1);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.1);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.1);
  
  /* Border & Divider */
  --border: rgba(148, 163, 184, 0.2);
  --border-light: rgba(148, 163, 184, 0.1);
  --divider: rgba(148, 163, 184, 0.15);
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(30, 64, 175, 0.3);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus {
  top: 0;
}

/* Layout */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 20px;
  min-height: 100vh;
}

/* Tablet and below - Stack layout */
@media (max-width: 1024px) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .right {
    order: -1; /* Sidebar appears first on mobile/tablet */
  }
}

/* Header */
header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 20px;
}

header .title {
  display: flex;
  align-items: center;
  gap: 16px;
}

header .logo {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

header .logo:hover {
  transform: scale(1.05);
}

header .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

/* Fallback if image doesn't load */
header .logo:not(:has(img)) {
  font-size: 24px;
  font-weight: 700;
}

header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

header .sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

header .muted {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
}

/* Panels */
.panel {
  background: var(--surface);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.panel h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.panel h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: var(--shadow-sm);
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: -8px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--info-light);
  background: var(--surface);
}

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

/* Base Button Styles */
button {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0.3px;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

button:hover::before {
  left: 100%;
}

button:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

button:disabled:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

/* Logout Button Styles */
#logoutBtn,
#adminLogoutBtn,
.logout-button {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  padding: 10px 20px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  position: relative;
  overflow: hidden;
  width: auto !important;
  min-width: 100px;
}

#logoutBtn::before,
#adminLogoutBtn::before,
.logout-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(135deg, var(--error), rgba(239, 68, 68, 0.8));
  transition: width 0.3s ease;
  z-index: 0;
}

#logoutBtn span,
#adminLogoutBtn span,
.logout-button span {
  position: relative;
  z-index: 1;
}

#logoutBtn:hover,
#adminLogoutBtn:hover,
.logout-button:hover {
  color: white !important;
  border-color: var(--error) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#logoutBtn:hover::before,
#adminLogoutBtn:hover::before,
.logout-button:hover::before {
  width: 100%;
}

#logoutBtn:active,
#adminLogoutBtn:active,
.logout-button:active {
  transform: translateY(0);
}

/* Secondary/Outline Buttons */
button[style*="background:transparent"],
button[style*="background: transparent"] {
  background: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  transition: all 0.3s ease !important;
}

button[style*="background:transparent"]:hover,
button[style*="background: transparent"]:hover {
  background: var(--surface-light) !important;
  border-color: var(--primary) !important;
  color: var(--primary-light) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Success/Approve Buttons */
button[style*="background:#28a745"],
button[style*="background: #28a745"],
button.approve-btn {
  background: linear-gradient(135deg, var(--success), var(--secondary-light)) !important;
  box-shadow: var(--shadow-sm);
  color: white !important;
  border: none !important;
}

button[style*="background:#28a745"]:hover,
button[style*="background: #28a745"]:hover,
button.approve-btn:hover {
  background: linear-gradient(135deg, var(--secondary-dark), var(--success)) !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

/* Danger/Reject Buttons */
button[style*="color:#ff6b6b"],
button[style*="color: #ff6b6b"],
button.reject-btn {
  background: transparent !important;
  color: var(--error) !important;
  border: 1px solid var(--error) !important;
}

button[style*="color:#ff6b6b"]:hover,
button[style*="color: #ff6b6b"]:hover,
button.reject-btn:hover {
  background: var(--error) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

/* Tab Buttons */
.tab {
  position: relative;
  overflow: hidden;
}

.tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--secondary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.tab:hover::after {
  width: 80%;
}

.tab.active::after {
  width: 100%;
  background: white;
}

/* Error message styling */
.error-message {
  background: var(--error-light);
  border: 1px solid var(--error);
  color: #fca5a5;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  border-left: 4px solid var(--error);
}

/* Notes and muted text */
.note,
small.note {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Dashboard Cards */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: linear-gradient(135deg, var(--surface-light), var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.card .value {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.card .label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loan List */
.loan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loan-item {
  padding: 16px;
  background: linear-gradient(135deg, var(--surface-light), var(--surface));
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
}

.loan-item:hover {
  border-color: var(--primary);
  border-left-color: var(--primary);
  transform: translateX(4px);
  box-shadow: var(--shadow);
  background: var(--surface);
}

/* Status badges */
.status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status.active {
  background: var(--success-light);
  color: var(--secondary-light);
  border: 1px solid var(--success);
}

.status.pending {
  background: var(--warning-light);
  color: var(--accent-light);
  border: 1px solid var(--warning);
}

.status.overdue,
.status.rejected {
  background: var(--error-light);
  color: #fca5a5;
  border: 1px solid var(--error);
}

.status.paid {
  background: var(--success-light);
  color: var(--secondary-light);
  border: 1px solid var(--success);
}

/* Sidebar */
.right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.right .panel {
  margin-bottom: 0;
}

/* Reminders */
.reminders {
  margin-top: 12px;
}

.reminders strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

/* Walk-in Form */
.walkin-form {
  margin-top: 12px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Large Desktop (1400px+) */
@media (min-width: 1400px) {
  .wrap {
    max-width: 1600px;
    padding: 24px;
  }
  
  .panel {
    padding: 32px;
  }
}

/* Desktop (1025px - 1399px) */
@media (min-width: 1025px) and (max-width: 1399px) {
  .wrap {
    padding: 20px;
  }
  
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet Landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .wrap {
    padding: 16px;
  }
  
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  header {
    padding: 16px;
  }
  
  header .logo {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }
  
  header h1 {
    font-size: 22px;
  }
}

/* Tablet Portrait & Mobile Landscape (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .wrap {
    padding: 12px;
    gap: 12px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  header .title {
    width: 100%;
  }

  header .muted {
    text-align: left;
    width: 100%;
  }

  header .logo {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  header h1 {
    font-size: 20px;
  }

  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .panel {
    padding: 16px;
  }
  
  .panel h3 {
    font-size: 18px;
  }
  
  .panel h4 {
    font-size: 16px;
  }
  
  .card {
    padding: 16px;
  }
  
  .card .value {
    font-size: 24px;
  }
  
  .card .label {
    font-size: 11px;
  }
  
  /* Forms */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 44px; /* Touch target size */
  }
  
  /* Tabs */
  .tabs {
    gap: 6px;
  }
  
  .tab {
    padding: 10px 14px;
    font-size: 13px;
  }
  
  /* Loan items */
  .loan-item {
    padding: 12px;
  }
}

/* Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
  .wrap {
    padding: 8px;
    gap: 12px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
  }

  header .title {
    width: 100%;
    gap: 12px;
  }

  header .logo {
    width: 40px;
    height: 40px;
    font-size: 18px;
    border-radius: 10px;
  }
  
  header .logo img {
    padding: 6px;
  }

  header h1 {
    font-size: 18px;
  }

  header .sub {
    font-size: 12px;
  }

  header .muted {
    text-align: left;
    width: 100%;
    font-size: 11px;
  }

  .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .panel {
    padding: 12px;
    border-radius: 10px;
  }
  
  .panel h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .panel h4 {
    font-size: 16px;
    margin-bottom: 10px;
  }

  .card {
    padding: 14px;
    border-radius: 10px;
  }
  
  .card .value {
    font-size: 24px;
  }
  
  .card .label {
    font-size: 11px;
  }
  
  /* Forms - Mobile optimized */
  form {
    gap: 14px;
  }
  
  label {
    font-size: 13px;
    margin-bottom: -6px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  select,
  textarea {
    padding: 14px;
    font-size: 16px; /* Prevents zoom on iOS */
    border-radius: 8px;
    min-height: 44px; /* Touch target size */
  }
  
  button {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 44px; /* Touch target size */
    width: 100%; /* Full width on mobile */
    border-radius: 8px;
  }
  
  /* Tabs - Mobile */
  .tabs {
    gap: 4px;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }
  
  .tab {
    padding: 10px 12px;
    font-size: 12px;
    flex: 1;
    min-height: 44px;
  }
  
  /* Loan items - Mobile */
  .loan-item {
    padding: 12px;
    border-radius: 10px;
  }
  
  .loan-item > div {
    flex-direction: column !important;
    gap: 12px;
  }
  
  .loan-item > div > div:last-child {
    text-align: left !important;
    margin-left: 0 !important;
  }
  
  /* Status badges - Mobile */
  .status {
    padding: 5px 10px;
    font-size: 10px;
  }
  
  /* Error messages */
  .error-message {
    padding: 10px;
    font-size: 13px;
  }
  
  /* Notes */
  .note,
  small.note {
    font-size: 11px;
  }
  
  /* Skip link */
  .skip-link {
    padding: 10px;
    font-size: 14px;
  }
  
  /* Sidebar adjustments */
  .right .panel {
    padding: 12px;
  }
  
  .right .panel h3 {
    font-size: 16px;
  }
  
  .right .panel h4 {
    font-size: 14px;
  }
  
  /* Button groups */
  div[style*="display:flex"] {
    flex-direction: column;
    gap: 8px;
  }
  
  button[style*="width:auto"] {
    width: 100% !important;
  }
  
  /* Welcome section */
  div[style*="display:flex"][style*="justify-content:space-between"] {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start !important;
  }
  
  #logoutBtn,
  #adminLogoutBtn,
  #managementLogoutBtn {
    width: 100% !important;
    margin-top: 8px;
  }
  
  /* Management system mobile */
  #managementPanel table {
    font-size: 11px;
  }
  
  #managementPanel table th,
  #managementPanel table td {
    padding: 8px;
    font-size: 11px;
  }
  
  #managementPanel .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  #capitalForm {
    flex-direction: column !important;
  }
  
  #capitalForm > div {
    width: 100% !important;
    min-width: auto !important;
  }
}

/* Very Small Mobile (max-width: 360px) */
@media (max-width: 360px) {
  .wrap {
    padding: 6px;
  }
  
  header {
    padding: 10px;
  }
  
  .panel {
    padding: 10px;
  }
  
  .card {
    padding: 12px;
  }
  
  .card .value {
    font-size: 20px;
  }
  
  header h1 {
    font-size: 16px;
  }
  
  .panel h3 {
    font-size: 16px;
  }
  
  .panel h4 {
    font-size: 14px;
  }
}

/* Landscape Orientation - Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  header {
    flex-direction: row;
    align-items: center;
  }
  
  header .muted {
    text-align: right;
  }
  
  .dashboard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Print Styles */
@media print {
  .skip-link,
  button,
  #logoutBtn,
  #adminLogoutBtn {
    display: none;
  }
  
  .wrap {
    grid-template-columns: 1fr;
    padding: 0;
  }
  
  .panel {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Financial Theme Enhancements */
.dashboard-cards .card:nth-child(1)::before {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.dashboard-cards .card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--secondary), var(--secondary-light));
}

.dashboard-cards .card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.dashboard-cards .card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--warning), var(--accent));
}

/* Success/Positive Actions */
button[style*="background:#28a745"],
button[style*="background: #28a745"] {
  background: linear-gradient(135deg, var(--success), var(--secondary-light)) !important;
  box-shadow: var(--shadow-sm);
}

button[style*="background:#28a745"]:hover,
button[style*="background: #28a745"]:hover {
  background: linear-gradient(135deg, var(--secondary-dark), var(--success)) !important;
  box-shadow: var(--shadow);
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Premium Accent */
.premium-accent {
  color: var(--accent);
  font-weight: 600;
}

/* Management Button */
.management-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light)) !important;
  color: white !important;
  border: none !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.management-btn:hover {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent)) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Management System Styles */
#managementPanel table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
}

#managementPanel table thead {
  background: var(--surface-light);
}

#managementPanel table th {
  text-align: left;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

#managementPanel table td {
  padding: 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

#managementPanel table tbody tr {
  transition: background 0.2s;
}

#managementPanel table tbody tr:hover {
  background: var(--surface-light);
}

#managementPanel table tbody tr:last-child td {
  border-bottom: none;
}

#managementPanel h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* Handle inline styles for responsive design */
[style*="display:flex"] {
  flex-wrap: wrap;
}

/* Auth tabs responsive */
#authTabs {
  display: flex;
  gap: 8px;
}

/* Responsive adjustments for inline flex styles */
@media (max-width: 480px) {
  /* Make all flex containers stack on mobile */
  [style*="display:flex"][style*="justify-content:space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  
  /* Full width buttons on mobile */
  button[style*="width:auto"],
  button[style*="width: auto"] {
    width: 100% !important;
    margin: 0 !important;
  }
  
  /* Stack button groups */
  div[style*="display:flex"][style*="gap"] {
    flex-direction: column !important;
  }
  
  /* Auth tabs full width on mobile */
  #authTabs {
    flex-direction: column;
    gap: 8px;
  }
  
  #authTabs button {
    width: 100% !important;
    flex: none !important;
  }
  
  /* Welcome/logout section */
  div[style*="display:flex"][style*="justify-content:space-between"][style*="align-items:center"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  /* Mobile touch devices */
  button,
  .tab,
  a {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
  }
  
  button:active,
  .tab:active {
    transform: scale(0.98);
  }
}

/* Prevent text size adjustment on iOS */
@media screen and (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}
