/* =============================================================================
   WME Portal - Common Stylesheet
   Used across: Landing Page, IP Manager, FTP Archive, and all services
   ============================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* =============================================================================
   CSS Variables - Color Palette & Design Tokens
   ============================================================================= */
:root {
  /* Brand Colors */
  --wme-blue: #1463b8;
  --wme-blue-dk: #0e4d90;
  --wme-accent: #1976d2;

  /* Neutrals */
  --ink: #111827;
  --muted: #6b7280;
  --line: #dfe3ea;
  --bg: #ffffff;
  --bg-alt: #f8fafc;

  /* Status Colors */
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #17a2b8;

  /* Card Design */
  --card-border: #dfe3ea;
  --card-radius: 6px;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);

  /* Hover Effects */
  --hover-shadow: 0 0 6px rgba(223, 227, 234, 0.9);

  /* Header Colors */
  --header-bg: #1E1E28;
  --header-text: #ffffff;
}

/* =============================================================================
   Dark Mode Variables
   ============================================================================= */
[data-theme="dark"] {
  /* Brand Colors - Slightly adjusted for dark mode */
  --wme-blue: #3b8fd8;
  --wme-blue-dk: #2b7ec4;
  --wme-accent: #4a9eff;

  /* Neutrals - Inverted for dark mode */
  --ink: #e5e7eb;
  --muted: #9ca3af;
  --line: #374151;
  --bg: #1f2937;
  --bg-alt: #111827;

  /* Status Colors - Adjusted for dark mode visibility */
  --success: #34d058;
  --warning: #ffd33d;
  --danger: #f85149;
  --info: #58a6ff;

  /* Card Design */
  --card-border: #374151;
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);

  /* Hover Effects */
  --hover-shadow: 0 0 12px rgba(59, 143, 216, 0.3);

  /* Header Colors */
  --header-bg: #0d1117;
  --header-text: #e5e7eb;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-alt);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  height: 100%;
  line-height: 1.6;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =============================================================================
   Container & Layout
   ============================================================================= */
.main-wrapper {
  width: 80%;
  max-width: 1600px;
  margin: 20px auto;
  background: var(--bg);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: visible;
}

/* Dark mode main-wrapper styling */
[data-theme="dark"] .main-wrapper {
  background: rgba(17, 24, 39, 0.3);
  border: 1px solid rgba(75, 85, 99, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.container {
  padding: 20px 18px 14px;
  flex-grow: 1;
  width: 100%;
}

.wme-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================================================
   Header Styles (Dark Navigation Bar)
   ============================================================================= */
.wme-bar {
  background: var(--header-bg);
  color: var(--header-text);
  width: 100%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wme-bar .wme-wrap {
  padding: 14px 20px;
}

.wme-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.wme-logo {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.wme-logo img {
  height: 28px;
  display: block;
  width: auto;
  object-fit: contain;
}

/* =============================================================================
   Language Switcher & Theme Toggle
   ============================================================================= */
.lang-switcher {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 0 0 auto;
}

.lang-btn {
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.lang-btn:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
}

.lang-btn.active {
  background: var(--wme-blue);
  border-color: var(--wme-blue);
}

/* Theme Toggle Button */
.theme-toggle {
  padding: 6px 10px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  color: var(--header-text);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: 8px;
  height: 32px;
  width: 40px;
  min-width: 40px;
  box-sizing: border-box;
}

.theme-toggle i {
  display: inline-block;
  width: 14px;
  height: 14px;
  text-align: center;
  line-height: 14px;
  font-size: 14px;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.3);
}

/* Dark mode: Make theme toggle icon more visible */
[data-theme="dark"] .theme-toggle {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.4);
}

[data-theme="dark"] .theme-toggle i {
  color: #fbbf24 !important;  /* Bright yellow/amber for sun icon visibility */
  font-size: 14px !important;
}

/* Ensure Bootstrap Icons work properly */
.theme-toggle i.bi::before,
.theme-toggle i[class^="bi-"]::before,
.theme-toggle i[class*=" bi-"]::before {
  display: inline-block !important;
  font-family: 'bootstrap-icons' !important;
  font-style: normal !important;
  font-weight: normal !important;
  font-variant: normal !important;
  text-transform: none !important;
  line-height: 1 !important;
  vertical-align: -0.125em !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Dark mode: Make Bootstrap Icons sun yellow */
[data-theme="dark"] .theme-toggle i.bi::before,
[data-theme="dark"] .theme-toggle i[class^="bi-"]::before,
[data-theme="dark"] .theme-toggle i[class*=" bi-"]::before {
  color: #fbbf24 !important;  /* Bright yellow/amber for sun icon visibility */
}

/* =============================================================================
   Hero Section (Page Title Area)
   ============================================================================= */
.wme-hero {
  background: #eef2f7;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  text-align: center;
}

.wme-hero h1 {
  font-size: 24px;
  margin: 0 0 4px;
  color: var(--wme-blue-dk);
  font-weight: 700;
}

.wme-hero p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.wme-hero .wme-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 16px;
}

.hero-user-greeting {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.hero-user-greeting strong {
  color: var(--wme-blue-dk);
  font-weight: 600;
}

.wme-hero .header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
}

/* Ensure all header buttons are consistent size - exactly 34px */
.wme-hero .header-controls .btn,
.header .header-controls .btn,
.header-controls .btn {
  padding: 7px 14px !important;
  font-size: 13px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  box-sizing: border-box !important;
}

.wme-hero .header-controls .btn-primary,
.wme-hero .header-controls .btn-secondary,
.header-controls .btn-primary,
.header-controls .btn-secondary {
  padding: 7px 14px !important;
  font-size: 13px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

/* Alternative Header Style (for IP Manager pages) */
.header {
  background: #eef2f7;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.header h1 {
  font-size: 24px;
  margin: 0 0 4px;
  color: var(--wme-blue-dk);
  font-weight: 700;
}

.header p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.header-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* =============================================================================
   Stats Cards
   ============================================================================= */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  text-align: center;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--wme-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 26px;
  font-weight: 700;
  color: var(--wme-blue);
  margin-bottom: 6px;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stats-overview .stat-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.stats-overview .stat-card:hover {
  border-color: var(--wme-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 10px;
  color: var(--wme-blue);
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  text-align: left;
}

/* =============================================================================
   Content Boxes
   ============================================================================= */
.content-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 20px;
  margin-bottom: 24px;
  max-height: none;
  overflow: visible;
}

.content-box h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: var(--ink);
}

.content-box p {
  color: var(--muted);
  line-height: 1.6;
}

/* =============================================================================
   Services Grid
   ============================================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.service-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: 24px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--wme-blue);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.service-card:hover {
  border-color: var(--wme-accent);
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--wme-blue);
}

.service-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.service-description {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.6;
  flex-grow: 1;
}

.service-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 13px;
  color: var(--muted);
}

.service-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.service-status {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #d4edda;
  color: #155724;
}

.status-planned {
  background: #fff3cd;
  color: #856404;
}

.status-maintenance {
  background: #fff3cd;
  color: #856404;
}

.status-disabled {
  background: #f8d7da;
  color: #721c24;
}

/* =============================================================================
   Tier Badge Styles
   ============================================================================= */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  margin-left: 8px;
}

/* =============================================================================
   Empty States
   ============================================================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-icon {
  font-size: 24px;
  margin-bottom: 20px;
  opacity: 0.5;
  color: var(--wme-blue);
  font-weight: 600;
}

.empty-state h3 {
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 600;
}

.empty-state a {
  color: var(--wme-blue);
  text-decoration: none;
}

.empty-state a:hover {
  text-decoration: underline;
}

/* =============================================================================
   Forms - Global Input & Select Styling
   ============================================================================= */

/* Apply consistent styling to ALL inputs and selects across the portal */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  padding: 8px 12px;
  border: 1px solid var(--card-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s ease;
  background-color: var(--bg);
  color: var(--ink);
  height: 34px; /* Ensure all form elements have the same height */
  box-sizing: border-box;
}

/* Textarea needs auto height for multi-line input */
textarea {
  height: auto;
  min-height: 80px;
}

/* Focus states for all inputs and selects */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--wme-blue);
  box-shadow: 0 0 0 3px rgba(20, 99, 184, 0.1);
}

/* Textarea specific styling */
textarea {
  resize: vertical;
}

/* Select dropdown arrow styling - combined into one rule */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  position: relative;
  /* Override the default padding to make room for arrow */
  padding: 8px 12px 8px 35px !important;
  /* Create dropdown arrow using CSS triangles on the left */
  background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
                    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position: 10px 50%,
                       15px 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Disabled state */
input:disabled,
textarea:disabled,
select:disabled {
  background-color: var(--bg-alt);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Placeholder styling */
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

/* Form group container */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--ink);
  font-size: 13px;
}

/* Ensure inputs inside form-group take full width */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.button-group {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

/* =============================================================================
   Notifications
   ============================================================================= */
.notification {
  position: fixed;
  top: 20px;
  right: -400px; /* Off-screen by default */
  padding: 16px 24px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    right: -400px;
    opacity: 0;
  }
  to {
    right: 20px;
    opacity: 1;
  }
}

.notification.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.notification.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.notification.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.notification i {
  font-size: 20px;
}

/* Inline notifications (not fixed, positioned within content) */
.notification-inline {
  position: relative;
  padding: 12px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.9em;
}

.notification-inline.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.notification-inline.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.notification-inline.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
}

.notification-inline i {
  font-size: 18px;
}

/* Modal-scoped notifications - appear above modal (outside) */
.modal .notification:not(.notification-inline),
.modal-content .notification:not(.notification-inline),
.modal-body .notification:not(.notification-inline) {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  border-radius: 6px;
  z-index: 10001; /* Higher than modal (9999) and modal-overlay (9998) */
  animation: slideDownFromAbove 0.3s ease;
  min-width: 300px;
  max-width: 600px;
}

.modal .notification.hiding:not(.notification-inline),
.modal-content .notification.hiding:not(.notification-inline),
.modal-body .notification.hiding:not(.notification-inline) {
  animation: slideUpToAbove 0.3s ease;
}

@keyframes slideDownFromAbove {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes slideUpToAbove {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
}

/* =============================================================================
   Loading Spinner
   ============================================================================= */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* =============================================================================
   Modal Styles (Consolidated from modules)
   ============================================================================= */
/* =============================================================================
   Custom Scrollbar - Minimal & Integrated
   Applied globally across ALL services and modules
   ============================================================================= */

/* Webkit browsers (Chrome, Edge, Safari, Opera) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-alt);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

::-webkit-scrollbar-thumb:active {
  background: var(--text-muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line) var(--bg-alt);
}

/* Specific scrollbar styling for common scrollable containers */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.section-content::-webkit-scrollbar,
textarea::-webkit-scrollbar,
pre::-webkit-scrollbar,
code::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar,
div[style*="overflow"]::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

/* Enhanced contrast for dark backgrounds */
.dark-mode ::-webkit-scrollbar-track,
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.dark-mode ::-webkit-scrollbar-thumb,
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.dark-mode ::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   Modal Styles - Minimal & Clean
   ============================================================================= */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: modalBackdropFadeIn 0.2s ease;
}

@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal.active,
.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  position: relative; /* For absolute positioning of notifications above modal */
  background: var(--bg);
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg);
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i,
.modal-header h3 i {
  color: var(--primary);
  font-size: 20px;
}

.modal-close,
.btn-close,
.close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.modal-close:hover,
.btn-close:hover,
.close:hover {
  background: var(--surface-hover);
  color: var(--ink);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg);
}

/* Modal form groups spacing */
.modal-body .form-group {
  margin-bottom: 16px;
}

.modal-body .form-group:last-child {
  margin-bottom: 0;
}

.modal-body .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}

.modal-body .form-group label span {
  font-weight: 400;
  color: var(--muted);
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
    border-radius: 8px;
  }

  .modal-header {
    padding: 16px 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 12px 20px;
  }
}

/* =============================================================================
   Footer
   ============================================================================= */
.wme-foot {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  width: 100%;
  text-align: center;
  margin-top: auto;
  flex-shrink: 0;
}

.wme-foot .wme-wrap {
  padding: 14px 20px;
  font-size: 13px;
}

.wme-foot a {
  color: var(--wme-blue);
  text-decoration: none;
}

.wme-foot a:hover {
  text-decoration: underline;
}

.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-content p {
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--wme-blue);
}

/* =============================================================================
   Responsive Design
   ============================================================================= */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .wme-top {
    flex-direction: column;
    gap: 10px;
  }

  .wme-logo {
    width: 100%;
  }

  .header {
    padding: 20px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .header h1 {
    font-size: 24px;
  }

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

  .button-group {
    flex-direction: column;
  }

  .stats,
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .search-input {
    width: 100%;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .content-box table {
    min-width: 100%;
  }

  .wme-hero h1 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .stats,
  .stats-overview {
    grid-template-columns: 1fr;
  }

  .wme-hero h1 {
    font-size: 20px;
  }

  .header h1 {
    font-size: 20px;
  }
}

/* =============================================================================
   Document Tree Structure (Admin Panel)
   ============================================================================= */
.documents-tree {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.app-group {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  background: var(--bg-alt);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.app-header:hover {
  background: #f1f5f9;
}

.app-header .expand-icon {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s;
}

.app-header i:not(.expand-icon) {
  font-size: 18px;
  color: var(--wme-blue);
}

.app-header strong {
  font-size: 16px;
  color: var(--ink);
}

.doc-count {
  color: var(--muted);
  font-size: 14px;
  margin-left: auto;
}

.app-documents {
  padding: 0;
}

.app-documents .data-table {
  margin: 0;
  border: none;
  border-radius: 0;
}

.app-documents .data-table thead th {
  background: var(--bg);
  border-top: 1px solid var(--card-border);
}

/* =============================================================================
   Icon Picker (Reusable Component)
   ============================================================================= */
.icon-picker-search {
  position: relative;
  margin-bottom: 24px;
}

.icon-picker-search .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.icon-picker-search .search-input {
  width: 100%;
  padding: 12px 16px 12px 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
}

.icon-picker-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-alt);
  border-radius: 8px;
  margin-bottom: 24px;
}

.preview-icon {
  width: 80px;
  height: 80px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
}

.preview-icon i {
  font-size: 36px;
  color: var(--wme-blue);
}

#preview-code {
  background: white;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--line);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: var(--ink);
}

.icon-picker-categories {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.icon-category {
  margin-bottom: 24px;
}

.icon-category-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
}

.icon-btn {
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.icon-btn:hover {
  border-color: var(--wme-blue);
  background: var(--bg-alt);
  transform: scale(1.05);
}

.icon-btn.selected {
  border-color: var(--wme-blue);
  background: var(--wme-blue);
}

.icon-btn i {
  font-size: 20px;
  color: var(--wme-blue);
  transition: color 0.2s;
}

.icon-btn.selected i {
  color: white;
}

.icon-preview-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.icon-preview-inline i {
  font-size: 18px;
  color: var(--wme-blue);
}

/* =============================================================================
   Card Components (Consolidated from modules)
   ============================================================================= */
.info-card {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  padding: 16px;
}

.card-header {
  background: #f9fafb;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.card-header h2,
.card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h2 i,
.card-header h3 i {
  color: var(--wme-blue);
}

.card-body {
  padding: 16px;
}

/* =============================================================================
   Loading & Empty States (Consolidated from modules)
   ============================================================================= */
.loading-state {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.loading-state i {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

/* =============================================================================
   Form Sections (Consolidated from modules)
   ============================================================================= */
.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section h3 i {
  color: var(--wme-blue);
}

.form-actions {
  display: flex;
  gap: 8px;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

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

/* =============================================================================
   Tab System (Consolidated from modules)
   ============================================================================= */
.tabs-container {
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0 0 24px 0;
  border-bottom: 2px solid var(--line);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--ink);
  background: var(--bg-alt);
}

.tab-btn.active {
  color: var(--wme-blue);
  border-bottom-color: var(--wme-blue);
}

.tab-content {
  display: none;
}

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

/* =============================================================================
   Dark Mode Specific Adjustments
   ============================================================================= */
[data-theme="dark"] .wme-hero {
  background: var(--bg-alt);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .header {
  background: var(--bg-alt);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .section-header {
  background: var(--bg-alt);
}

[data-theme="dark"] thead {
  background: var(--bg-alt);
}

[data-theme="dark"] .wme-foot {
  background: var(--bg);
}

[data-theme="dark"] .icon-btn {
  background: var(--bg);
  border-color: var(--line);
}

[data-theme="dark"] .icon-btn:hover {
  background: var(--bg-alt);
}

[data-theme="dark"] .icon-btn.selected {
  background: var(--wme-blue);
  border-color: var(--wme-blue);
}

[data-theme="dark"] .preview-icon {
  background: var(--bg);
}

[data-theme="dark"] #preview-code {
  background: var(--bg);
}

[data-theme="dark"] .app-header:hover {
  background: var(--bg-alt);
}

/* Dark mode status badge adjustments */
[data-theme="dark"] .status-active {
  background: rgba(52, 208, 88, 0.2);
  color: #34d058;
}

[data-theme="dark"] .status-planned {
  background: rgba(255, 211, 61, 0.2);
  color: #ffd33d;
}

[data-theme="dark"] .status-maintenance {
  background: rgba(255, 211, 61, 0.2);
  color: #ffd33d;
}

[data-theme="dark"] .status-disabled {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

[data-theme="dark"] .status-badge.status-active {
  background: rgba(52, 208, 88, 0.2);
  color: #34d058;
}

[data-theme="dark"] .status-badge.status-static {
  background: rgba(88, 166, 255, 0.2);
  color: #58a6ff;
}

[data-theme="dark"] .status-badge.status-dhcp {
  background: rgba(255, 211, 61, 0.2);
  color: #ffd33d;
}

[data-theme="dark"] .status-badge.status-planned {
  background: rgba(156, 163, 175, 0.2);
  color: #9ca3af;
}

[data-theme="dark"] .status-badge.status-maintenance {
  background: rgba(255, 211, 61, 0.2);
  color: #ffd33d;
}

[data-theme="dark"] .status-badge.status-disabled {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

/* Notification adjustments for dark mode */
[data-theme="dark"] .notification.success {
  background: rgba(52, 208, 88, 0.35);
  color: #4ade80;
  border-left-color: #4ade80;
}

[data-theme="dark"] .notification.error {
  background: rgba(248, 81, 73, 0.35);
  color: #fb7185;
  border-left-color: #fb7185;
}

[data-theme="dark"] .notification.info {
  background: rgba(88, 166, 255, 0.35);
  color: #60a5fa;
  border-left-color: #60a5fa;
}

/* Inline notification adjustments for dark mode */
[data-theme="dark"] .notification-inline.success {
  background: rgba(52, 208, 88, 0.35);
  color: #4ade80;
  border-left-color: #4ade80;
}

[data-theme="dark"] .notification-inline.error {
  background: rgba(248, 81, 73, 0.35);
  color: #fb7185;
  border-left-color: #fb7185;
}

[data-theme="dark"] .notification-inline.info {
  background: rgba(88, 166, 255, 0.35);
  color: #60a5fa;
  border-left-color: #60a5fa;
}

/* Button adjustments for dark mode - more subtle */
[data-theme="dark"] .btn-primary {
  background-color: rgba(59, 143, 216, 0.7);
  border: 1px solid rgba(59, 143, 216, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
  background-color: rgba(59, 143, 216, 0.85);
  border-color: rgba(59, 143, 216, 0.6);
}

[data-theme="dark"] .btn-secondary {
  background-color: rgba(55, 65, 81, 0.5);
  color: var(--ink);
  border-color: var(--line);
}

[data-theme="dark"] .btn-secondary:hover {
  background-color: rgba(55, 65, 81, 0.7);
  border-color: rgba(75, 85, 99, 0.8);
}

[data-theme="dark"] .btn-portal {
  background-color: transparent;
  color: var(--muted);
  border: 1px dashed var(--line);
}

[data-theme="dark"] .btn-portal:hover {
  background-color: rgba(156, 163, 175, 0.15);
  color: var(--ink);
  border-style: solid;
  border-color: var(--muted);
}

[data-theme="dark"] .btn-danger {
  background: rgba(248, 81, 73, 0.7);
  border: 1px solid rgba(248, 81, 73, 0.4);
}

[data-theme="dark"] .btn-danger:hover {
  background: rgba(248, 81, 73, 0.85);
  border-color: rgba(248, 81, 73, 0.6);
}

/* Card components dark mode */
[data-theme="dark"] .info-card {
  background: var(--bg);
}

[data-theme="dark"] .card-header {
  background: var(--bg-alt);
}

[data-theme="dark"] .card-body {
  background: var(--bg);
}

/* Form elements dark mode - consistent styling across all inputs and selects */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--card-border);
}

/* Focus state for dark mode */
[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="url"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: var(--wme-blue);
  box-shadow: 0 0 0 3px rgba(59, 143, 216, 0.2);
}

/* Dropdown arrow for dark mode select elements - arrow on the left */
[data-theme="dark"] select {
  background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%),
                    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position: 10px 50%,
                       15px 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* Disabled state in dark mode */
[data-theme="dark"] input:disabled,
[data-theme="dark"] textarea:disabled,
[data-theme="dark"] select:disabled {
  background-color: var(--bg-alt);
  opacity: 0.5;
}

/* Placeholder in dark mode */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

/* =============================================================================
   Access Denied Page (Error Pages)
   ============================================================================= */
.access-denied-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #f8fafc;
}

[data-theme="dark"] .access-denied-page {
  background: var(--bg-alt);
}

.access-denied-container {
  text-align: center;
  max-width: 500px;
  padding: 40px;
}

.access-denied-icon {
  font-size: 64px;
  color: var(--danger);
  margin-bottom: 20px;
}

.access-denied-title {
  color: var(--danger);
  margin-bottom: 10px;
  font-size: 28px;
  font-weight: 700;
}

.access-denied-text {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 16px;
}

.access-denied-detail {
  color: #999;
  font-size: 14px;
  margin-bottom: 30px;
}

.access-denied-detail strong {
  color: var(--ink);
  font-weight: 600;
}

/* =============================================================================
   Monitor Status Icons (IP Manager)
   ============================================================================= */
.monitor-status-col {
  text-align: center;
}

.monitor-icon-enabled {
  color: var(--success);
}

.monitor-icon-disabled {
  color: #ccc;
}

[data-theme="dark"] .monitor-icon-disabled {
  color: #6b7280;
}

/* =============================================================================
   Loading & Success Messages
   ============================================================================= */
.loading-message {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 20px;
  font-size: 14px;
}

.success-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px;
  border-radius: 4px;
  margin: 20px 30px;
  display: block;
  font-size: 14px;
}

[data-theme="dark"] .success-message {
  background: rgba(52, 208, 88, 0.15);
  color: #34d058;
  border-color: rgba(52, 208, 88, 0.4);
}

/* =============================================================================
   Utility Classes
   ============================================================================= */
.hidden {
  display: none !important;
}

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

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

.mt-12 {
  margin-top: 12px;
}

.mt-24 {
  margin-top: 24px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-12 {
  margin-bottom: 12px;
}

.ml-auto {
  margin-left: auto;
}

.full-width {
  grid-column: 1 / -1;
}

.flex-row {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-gap-8 {
  gap: 8px;
}

.flex-gap-12 {
  gap: 12px;
}

/* =============================================================================
   Form Utilities
   ============================================================================= */
.form-hint {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

/* =============================================================================
   Assignment List (Portal Admin)
   ============================================================================= */
.assignment-form {
  display: none;
  background: var(--bg-alt);
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.assignment-form.active {
  display: block;
}

.assignments-list {
  max-height: 300px;
  overflow-y: auto;
}

.assignments-empty {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

/* =============================================================================
   Tier Badge with Dynamic Color (used across multiple modules)
   ============================================================================= */
.tier-badge-dynamic {
  background: var(--tier-color, var(--wme-blue));
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 600;
  display: inline-block;
}

/* =============================================================================
   User Greeting Styles
   ============================================================================= */
.user-display-name {
  color: var(--muted);
  font-size: 13px;
  margin-right: 10px;
}

/* =============================================================================
   Section Subtitle (for h3 elements within sections)
   ============================================================================= */
.section-subtitle {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
/* Common Components - SFTP Web Interface */
/* Reusable components used across all pages */

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    justify-content: center;
    min-height: 32px;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--wme-blue);
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: var(--wme-blue-dk);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f0f0f0;
    color: var(--wme-blue-dk);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background-color: var(--wme-blue);
    color: white;
}

.btn-portal {
    background-color: transparent;
    color: var(--muted);
    border: 1px dashed var(--line);
}

.btn-portal:hover {
    background-color: rgba(107, 114, 128, 0.08);
    color: var(--ink);
    border-style: solid;
    border-color: var(--muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.btn-small {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 3px;
    min-height: 26px;
}

.btn-disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-disabled:hover {
    transform: none;
}

.close-btn, .btn-close, .close {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.close-btn:hover, .btn-close:hover, .close:hover {
    background: var(--surface-hover);
    color: var(--ink);
    transform: rotate(90deg);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    line-height: 1;
}

.icon-btn:hover {
    color: var(--text);
}

/* Dark mode button adjustments */
[data-theme="dark"] .btn-primary {
    background-color: rgba(59, 143, 216, 0.7);
    border: 1px solid rgba(59, 143, 216, 0.4);
}

[data-theme="dark"] .btn-primary:hover {
    background-color: rgba(59, 143, 216, 0.85);
    border-color: rgba(59, 143, 216, 0.6);
}

[data-theme="dark"] .btn-secondary {
    background-color: rgba(55, 65, 81, 0.5);
    color: var(--ink);
    border-color: var(--line);
}

[data-theme="dark"] .btn-secondary:hover {
    background-color: rgba(55, 65, 81, 0.7);
    border-color: rgba(75, 85, 99, 0.8);
}

[data-theme="dark"] .btn-danger {
    background: rgba(248, 81, 73, 0.7);
    border: 1px solid rgba(248, 81, 73, 0.4);
}

[data-theme="dark"] .btn-danger:hover {
    background: rgba(248, 81, 73, 0.85);
    border-color: rgba(248, 81, 73, 0.6);
}

/* ==========================================================================
   Badges
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    margin-left: 8px;
}

.badge-admin {
    background: var(--wme-blue);
    color: white;
}

.badge-user {
    background: #28a745;
    color: white;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-active, .status-active {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-static {
    background: #cce5ff;
    color: #004085;
}

.status-badge.status-dhcp {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-planned, .status-planned {
    background: #e2e3e5;
    color: #383d41;
}

.status-badge.status-maintenance, .status-maintenance {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-disabled, .status-disabled {
    background: #f8d7da;
    color: #721c24;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    margin-left: 8px;
}

/* Dark mode badge adjustments */
[data-theme="dark"] .status-active {
    background: rgba(52, 208, 88, 0.2);
    color: #34d058;
}

[data-theme="dark"] .status-planned {
    background: rgba(255, 211, 61, 0.2);
    color: #ffd33d;
}

[data-theme="dark"] .status-maintenance {
    background: rgba(255, 211, 61, 0.2);
    color: #ffd33d;
}

[data-theme="dark"] .status-disabled {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

[data-theme="dark"] .status-badge.status-active {
    background: rgba(52, 208, 88, 0.2);
    color: #34d058;
}

[data-theme="dark"] .status-badge.status-static {
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
}

[data-theme="dark"] .status-badge.status-dhcp {
    background: rgba(255, 211, 61, 0.2);
    color: #ffd33d;
}

[data-theme="dark"] .status-badge.status-planned {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

[data-theme="dark"] .status-badge.status-maintenance {
    background: rgba(255, 211, 61, 0.2);
    color: #ffd33d;
}

[data-theme="dark"] .status-badge.status-disabled {
    background: rgba(248, 81, 73, 0.2);
    color: #f85149;
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrapper {
    overflow-x: auto;
}

.table-header-wrapper {
    background: var(--bg-alt);
    border: 1px solid var(--line);
    border-bottom: 2px solid var(--line);
    border-radius: 4px 4px 0 0;
}

.table-header-row {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.table-header-cell {
    color: var(--muted);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    display: table-cell;
}

/* User files header (4 columns) */
#user-files-header .table-header-cell:nth-child(1) {
    width: 65%;
}

#user-files-header .table-header-cell:nth-child(2) {
    width: 12%;
}

#user-files-header .table-header-cell:nth-child(3) {
    width: 13%;
}

#user-files-header .table-header-cell:nth-child(4) {
    width: 10%;
    text-align: center;
}

/* Common files header (3 columns) */
#common-files-header .table-header-cell:nth-child(1) {
    width: 70%;
}

#common-files-header .table-header-cell:nth-child(2) {
    width: 15%;
}

#common-files-header .table-header-cell:nth-child(3) {
    width: 15%;
}

.table-scroll-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.table-scroll-wrapper table {
    margin-bottom: 0;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
}

/* User files table (4 columns with actions) */
#user-files-table td:nth-child(1) {
    width: 65%;
}

#user-files-table td:nth-child(1) i {
    float: left;
    margin-right: 8px;
    margin-top: 2px;
}

#user-files-table td:nth-child(2) {
    width: 12%;
}

#user-files-table td:nth-child(3) {
    width: 13%;
}

#user-files-table td:nth-child(4) {
    width: 10%;
    text-align: center;
}

/* Common files table (3 columns, no actions) */
#common-files-table {
    table-layout: fixed;
}

#common-files-table td:nth-child(1) {
    width: 65%;
}

#common-files-table td:nth-child(1) i {
    float: left;
    margin-right: 8px;
    margin-top: 2px;
}

#common-files-table td:nth-child(2) {
    width: 15%;
}

#common-files-table td:nth-child(3) {
    width: 20%;
}

#common-files-header .table-header-cell:nth-child(1) {
    width: 65%;
}

#common-files-header .table-header-cell:nth-child(2) {
    width: 15%;
}

#common-files-header .table-header-cell:nth-child(3) {
    width: 20%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--bg);
    table-layout: fixed;
}

thead {
    background: var(--bg-alt);
    border-bottom: 2px solid var(--line);
}

th {
    color: var(--muted);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--ink);
    word-break: break-word;
    overflow-wrap: break-word;
}

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background: var(--bg-alt);
}

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

[data-theme="dark"] thead {
    background: var(--bg-alt);
}

/* ==========================================================================
   Forms
   ========================================================================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
    padding: 8px 12px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: var(--bg);
    color: var(--ink);
    height: 34px;
    box-sizing: border-box;
}

textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--wme-blue);
    box-shadow: 0 0 0 3px rgba(20, 99, 184, 0.1);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    padding: 8px 12px 8px 35px !important;
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
                      linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: 10px 50%, 15px 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

input:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--bg-alt);
    cursor: not-allowed;
    opacity: 0.6;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--ink);
    font-size: 13px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.form-hint {
    color: var(--muted);
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

/* Dark mode forms */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--bg);
    color: var(--ink);
    border-color: var(--card-border);
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="url"]:focus,
[data-theme="dark"] input[type="date"]:focus,
[data-theme="dark"] input[type="time"]:focus,
[data-theme="dark"] input[type="datetime-local"]:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--wme-blue);
    box-shadow: 0 0 0 3px rgba(59, 143, 216, 0.2);
}

[data-theme="dark"] select {
    background-image: linear-gradient(45deg, transparent 50%, #9ca3af 50%),
                      linear-gradient(135deg, #9ca3af 50%, transparent 50%);
}

[data-theme="dark"] input:disabled,
[data-theme="dark"] textarea:disabled,
[data-theme="dark"] select:disabled {
    background-color: var(--bg-alt);
    opacity: 0.5;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--muted);
    opacity: 0.6;
}

/* ==========================================================================
   Search & Filters
   ========================================================================== */

.search-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-container label {
    font-weight: 500;
    color: var(--ink);
    font-size: 14px;
}

.search-input {
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 500px;
    transition: border-color 0.2s ease;
    background: var(--bg);
    color: var(--ink);
}

.search-input:focus {
    outline: none;
    border-color: var(--wme-blue);
    box-shadow: 0 0 0 3px rgba(20, 99, 184, 0.1);
}

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

/* ==========================================================================
   Modals
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: modalBackdropFadeIn 0.2s ease;
}

@keyframes modalBackdropFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active,
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--bg);
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i,
.modal-header h3 i {
    color: var(--primary);
    font-size: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    color: var(--text);
}

.modal-body p {
    margin: 0;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    background: var(--bg);
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: var(--bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 59px;
    background: #f9fafb;
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
}

.section-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px;
}

[data-theme="dark"] .section-header {
    background: var(--bg-alt);
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

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

.notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.notification.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.notification i {
    font-size: 20px;
}

[data-theme="dark"] .notification.success {
    background: rgba(52, 208, 88, 0.35);
    color: #4ade80;
    border-left-color: #4ade80;
}

[data-theme="dark"] .notification.error {
    background: rgba(248, 81, 73, 0.35);
    color: #fb7185;
    border-left-color: #fb7185;
}

[data-theme="dark"] .notification.info {
    background: rgba(88, 166, 255, 0.35);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

/* ==========================================================================
   Empty & Loading States
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-icon {
    font-size: 24px;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--wme-blue);
    font-weight: 600;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--ink);
    font-weight: 600;
}

.empty-state a {
    color: var(--wme-blue);
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

.loading-state i {
    font-size: 32px;
    margin-bottom: 10px;
    display: block;
}

/* ==========================================================================
   Custom Scrollbars
   ========================================================================== */

.scrollable::-webkit-scrollbar,
.section-content > div:last-child::-webkit-scrollbar {
    width: 10px;
}

.scrollable::-webkit-scrollbar-track,
.section-content > div:last-child::-webkit-scrollbar-track {
    background: var(--bg-alt);
    border-radius: 5px;
}

.scrollable::-webkit-scrollbar-thumb,
.section-content > div:last-child::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 5px;
}

.scrollable::-webkit-scrollbar-thumb:hover,
.section-content > div:last-child::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

.scrollable,
.section-content > div:last-child {
    scrollbar-width: thin;
    scrollbar-color: var(--line) var(--bg-alt);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-footer {
        padding: 12px 20px;
    }
}

/* =============================================================================
   Profile Modal Styles
   ============================================================================= */

/* Profile Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
    display: block;
}

/* User Type Badge */
.user-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-left: 6px;
    vertical-align: middle;
    cursor: help;
}

.user-type-badge.distributor {
    color: #FBBA00;
}

.user-type-badge.internal {
    color: #008AC2;
}

.user-type-badge.client {
    color: #FFEF47;
}

/* Custom Dropdown with Icons */
.custom-dropdown {
    position: relative;
    min-width: 100px;
    user-select: none;
}

.custom-dropdown-selected {
    padding: 3px 6px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    transition: all 0.2s;
}

.custom-dropdown-selected:hover {
    border-color: var(--primary);
}

.custom-dropdown-selected i.fa-chevron-down {
    margin-left: auto;
    font-size: 0.55rem;
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-selected i.fa-chevron-down {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 180px;
    overflow-y: auto;
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
}

.custom-option {
    padding: 4px 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--ink);
    transition: background 0.15s;
}

.custom-option:hover {
    background: #0E4D90;
    color: white;
}

.custom-option.selected {
    background: #0E4D90;
    color: white;
    font-weight: 600;
}

.custom-option.selected:hover {
    background: #0E4D90;
    color: white;
}

.custom-option i {
    width: 12px;
    text-align: center;
    font-size: 0.65rem;
}

/* Icon colors for user types */
.custom-dropdown i.fa-truck-fast,
.custom-option i.fa-truck-fast {
    color: #FBBA00;
}

.custom-dropdown i.fa-id-badge,
.custom-option i.fa-id-badge {
    color: #008AC2;
}

.custom-dropdown i.fa-handshake,
.custom-option i.fa-handshake {
    color: #FFEF47;
}

/* Profile Modal Container (different from existing .modal) */
#profileModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid var(--line);
}

#profileModal.active {
    display: block;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Profile Modal Header */
#profileModal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 2px solid var(--line);
    background: var(--bg-alt);
}

#profileModal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
}

#profileModal .modal-header h2 i {
    color: var(--wme-blue);
}

#profileModal .modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
}

#profileModal .modal-close:hover {
    background: var(--bg-alt);
    color: var(--ink);
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 0;
    padding: 0 24px;
    background: var(--bg-alt);
    border-bottom: 2px solid var(--line);
}

.modal-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.modal-tab:hover {
    color: var(--ink);
    background: var(--bg);
}

.modal-tab.active {
    color: var(--wme-blue);
    border-bottom-color: var(--wme-blue);
}

/* Profile Modal Body */
#profileModal .modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
    background: var(--bg);
}

#profileModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#profileModal .modal-body::-webkit-scrollbar-track {
    background: var(--bg-alt);
}

#profileModal .modal-body::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
}

#profileModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Form Styles in Profile Modal */
#profileModal .form-group {
    margin-bottom: 20px;
}

#profileModal .form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--ink);
    font-size: 0.95rem;
}

#profileModal .form-group label i {
    color: var(--wme-blue);
    font-size: 1rem;
}

#profileModal .form-group input,
#profileModal .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font-size: 0.95rem;
    transition: all 0.2s;
}

#profileModal .form-group input:focus,
#profileModal .form-group select:focus {
    outline: none;
    border-color: var(--wme-blue);
    box-shadow: 0 0 0 3px rgba(20, 99, 184, 0.1);
}

#profileModal .form-group input[readonly] {
    background: var(--bg-alt);
    cursor: not-allowed;
    color: var(--muted);
}

#profileModal .form-group small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

/* Password wrapper with toggle button */
#profileModal .password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#profileModal .password-wrapper input {
    padding-right: 45px !important;
    width: 100%;
}

#profileModal .password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    font-size: 16px;
    transition: color 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

#profileModal .password-toggle:hover {
    color: var(--wme-blue);
}

#profileModal .password-toggle:focus {
    outline: none;
}

/* Dark mode password toggle */
[data-theme="dark"] #profileModal .password-toggle {
    color: var(--muted);
}

[data-theme="dark"] #profileModal .password-toggle:hover {
    color: var(--wme-blue);
}

/* Form Row */
#profileModal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    #profileModal .form-row {
        grid-template-columns: 1fr;
    }
}

/* Products List */
#profileModal .products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#profileModal .product-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-alt);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

#profileModal .product-option:hover {
    background: var(--line);
}

#profileModal .product-option input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#profileModal .product-option img {
    width: 24px;
    height: 24px;
}

#profileModal .product-name {
    flex: 1;
    font-weight: 500;
}

/* Buttons in Profile Modal */
#profileModal .btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 8px;
}

/* Notification in Profile Modal */
#profileModal .notification {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    display: none;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

#profileModal .notification.success {
    display: flex;
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

#profileModal .notification.error {
    display: flex;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

#profileModal .notification.info {
    display: flex;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

#profileModal .notification i {
    font-size: 1.2rem;
}

/* Dark mode adjustments for notifications */
[data-theme="dark"] #profileModal .notification.success {
    background: rgba(6, 95, 70, 0.4);
    color: #a7f3d0;
    border-color: rgba(110, 231, 183, 0.5);
}

[data-theme="dark"] #profileModal .notification.error {
    background: rgba(153, 27, 27, 0.4);
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.5);
}

[data-theme="dark"] #profileModal .notification.info {
    background: rgba(30, 64, 175, 0.4);
    color: #bfdbfe;
    border-color: rgba(147, 197, 253, 0.5);
}

/* Responsive Profile Modal */
@media (max-width: 640px) {
    #profileModal {
        width: 95%;
        max-height: 90vh;
    }

    #profileModal .modal-header {
        padding: 16px 20px;
    }

    #profileModal .modal-body {
        padding: 20px;
    }

    .modal-tabs {
        padding: 0 20px;
    }

    .modal-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* =============================================================================
   In-Page Notification Animations
   ============================================================================= */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        right: 20px;
        opacity: 1;
    }
    to {
        right: -400px;
        opacity: 0;
    }
}
