/* Sabre Accounting - Styles */

:root {
  /* Dark theme (default) */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-card: #16162a;
  --bg-input: #1e1e38;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b80;
  --accent-primary: #7c3aed;
  --accent-secondary: #10b981;
  --accent-warning: #f59e0b;
  --accent-danger: #ef4444;
  --border-color: #2a2a4a;
  --shadow: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] {
  --bg-primary: #f5f5f7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f0f0f5;
  --text-primary: #1a1a2e;
  --text-secondary: #4a4a5a;
  --text-muted: #8a8a9a;
  --border-color: #e0e0e8;
  --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="medium"] {
  --bg-primary: #1e1e2e;
  --bg-secondary: #2a2a3e;
  --bg-card: #252538;
  --bg-input: #303048;
  --text-primary: #ffffff;
  --text-secondary: #b0b0c0;
  --text-muted: #7b7b90;
  --border-color: #3a3a5a;
  --shadow: rgba(0, 0, 0, 0.25);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Outfit",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Dev Banner */
.dev-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #7c3aed, #10b981);
  color: white;
  text-align: center;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 1000;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-text .accent {
  color: var(--accent-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-primary);
  color: white;
}

.nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.nav-section-divider {
  padding: 20px 16px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-dev-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.dev-timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-refresh {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-refresh:hover {
  opacity: 1;
}

/* Collapsible Sections */
.collapsible-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
  transition: background 0.2s;
}

.collapsible-header:hover {
  background: rgba(128, 128, 128, 0.06);
}

.collapse-icon {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.active-filter-badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
  vertical-align: middle;
  animation: filterPulse 1.5s ease-in-out infinite;
}

@keyframes filterPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.collapsible-section.collapsed .collapse-icon {
  transform: rotate(-90deg);
}

.collapsible-body {
  padding: 0 16px 12px 16px;
  transition:
    max-height 0.3s ease,
    padding 0.3s ease,
    opacity 0.2s ease;
  max-height: 800px;
  opacity: 1;
  overflow: hidden;
}

.collapsible-section.collapsed .collapsible-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
}

/* View Toggle */
.view-toggle {
  display: inline-flex;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.view-toggle-btn:hover {
  background: rgba(128, 128, 128, 0.08);
}

.view-toggle-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* Clickable Stat Cards */
.stat-clickable {
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.stat-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-clickable.stat-active {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

/* Active Filter Badge */
.active-filter-badge {
  display: inline-block;
  background: var(--accent-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 24px;
  min-height: 100vh;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.main-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
}

/* Page Content */
.page-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  font-size: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: 12px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-primary);
  color: white;
}

.btn-primary:hover {
  background: #6d28d9;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.badge-primary {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Empty State */
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

/* Tree Container */
.tree-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  min-height: 400px;
}

.tree-node {
  margin-left: 20px;
}

.tree-node-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--text-primary);
  /* Explicit color for visibility */
}

.tree-node-header:hover {
  background: var(--bg-input);
}

.tree-toggle {
  width: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tree-icon {
  font-size: 1.1rem;
  color: var(--text-primary);
  /* Explicit color */
}

.tree-name {
  font-weight: 500;
  flex: 1;
  color: var(--text-primary);
  /* Fix white-on-white issue */
}

.tree-type {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.tree-children {
  border-left: 1px dashed var(--border-color);
  margin-left: 10px;
  padding-left: 10px;
}

.tree-children.collapsed {
  display: none;
}

/* Tree Search/Filter */
.tree-filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
}

.tree-search-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.tree-search-input::placeholder {
  color: var(--text-muted);
}

.tree-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Filter Select Dropdowns */
.filter-select {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  min-width: 180px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-select:hover {
  border-color: var(--accent-primary);
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-alpha);
}

.tree-nav {
  display: flex;
  gap: 8px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow);
}

.product-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.product-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.product-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.theme-toggle-group {
  display: flex;
  gap: 8px;
}

.theme-btn {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn:hover {
  background: var(--border-color);
}

.theme-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.integration-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.integration-item:last-child {
  border-bottom: none;
}

/* Billing Grid */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input,
input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

.form-input:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Tree action buttons */
.tree-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.tree-node-header:hover .tree-actions {
  opacity: 1;
}

.tree-action-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
}

.tree-action-btn:hover {
  background: var(--accent-primary);
  color: white;
}

/* ==================== Login Page ==================== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
  padding: 20px;
}

.login-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 32px var(--shadow);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.login-header .logo-text {
  font-size: 1.5rem;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

.login-form {
  margin-bottom: 16px;
}

.login-footer {
  text-align: center;
  margin-top: 16px;
}

.login-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.login-footer a:hover {
  text-decoration: underline;
}

.login-admin-link {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.login-admin-link a {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
}

.login-admin-link a:hover {
  color: var(--accent-primary);
}

/* Password Toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
}

.password-input-wrapper input {
  flex: 1;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 8px;
}

.password-toggle:hover {
  opacity: 1;
}

/* Input Types */
input[type="password"],
input[type="tel"],
input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Form Messages */
.error-message {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.success-message {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.form-intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  text-align: center;
}

.form-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 4px;
  display: block;
}

/* Full Width Button */
.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Client Portal Styles */
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-status {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.invoices-filter-bar {
  margin-bottom: 20px;
}

.invoices-filter-bar select {
  max-width: 200px;
}

/* Statement Summary */
.statement-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.statement-summary .stat-card.highlight {
  background: linear-gradient(135deg, var(--accent-primary), #6d28d9);
  border-color: var(--accent-primary);
}

.statement-summary .stat-card.highlight .stat-label,
.statement-summary .stat-card.highlight .stat-value {
  color: white;
}

.statement-actions {
  margin-bottom: 24px;
}

/* Profile Card */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
}

.profile-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.profile-form {
  max-width: 600px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

/* Data Table */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.data-table tr:hover {
  background: var(--bg-input);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Role-based Visibility (handled by JS) */
[data-role-hidden="true"] {
  display: none !important;
}
/* ========== File Manager Styles ========== */

.file-manager {
  padding: 20px;
}

.file-manager-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.file-stat {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-value {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.1rem;
}

.file-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.file-folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-folder-card:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.folder-icon {
  font-size: 2rem;
}

.folder-info {
  flex: 1;
}

.folder-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.folder-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.folder-action {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.file-browser {
  padding: 20px;
}

.file-browser-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.file-list {
  max-height: 400px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.file-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

.file-icon {
  font-size: 1.8rem;
}

.file-details {
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.file-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-actions-buttons {
  display: flex;
  gap: 8px;
}

.upload-info {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent-primary);
  padding: 12px;
  margin: 15px 0;
  border-radius: 4px;
}

.upload-info p {
  margin: 4px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px 20px;
  min-width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--success-color);
}

.toast-error {
  border-left: 4px solid var(--danger-color);
}

.toast-info {
  border-left: 4px solid var(--accent-primary);
}

/* ==================== Products & Pricing ==================== */
.products-grid {
  display: grid;
  gap: 20px;
}

.pricing-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.pricing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.pricing-card-header {
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary, #6366f1)
  );
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
}

.pricing-card-header .product-icon {
  font-size: 2rem;
  min-width: 40px;
  text-align: center;
}

.pricing-card-header .product-info h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.pricing-card-header .product-info .tagline {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 2px;
}

.pricing-card-header .product-stats {
  margin-left: auto;
  text-align: right;
  font-size: 0.75rem;
  opacity: 0.9;
}

.pricing-card-header .product-stats .stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
}

.free-badge {
  display: inline-block;
  background: #10b981;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pricing-tiers {
  padding: 0;
  margin: 0;
  list-style: none;
}

.pricing-tier-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.pricing-tier-row:hover {
  background: var(--bg-hover, rgba(99, 102, 241, 0.04));
}

.pricing-tier-row:last-child {
  border-bottom: none;
}

.tier-name {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: capitalize;
  min-width: 80px;
}

.tier-features {
  flex: 1;
  padding: 0 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.tier-feature {
  white-space: nowrap;
}

.tier-price {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-primary);
  min-width: 90px;
  text-align: right;
}

.tier-price.free {
  color: #10b981;
}

.tier-price.custom {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tier-price .annual {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Bundle Cards */
.bundle-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.bundle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.bundle-card-header {
  padding: 20px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
}

.bundle-card-header h3 {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
}

.bundle-card-header p {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
}

.bundle-products-list {
  padding: 16px 20px;
}

.bundle-product-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-color);
}

.bundle-product-row:last-child {
  border-bottom: none;
}

.bundle-pricing {
  padding: 16px 20px;
  background: var(--bg-hover, rgba(0, 0, 0, 0.02));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bundle-original {
  text-decoration: line-through;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bundle-final {
  font-size: 1.3rem;
  font-weight: 700;
  color: #10b981;
}

.bundle-savings {
  background: #fef3c7;
  color: #b45309;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ==================== Payment Gateway Settings ==================== */
.gateway-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}

.gateway-row:last-child {
  border-bottom: none;
}

.gateway-row:hover {
  background: var(--bg-hover, rgba(99, 102, 241, 0.04));
}

.gateway-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.gateway-info {
  flex: 1;
}

.gateway-info h4 {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gateway-info .gateway-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.gateway-features {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.gateway-feature-badge {
  display: inline-block;
  background: var(--bg-hover, rgba(99, 102, 241, 0.08));
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.gateway-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 120px;
}

.gateway-config-form {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-hover, rgba(0, 0, 0, 0.02));
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.gateway-config-form .form-group {
  margin-bottom: 12px;
}

.gateway-config-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.gateway-config-form input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input, var(--card-bg));
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
}

.gateway-config-form .form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

/* ==================== Admin Management ==================== */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 4px;
}

.admin-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-tab:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.admin-tab.active {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.admin-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-filters .search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}

.admin-filters .search-input::placeholder {
  color: var(--text-muted);
}

.admin-filters .search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.admin-filters select {
  min-width: 150px;
}

/* Data Table */
.table-responsive {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-input);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.status-badge.pending_mandate {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.status-badge.suspended {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.status-badge.cancelled {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
}

.type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.type-badge.client {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.type-badge.reseller {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
.type-badge.partner {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

.product-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-primary);
  margin: 1px 2px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 16px;
}

.pagination button {
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  font-family: inherit;
}

.pagination button:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.pagination button.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Table Action Buttons */
.table-actions {
  display: flex;
  gap: 4px;
}

.table-actions .btn-sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: #ef4444;
  color: white;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: #10b981;
  color: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Toggle Switch */
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 1px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Drag & Drop Tree */
.tree-node[draggable="true"] > .tree-node-header {
  cursor: grab;
}
.tree-node[draggable="true"] > .tree-node-header:active {
  cursor: grabbing;
}
.tree-dragging {
  opacity: 0.4;
}
.tree-dragging > .tree-node-header {
  border: 2px dashed var(--accent-primary) !important;
  border-radius: 8px;
}
.tree-drop-target {
  background: rgba(16, 185, 129, 0.15) !important;
  border: 2px solid var(--accent-secondary) !important;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
