/* ==========================================================================
   BINOM 360 ERP - CLOUDFLARE DASHBOARD DESIGN SYSTEM
   Ultra-fast, engineering-grade, high-density layout inspired by dash.cloudflare.com.
   Features Cloudflare Orange (#f38020), crisp typography, structured sidebar navigation,
   and expansive enterprise data grids.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Cloudflare Primary Accents */
  --cf-orange: #f38020;
  --cf-orange-hover: #d96b14;
  --cf-orange-active: #c2590e;
  --cf-orange-light: #fff7ed;
  --cf-orange-subtle: #ffedd5;
  --cf-orange-border: #fed7aa;
  --cf-orange-glow: rgba(243, 128, 32, 0.2);

  /* Cloudflare Neutral Canvas & Surfaces */
  --cf-bg-canvas: #f6f6f7;
  --cf-bg-card: #ffffff;
  --cf-bg-sidebar: #ffffff;
  --cf-bg-header: #ffffff;
  --cf-bg-subtle: #f9fafb;
  --cf-bg-hover: #f3f4f6;

  /* Cloudflare Hairline Borders */
  --cf-border: #e5e7eb;
  --cf-border-subtle: #f3f4f6;
  --cf-border-input: #d1d5db;
  --cf-border-focus: #f38020;

  /* Typography & Text */
  --cf-text-primary: #111827;
  --cf-text-secondary: #374151;
  --cf-text-muted: #6b7280;
  --cf-text-subtle: #9ca3af;
  --cf-text-inverse: #ffffff;

  /* Status Colors */
  --cf-success: #059669;
  --cf-success-bg: #ecfdf5;
  --cf-success-border: #a7f3d0;
  --cf-warning: #d97706;
  --cf-warning-bg: #fffbeb;
  --cf-warning-border: #fde68a;
  --cf-danger: #dc2626;
  --cf-danger-bg: #fef2f2;
  --cf-danger-border: #fecaca;
  --cf-info: #2563eb;
  --cf-info-bg: #eff6ff;
  --cf-info-border: #bfdbfe;

  /* Dimensions */
  --sidebar-width: 250px;
  --header-height: 58px;

  /* Shadows */
  --cf-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --cf-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --cf-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --cf-shadow-focus: 0 0 0 3px rgba(243, 128, 32, 0.18);

  /* Transitions */
  --trans-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & FOUNDATIONS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--cf-bg-canvas);
  color: var(--cf-text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
  overflow-x: hidden;
}

a {
  color: var(--cf-orange);
  text-decoration: none;
  transition: color var(--trans-fast);
}

a:hover {
  color: var(--cf-orange-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  color: var(--cf-text-primary);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ==========================================================================
   MAIN LAYOUT CONTAINER
   ========================================================================== */
.erp-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  background-color: var(--cf-bg-canvas);
}

/* ==========================================================================
   CLOUDFLARE SIDEBAR NAVIGATION
   ========================================================================== */
.erp-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--cf-bg-sidebar);
  border-right: 1px solid var(--cf-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--trans-fast);
}

/* Sidebar Top Brand Header */
.erp-sidebar-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--cf-border);
  height: var(--header-height);
}

.erp-brand-text {
  display: flex;
  flex-direction: column;
}

.erp-brand-text h2 {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cf-text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.erp-brand-text h2::after {
  content: "DASH";
  font-size: 9.5px;
  font-weight: 700;
  background: var(--cf-orange);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.erp-brand-text span {
  font-size: 11px;
  color: var(--cf-text-muted);
  font-weight: 500;
}

/* Sidebar Menu */
.erp-sidebar-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Cloudflare Category Section Titles */
.menu-category-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cf-text-muted);
  padding: 14px 10px 6px 10px;
}

.menu-category-title:first-of-type {
  padding-top: 2px;
}

/* Cloudflare Navigation Menu Items */
.menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  color: var(--cf-text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: all var(--trans-fast);
  position: relative;
}

.menu-item i {
  font-size: 14.5px;
  width: 18px;
  text-align: center;
  color: var(--cf-text-muted);
  transition: color var(--trans-fast);
}

.menu-item:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.menu-item:hover i {
  color: var(--cf-text-primary);
}

/* Cloudflare Active Navigation State */
.menu-item.active {
  background-color: var(--cf-orange-light);
  color: var(--cf-orange);
  font-weight: 600;
}

.menu-item.active i {
  color: var(--cf-orange);
}

.menu-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background-color: var(--cf-orange);
  border-radius: 0 3px 3px 0;
}

/* Sidebar Footer Profile Area */
.erp-sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--cf-border);
  background-color: var(--cf-bg-subtle);
}

.user-mini-card {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background-color var(--trans-fast);
}

.user-mini-card:hover {
  background-color: var(--cf-bg-hover);
}

.user-mini-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--cf-border);
  background-color: #ffffff;
}

.user-mini-info {
  flex: 1;
  overflow: hidden;
}

.user-mini-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-role {
  font-size: 11px;
  color: var(--cf-text-muted);
}

.user-mini-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  flex-shrink: 0;
}

.user-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--cf-text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--trans-fast);
  border: 1px solid transparent;
}

.user-action-icon:hover {
  background-color: #ffffff;
  color: var(--cf-text-primary);
  border-color: var(--cf-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-action-icon.logout:hover {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

/* ==========================================================================
   MAIN CONTENT & HEADER AREA
   ========================================================================== */
.erp-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--cf-bg-canvas);
  transition: margin-left var(--trans-fast);
}

/* Cloudflare Header / Navbar */
.erp-header {
  height: var(--header-height);
  background-color: var(--cf-bg-header);
  border-bottom: 1px solid var(--cf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-toggle-btn {
  background: none;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--cf-text-secondary);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.sidebar-toggle-btn:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.header-title-group h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--cf-text-primary);
  margin-bottom: 2px;
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--cf-text-muted);
}

.header-breadcrumb a {
  color: var(--cf-text-muted);
  text-decoration: none;
}

.header-breadcrumb a:hover {
  color: var(--cf-orange);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--cf-border);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cf-text-secondary);
  text-decoration: none;
  position: relative;
  transition: all var(--trans-fast);
}

.header-action-btn:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.header-admin-settings-btn {
  background-color: #ffffff;
  color: var(--cf-orange);
  border-color: rgba(243, 128, 32, 0.4);
}

.header-admin-settings-btn:hover {
  background-color: #fffaf5;
  color: var(--cf-orange-hover);
  border-color: var(--cf-orange);
  box-shadow: 0 0 0 2px rgba(243, 128, 32, 0.15);
}

.header-action-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--cf-orange);
}

.header-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  background-color: #ffffff;
  text-decoration: none;
  transition: all var(--trans-fast);
}

.header-user-btn:hover {
  background-color: var(--cf-bg-hover);
}

.header-user-avatar {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  min-height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex-shrink: 0;
  display: block;
}

.header-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--cf-text-secondary);
}

/* ==========================================================================
   EXPANSIVE WORKSPACE CONTENT AREA
   ========================================================================== */
.erp-content {
  flex: 1;
  padding: 28px 36px 48px 36px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ==========================================================================
   CLOUDFLARE HERO / ACCOUNT BANNER
   ========================================================================== */
.welcome-hero {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--cf-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
}

.welcome-hero-content {
  max-width: 820px;
}

.welcome-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 4px;
  background-color: var(--cf-orange-light);
  color: var(--cf-orange);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  border: 1px solid var(--cf-orange-border);
}

.welcome-hero-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--cf-text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.welcome-hero-content p {
  font-size: 13.5px;
  color: var(--cf-text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   CLOUDFLARE STAT & METRIC CARDS
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--cf-shadow-sm);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  border-color: #d1d5db;
  box-shadow: var(--cf-shadow-md);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--cf-text-primary);
  line-height: 1.1;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.stat-desc {
  font-size: 12px;
  color: var(--cf-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-desc.trend-up {
  color: var(--cf-success);
  font-weight: 500;
}

/* ==========================================================================
   CLOUDFLARE ENTERPRISE CARDS (.erp-card)
   ========================================================================== */
.erp-card {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  box-shadow: var(--cf-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.erp-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--cf-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  gap: 12px;
}

.erp-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cf-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.erp-card-title i {
  color: var(--cf-orange);
  font-size: 15px;
}

.erp-card-body {
  padding: 20px;
}

/* ==========================================================================
   CLOUDFLARE BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--trans-fast);
  line-height: 1.35;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cloudflare Orange Primary Button */
.btn-primary, .btn-gold {
  background-color: var(--cf-orange);
  color: #ffffff !important;
  border-color: var(--cf-orange);
  font-weight: 600;
  box-shadow: var(--cf-shadow-sm);
}

.btn-primary:hover, .btn-gold:hover {
  background-color: var(--cf-orange-hover);
  border-color: var(--cf-orange-hover);
  box-shadow: 0 2px 4px rgba(243, 128, 32, 0.25);
}

.btn-primary:active, .btn-gold:active {
  background-color: var(--cf-orange-active);
  border-color: var(--cf-orange-active);
}

/* Cloudflare Secondary / Neutral Button */
.btn-secondary {
  background-color: #ffffff;
  color: var(--cf-text-secondary);
  border-color: var(--cf-border-input);
  box-shadow: var(--cf-shadow-sm);
}

.btn-secondary:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
  border-color: #9ca3af;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12.5px;
  border-radius: 5px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--cf-text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--cf-text-primary);
  background-color: #ffffff;
  border: 1px solid var(--cf-border-input);
  border-radius: 6px;
  padding: 8px 12px;
  transition: all var(--trans-fast);
  line-height: 1.4;
  outline: none;
}

.form-control:hover {
  border-color: #9ca3af;
}

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: pointer;
}

select.form-control:disabled {
  cursor: not-allowed;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

[dir="rtl"] select.form-control {
  background-position: left 12px center;
  padding-right: 12px;
  padding-left: 34px;
}

.form-control:focus {
  border-color: var(--cf-border-focus);
  box-shadow: var(--cf-shadow-focus);
}

.form-control:disabled, .form-control[readonly] {
  background-color: var(--cf-bg-subtle);
  color: var(--cf-text-muted);
  cursor: not-allowed;
  border-color: var(--cf-border);
}

.form-hint {
  font-size: 12px;
  color: var(--cf-text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   BADGES & PILLS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.2;
}

.badge-success {
  background-color: var(--cf-success-bg);
  color: var(--cf-success);
  border: 1px solid var(--cf-success-border);
}

.badge-warning {
  background-color: var(--cf-warning-bg);
  color: var(--cf-warning);
  border: 1px solid var(--cf-warning-border);
}

.badge-danger {
  background-color: var(--cf-danger-bg);
  color: var(--cf-danger);
  border: 1px solid var(--cf-danger-border);
}

.badge-secondary {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-secondary);
  border: 1px solid var(--cf-border);
}

.badge-gold {
  background-color: var(--cf-orange-light);
  color: var(--cf-orange);
  border: 1px solid var(--cf-orange-border);
  font-weight: 600;
}

/* ==========================================================================
   CLOUDFLARE TABS (.profile-tabs)
   ========================================================================== */
.profile-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--cf-border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--cf-text-muted);
  padding: 12px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--trans-fast);
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--cf-text-primary);
}

.tab-btn.active {
  color: var(--cf-orange);
  font-weight: 600;
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--cf-orange);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ==========================================================================
   PROFILE HERO & HEADER CARD
   ========================================================================== */
.profile-hero {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--cf-shadow-sm);
}

.profile-hero h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--cf-text-primary);
  margin-bottom: 4px;
}

.profile-header-card {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: var(--cf-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
}

.profile-avatar-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cf-border);
}

.profile-avatar-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background-color: var(--cf-orange);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid #ffffff;
}

.profile-user-details {
  flex: 1;
  min-width: 240px;
}

.profile-user-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--cf-text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.profile-user-email {
  font-size: 13px;
  color: var(--cf-text-muted);
  margin-bottom: 8px;
}

.profile-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ==========================================================================
   MODULE MARKETPLACE CARDS (.module-card)
   ========================================================================== */
.module-category-block {
  margin-bottom: 28px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cf-border);
}

.category-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--cf-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.module-card {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--cf-shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: break-word;
  transition: all var(--trans-fast);
}

.module-card:hover {
  border-color: #d1d5db;
  box-shadow: var(--cf-shadow-md);
}

.module-card.is-active {
  border-color: var(--cf-orange-border);
  background-color: #ffffff;
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  row-gap: 8px;
  margin-bottom: 12px;
}

.module-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background-color: var(--cf-bg-hover);
  color: var(--cf-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.module-card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--cf-text-primary);
  margin-bottom: 6px;
}

.module-card-desc {
  font-size: 12.5px;
  color: var(--cf-text-muted);
  line-height: 1.45;
  margin-bottom: 16px;
  flex: 1;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--cf-border-subtle);
}

.module-card-footer > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}



/* Switch Toggle Component */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  transition: .2s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background-color: var(--cf-orange);
}

input:checked + .slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   ENTERPRISE DATA TABLE
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

thead tr {
  background-color: var(--cf-bg-subtle);
  border-bottom: 1px solid var(--cf-border);
}

th {
  padding: 10px 16px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cf-text-muted);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--cf-border-subtle);
  color: var(--cf-text-secondary);
}

tbody tr:hover {
  background-color: var(--cf-bg-subtle);
}

/* ==========================================================================
   AUTH PAGES (LOGIN, REGISTER, VERIFY)
   ========================================================================== */
.auth-page-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--cf-bg-canvas);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  box-shadow: var(--cf-shadow-md);
  padding: 32px 36px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--cf-text-primary);
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 13.5px;
  color: var(--cf-text-muted);
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--cf-text-muted);
}

/* OTP 6-Digit Verification Inputs */
.otp-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.otp-input {
  width: 50px;
  height: 56px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--cf-text-primary);
  background-color: #ffffff;
  border: 1px solid var(--cf-border-input);
  border-radius: 6px;
  outline: none;
  transition: all var(--trans-fast);
}

.otp-input:focus {
  border-color: var(--cf-orange);
  box-shadow: var(--cf-shadow-focus);
}

/* ==========================================================================
   MODAL & DIALOG
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(17, 24, 39, 0.55);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.crop-modal {
  background-color: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--cf-shadow-lg);
  overflow: hidden;
}

.crop-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--cf-border);
}

.crop-modal-body {
  padding: 20px;
}

.crop-area-container {
  width: 100%;
  height: 280px;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--cf-border);
}

.crop-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.crop-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--cf-border);
  background-color: var(--cf-bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 6px;
  box-shadow: var(--cf-shadow-lg);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: toastSlideIn 0.2s ease;
}

.toast-success { border-left: 4px solid var(--cf-success); }
.toast-error { border-left: 4px solid var(--cf-danger); }
.toast-warning { border-left: 4px solid var(--cf-warning); }
.toast-info { border-left: 4px solid var(--cf-info); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 992px) {
  .erp-sidebar {
    transform: translateX(-100%);
  }

  .erp-sidebar.open,
  .erp-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .erp-main {
    margin-left: 0;
  }

  .sidebar-toggle-btn {
    display: flex;
  }

  .erp-header {
    padding: 0 16px;
  }

  .erp-content {
    padding: 20px 16px;
  }
}

/* ==========================================================================
   CATEGORIZED MODULE ACCORDION (NAV-CATEGORY-GROUP)
   ========================================================================== */
.nav-category-group {
  margin-bottom: 4px;
}

.nav-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--cf-text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: all var(--trans-fast);
  user-select: none;
}

.nav-category-header:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.nav-category-header.open {
  color: var(--cf-text-primary);
  background-color: rgba(0, 0, 0, 0.02);
}

.nav-category-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.nav-category-left i.cat-icon {
  font-size: 13.5px;
  width: 18px;
  text-align: center;
  color: var(--cf-orange);
  flex-shrink: 0;
}

.nav-category-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-category-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-category-count {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background-color: var(--cf-bg-subtle);
  color: var(--cf-text-muted);
  border: 1px solid var(--cf-border);
}

.nav-category-chevron {
  font-size: 10px;
  color: var(--cf-text-muted);
  transition: transform 0.2s ease;
}

.nav-category-header.open .nav-category-chevron,
.nav-category-group.open .nav-category-chevron {
  transform: rotate(180deg);
}

.nav-category-modules {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 4px 12px;
  margin-left: 12px;
  border-left: 2px solid var(--cf-border);
  transition: all 0.2s ease;
}

.nav-category-header.open + .nav-category-modules,
.nav-category-group.open > .nav-category-modules,
.nav-category-modules.show {
  display: flex !important;
}

.nav-module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6.5px 10px;
  font-size: 12.8px;
  font-weight: 500;
  color: var(--cf-text-secondary);
  border-radius: 5px;
  text-decoration: none;
  transition: all var(--trans-fast);
  position: relative;
}

.nav-module-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.nav-module-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  color: var(--cf-text-muted);
  transition: color var(--trans-fast);
  flex-shrink: 0;
}

.nav-module-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-module-item:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.nav-module-item:hover i {
  color: var(--cf-orange);
}

.nav-module-item.active {
  background-color: var(--cf-orange-light) !important;
  color: var(--cf-orange) !important;
  font-weight: 600 !important;
}

.nav-module-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background-color: var(--cf-orange);
  border-radius: 0 3px 3px 0;
}

.nav-module-item.active i {
  color: var(--cf-orange) !important;
}

.nav-category-header.active-cat {
  color: var(--cf-orange) !important;
  font-weight: 700 !important;
}

.nav-category-header.active-cat .cat-icon {
  color: var(--cf-orange) !important;
}

/* Clean Minimal Sidebar Footer */
.erp-sidebar-footer-clean {
  padding: 10px 14px;
  border-top: 1px solid var(--cf-border);
  background-color: var(--cf-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--cf-text-muted);
}

.erp-sidebar-footer-clean .version-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--cf-text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ==========================================================================
   HEADER RIGHT USER PROFILE DROPDOWN & QUICK ACTIONS
   ========================================================================== */
.header-user-wrapper {
  position: relative;
}

.header-action-btn.logout-btn:hover {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.header-action-btn.profile-settings-btn {
  color: var(--cf-text-secondary);
}

.header-action-btn.profile-settings-btn:hover {
  color: var(--cf-orange);
  border-color: var(--cf-orange);
  background-color: #fffaf5;
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid var(--cf-border);
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  z-index: 1000;
  display: none;
  animation: dropdownFadeIn 0.18s ease-out;
}

.header-user-dropdown.show {
  display: block;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-user-info {
  padding: 12px 16px 10px 16px;
  border-bottom: 1px solid var(--cf-border);
}

.dropdown-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cf-text-primary);
  line-height: 1.2;
}

.dropdown-user-role {
  font-size: 11.5px;
  color: var(--cf-orange);
  font-weight: 600;
  margin-top: 3px;
}

.dropdown-user-email {
  font-size: 11.5px;
  color: var(--cf-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* User Dropdown Header with Avatar (Admin & Apps) */
.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--cf-border);
  background-color: #fafbfc;
}

.user-dropdown-avatar {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  display: block;
}

.user-dropdown-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.user-dropdown-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cf-text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-email {
  font-size: 11.5px;
  color: var(--cf-text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-role {
  display: inline-block;
  font-size: 10.5px;
  margin-top: 4px;
  padding: 2px 6px;
  font-weight: 600;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--cf-border);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--cf-text-secondary);
  text-decoration: none;
  transition: all var(--trans-fast);
  cursor: pointer;
}

.dropdown-item i {
  width: 16px;
  font-size: 13.5px;
  color: var(--cf-text-muted);
  text-align: center;
}

.dropdown-item:hover {
  background-color: var(--cf-bg-hover);
  color: var(--cf-text-primary);
}

.dropdown-item:hover i {
  color: var(--cf-orange);
}

.dropdown-item.logout {
  color: #dc2626;
}

.dropdown-item.logout i {
  color: #dc2626;
}

.dropdown-item.logout:hover {
  background-color: #fef2f2;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (CLOUDFLARE DASHBOARD SPEC)
   ========================================================================== */

/* Mobile Sidebar Overlay Backdrop */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.show {
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.sidebar-open {
  overflow: hidden !important;
}

/* Responsive Table Wrapper Auto-Support */
.table-responsive, .cf-table-container, .data-table-container, .data-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* TABLET & MOBILE BREAKPOINT (< 992px) */
@media (max-width: 991px) {
  .erp-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 270px !important;
    max-width: 85vw !important;
    z-index: 1000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.25) !important;
  }

  .erp-sidebar.open {
    transform: translateX(0) !important;
  }

  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .erp-main {
    margin-left: 0 !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .erp-header {
    padding: 0 18px !important;
    height: 56px !important;
  }

  .erp-content {
    padding: 18px 16px !important;
  }

  .header-breadcrumb {
    display: none !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .admin-grid, .team-grid {
    grid-template-columns: 1fr !important;
  }
}

/* PHONE BREAKPOINT (< 768px) */
@media (max-width: 768px) {
  .erp-header {
    padding: 0 12px !important;
  }

  .header-left {
    gap: 10px !important;
    min-width: 0;
    flex: 1;
  }

  .header-title-group h1 {
    font-size: 14.5px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .header-right {
    gap: 8px !important;
    flex-shrink: 0;
  }

  .header-right > div:first-child {
    display: none !important; /* Hide long date string on phone */
  }

  .header-action-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  .header-user-btn {
    padding: 4px 6px !important;
    gap: 6px !important;
  }

  .header-user-name {
    display: none !important; /* Keep avatar and chevron */
  }

  .header-user-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  .header-user-dropdown {
    width: 270px !important;
    max-width: calc(100vw - 20px) !important;
    right: 0 !important;
  }

  .filter-toolbar, .toolbar, .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .filter-toolbar-left, .filter-toolbar-right {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .cf-search-box, .search-box {
    width: 100% !important;
    max-width: 100% !important;
  }

  .cf-search-input, .search-input {
    width: 100% !important;
  }

  .table-responsive table, .cf-table, .data-table {
    min-width: 600px; /* Enable horizontal scrolling on mobile table */
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .welcome-hero {
    padding: 18px 16px !important;
    gap: 14px !important;
  }

  .welcome-hero-content h2 {
    font-size: 17px !important;
  }

  .module-grid {
    grid-template-columns: 1fr !important;
  }

  .module-card-footer {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  .profile-tabs {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 10px 12px !important;
    font-size: 12.5px !important;
  }

  .profile-header-card {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 20px 16px !important;
  }

  .profile-nav-tabs {
    overflow-x: auto !important;
    white-space: nowrap !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px !important;
  }

  .cf-modal, .modal-dialog, .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    margin: 10px auto !important;
  }
}

/* EXTRA SMALL PHONE BREAKPOINT (< 480px) */
@media (max-width: 480px) {
  .erp-header {
    height: 52px !important;
    padding: 0 10px !important;
  }

  .header-title-group h1 {
    font-size: 13.5px !important;
    max-width: 130px;
  }

  .erp-content {
    padding: 12px 10px !important;
  }

  .stat-card {
    padding: 14px !important;
  }

  .stat-value {
    font-size: 20px !important;
  }

  .module-card {
    padding: 14px !important;
  }

  .erp-card-header, .cf-card-header {
    padding: 12px 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .erp-card-body, .cf-card-body {
    padding: 14px 12px !important;
  }
}

/* ==========================================================================
   MULTI-LANGUAGE (i18n) & RTL SYSTEM STYLES
   ========================================================================== */
.lang-selector-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  user-select: none;
}

.lang-selector-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  background: var(--cf-bg-card, #ffffff);
  border: 1px solid var(--cf-border, #e5e7eb);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cf-text-primary, #111827);
  cursor: pointer;
  transition: all var(--trans-fast, 140ms ease);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lang-selector-btn:hover {
  background: var(--cf-bg-hover, #f3f4f6);
  border-color: var(--cf-border-input, #d1d5db);
}

.lang-selector-wrap.is-open .lang-selector-btn {
  border-color: var(--cf-orange, #f38020);
  box-shadow: 0 0 0 3px rgba(243, 128, 32, 0.15);
}

.lang-flag {
  font-size: 15px;
  line-height: 1;
}

.lang-code-text {
  letter-spacing: 0.04em;
  font-family: "JetBrains Mono", monospace;
  font-size: 11.5px;
}

.lang-chevron {
  width: 14px;
  height: 14px;
  color: var(--cf-text-muted, #6b7280);
  transition: transform var(--trans-fast, 140ms ease);
}

.lang-selector-wrap.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid var(--cf-border, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
  z-index: 9999;
  overflow: hidden;
  animation: langDropdownIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes langDropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-selector-wrap.is-open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cf-text-muted, #6b7280);
  border-bottom: 1px solid var(--cf-border-subtle, #f3f4f6);
}

.lang-count-badge {
  background: var(--cf-orange-subtle, #ffedd5);
  color: var(--cf-orange-active, #c2590e);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
}

.lang-search-box {
  padding: 8px 10px;
  background: var(--cf-bg-subtle, #f9fafb);
  border-bottom: 1px solid var(--cf-border-subtle, #f3f4f6);
}

.lang-search-input {
  width: 100%;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--cf-border-input, #d1d5db);
  border-radius: 5px;
  font-size: 12px;
  color: var(--cf-text-primary, #111827);
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.lang-search-input:focus {
  border-color: var(--cf-orange, #f38020);
}

.lang-list-container {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}

.lang-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--trans-fast, 140ms ease);
}

.lang-item:hover {
  background: var(--cf-bg-hover, #f3f4f6);
}

.lang-item.is-selected {
  background: var(--cf-orange-light, #fff7ed);
}

.lang-item-flag {
  font-size: 16px;
  flex-shrink: 0;
}

.lang-item-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.lang-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cf-text-primary, #111827);
  line-height: 1.2;
}

.lang-item.is-selected .lang-item-name {
  color: var(--cf-orange-active, #c2590e);
}

.lang-item-sub {
  font-size: 11px;
  color: var(--cf-text-muted, #6b7280);
  line-height: 1.2;
}

.lang-item-check {
  width: 16px;
  height: 16px;
  color: var(--cf-orange, #f38020);
  flex-shrink: 0;
}

/* RTL Support (Arabic) */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .sidebar {
  left: auto !important;
  right: 0 !important;
  border-right: none !important;
  border-left: 1px solid var(--cf-border, #e5e7eb) !important;
}

[dir="rtl"] .main-wrapper {
  margin-left: 0 !important;
  margin-right: var(--sidebar-width, 250px) !important;
}

@media (max-width: 900px) {
  [dir="rtl"] .main-wrapper {
    margin-right: 0 !important;
  }
}

[dir="rtl"] .header-left {
  flex-direction: row-reverse;
}

[dir="rtl"] .lang-dropdown-menu {
  right: auto;
  left: 0;
}

[dir="rtl"] .lang-item {
  text-align: right;
}

/* ==========================================================================
   USER PROFILE DROPDOWN - IN-MENU LANGUAGE SELECTOR
   ========================================================================== */
.user-dropdown-lang-container {
  padding: 2px 0;
  user-select: none;
}

.user-dropdown-lang-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 6px;
  margin: 2px 6px;
  font-size: 13px;
  color: var(--cf-text-secondary, #374151);
  transition: all var(--trans-fast, 140ms ease);
}

.user-dropdown-lang-toggle:hover {
  background: var(--cf-bg-hover, #f3f4f6);
  color: var(--cf-text-primary, #111827);
}

.user-dropdown-lang-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-dropdown-flag {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.user-dropdown-label {
  font-size: 12.5px;
  white-space: nowrap;
}

.user-dropdown-label strong {
  color: var(--cf-orange, #f38020);
  font-weight: 700;
}

.user-dropdown-chevron {
  width: 13px;
  height: 13px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cf-text-muted, #6b7280);
  transition: transform var(--trans-fast, 140ms ease);
  flex-shrink: 0;
}

.user-dropdown-lang-container.is-open .user-dropdown-chevron {
  transform: rotate(180deg);
}

.user-dropdown-lang-list {
  margin: 4px 8px 8px 8px;
  background: #f9fafb;
  border: 1px solid var(--cf-border, #e5e7eb);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  animation: langDropdownIn 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

.user-dropdown-lang-search-box {
  padding: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--cf-border-subtle, #f3f4f6);
}

.user-dropdown-lang-search-box input {
  width: 100%;
  height: 26px;
  padding: 0 8px;
  font-size: 11.5px;
  border: 1px solid var(--cf-border-input, #d1d5db);
  border-radius: 4px;
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}

.user-dropdown-lang-search-box input:focus {
  border-color: var(--cf-orange, #f38020);
}

.user-dropdown-lang-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: var(--cf-text-primary, #111827);
  text-align: left;
  cursor: pointer;
  transition: background var(--trans-fast, 140ms ease);
  box-sizing: border-box;
}

.user-dropdown-lang-option:hover {
  background: var(--cf-bg-hover, #f3f4f6);
}

.user-dropdown-lang-option.is-selected {
  background: var(--cf-orange-light, #fff7ed);
  color: var(--cf-orange-active, #c2590e);
  font-weight: 700;
}

.user-dropdown-lang-opt-flag {
  font-size: 15px;
  flex-shrink: 0;
}

.user-dropdown-lang-opt-name {
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-lang-opt-code {
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  color: var(--cf-text-muted, #6b7280);
  margin-left: 4px;
}

.user-dropdown-lang-opt-check {
  width: 14px;
  height: 14px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--cf-orange, #f38020);
  flex-shrink: 0;
  margin-left: auto;
}

/* If user dropdown is present, hide the external navbar language switcher */
.has-user-dropdown-lang .header-lang-slot {
  display: none !important;
}

/* ==========================================================================
   ROOT FIX: DİL UZUNLUĞUNDAN BAĞIMSIZ TAŞMA GÜVENLİĞİ (i18n overflow-proof)
   Çeviri metni ne kadar uzarsa uzasın sayfa yatayda taşmaz; sığmayan metin
   kayar, sarar veya zarifçe kırpılır — düzen asla bozulmaz.
   ========================================================================== */

/* 1. Esnek kapsayıcıların içerik tarafından itilmesini engelle (en kritik kural) */
.erp-main,
.erp-content,
.erp-content-body,
.header-title-group {
  min-width: 0;
}

.erp-content,
.erp-content-body {
  max-width: 100%;
  overflow-wrap: break-word;
}

/* 2. Izgara kolonları kapsayıcıdan asla geniş olamaz */
.module-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.stat-card {
  min-width: 0;
}

/* 3. Kaymayan (nowrap) öğeler düzeni itemez; taşan metin kırpılır */
.btn {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.nav-module-item-left span,
.nav-category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4. Tablolar sayfayı itemez; kendi içinde yatay kayar */
.cf-table-container,
.data-table-wrapper,
.data-table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

th,
td {
  overflow-wrap: break-word;
}

/* 5. Medya ve form öğeleri kapsayıcıyı aşamaz */
img,
svg,
video,
table,
input,
select,
textarea {
  max-width: 100%;
}

pre,
code {
  white-space: pre-wrap;
  overflow-wrap: break-word;
}




