/*
 * Kokteyl Maliyet Hesap - Shared Styles
 * Modern, clean design system
 */

:root {
  /* Varied padding - break the perfect uniformity */
  --pad: 24px;
  --pad-snug: 20px;
  --pad-cozy: 28px;

  /* Intentionally imperfect border-radius */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-card: 16px;
  --radius-button: 10px;
  --radius-input: 8px;

  /* Core colors */
  --primary: #00205B;
  --primary-light: #003380;
  --primary-warm: #0a2560;
  --accent: #3b82f6;
  --accent-soft: #60a5fa;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Brand personality color - cocktail amber */
  --brand-amber: #d97706;
  --brand-amber-soft: #fbbf24;

  /* Varied shadows - not identical formulas */
  --shadow-soft: 0 2px 8px rgba(0,32,91,0.06);
  --shadow-sm: 0 1px 3px rgba(0,32,91,0.08);
  --shadow-card: 0 4px 12px -2px rgba(0,32,91,0.08), 0 2px 6px -2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 16px -4px rgba(0,32,91,0.1), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 24px -6px rgba(0,32,91,0.12), 0 4px 8px -4px rgba(0,0,0,0.06);
  --shadow-xl: 0 20px 40px -8px rgba(0,32,91,0.15), 0 8px 16px -8px rgba(0,0,0,0.08);
  --shadow-elevated: 0 8px 24px -4px rgba(0,32,91,0.12);

  /* Varied transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease-out;
  --transition-bounce: 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html {
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  margin: 0;
  background: var(--surface);
  color: var(--text);
  min-height: 100svh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Layout */
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 20px;
}

/* ============================================
   AUTH SCREEN - Premium MasrafX-style Design
   ============================================ */
.auth-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100svh;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #001232 50%, #001a45 100%);
  background-size: 400% 400%;
  animation: authGradientShift 8s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

@keyframes authGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.auth-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(0, 32, 91, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  animation: authFloatingOrbs 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes authFloatingOrbs {
  0%, 100% { transform: translateX(0px) translateY(0px); opacity: 0.7; }
  25% { transform: translateX(-20px) translateY(-30px); opacity: 0.9; }
  50% { transform: translateX(20px) translateY(20px); opacity: 0.5; }
  75% { transform: translateX(-10px) translateY(10px); opacity: 0.8; }
}

.auth-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  padding: 28px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  position: relative;
  z-index: 10;
  animation: slideUp 0.4s ease-out;
}

.auth-header {
  margin-bottom: 20px;
}

.auth-logo {
  margin-bottom: 12px;
  text-align: center;
}

.auth-logo img {
  height: 56px;
  width: auto;
  object-fit: contain;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.auth-form {
  text-align: left;
}

.auth-form .form-group {
  margin-bottom: 12px;
}

.auth-form label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: block;
}

.auth-form .input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  gap: 10px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 44px;
}

.auth-form .input:hover {
  border-color: var(--text-light);
}

.auth-form .input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 32, 91, 0.1);
}

.auth-form .input input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  color: var(--text);
  padding: 0;
  min-width: 0;
}

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

.auth-form .input span {
  color: var(--text-light);
  font-size: 14px;
}

.auth-form .input .icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-form .input .icon svg {
  color: var(--text-light);
}

.auth-form .hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

.auth-form .btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
}

.auth-links {
  text-align: center;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.auth-links a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

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

.forgot-link {
  color: var(--text-muted) !important;
  font-size: 12px;
  font-weight: 400 !important;
}

.forgot-link:hover {
  color: var(--primary) !important;
}

.auth-divider {
  text-align: center;
  margin: 14px 0 0 0;
  padding: 12px 0 0 0;
  border-top: 1px solid var(--border-light);
}

.auth-divider p {
  font-size: 11px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.4;
}

.auth-divider a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-divider a:hover {
  text-decoration: underline;
}

/* Auth Screen Watermark - hidden by default */
.auth-watermark {
  display: none;
}

/* Password toggle in auth form */
.auth-form .input .password-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: color 0.15s;
}

.auth-form .input .password-toggle:hover {
  color: var(--text-muted);
}

/* Auth Error/Alert */
.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #dc2626;
  font-size: 14px;
}

.auth-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #16a34a;
  font-size: 14px;
}

.page-full {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card - with visual hierarchy */
.card {
  width: min(720px, 100%);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.08);
  padding: var(--pad);
  animation: slideUp 0.35s ease-out;
}

.card-sm {
  width: min(420px, 100%);
  padding: var(--pad-snug);
  border-radius: var(--radius);
}

.card-lg {
  width: min(960px, 100%);
  padding: var(--pad-cozy);
}

.card-full {
  width: 100%;
}

/* Accent card - for important sections */
.card-accent {
  border-left: 4px solid var(--brand-amber);
  border-radius: var(--radius-sm) var(--radius-card) var(--radius-card) var(--radius-sm);
}

/* Subtle card - less prominent */
.card-subtle {
  background: var(--surface-alt);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Typography */
h1 {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--primary);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--primary);
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}

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

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 12px 0 20px;
}

@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Form Elements - touch-friendly */
label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.02em;
}

.input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 14px 16px;
  gap: 12px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 52px;
}

.input:hover {
  border-color: var(--text-light);
}

.input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.input.error {
  border-color: var(--danger);
}

.input.error:focus-within {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Validation shake animation */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.input.error.shake {
  animation: inputShake 0.5s ease-in-out;
}

/* Form group error state */
.form-group.has-error label {
  color: var(--danger);
}

.form-group.has-error .hint {
  color: var(--danger);
}

/* Validation warning alert */
.validation-warning {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.validation-warning svg {
  flex-shrink: 0;
  color: var(--danger);
  margin-top: 2px;
}

.validation-warning-content {
  flex: 1;
}

.validation-warning-title {
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 4px;
  font-size: 14px;
}

.validation-warning-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
}

.validation-warning-list li {
  padding: 2px 0;
}

.validation-warning-list li::before {
  content: "• ";
  color: var(--danger);
}

.input span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.input span.icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.input span.icon svg {
  flex-shrink: 0;
}

.input input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 16px;
  min-width: 0;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}

.input input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}

.input input[readonly] {
  color: var(--text);
}

/* Password Toggle */
.password-toggle {
  background: none;
  border: none;
  padding: 4px 8px;
  margin: -4px -8px -4px 4px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.password-toggle:focus {
  outline: none;
  color: var(--accent);
}

.password-toggle .eye-icon,
.password-toggle .eye-off-icon {
  display: flex;
  align-items: center;
}

.hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 6px;
  padding-left: 2px;
}

.error-text {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  padding-left: 2px;
}

/* Buttons - human touch with asymmetric padding */
button, .btn {
  border: 0;
  border-radius: var(--radius-button);
  padding: 13px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  position: relative;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,32,91,0.2);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,32,91,0.25);
}

.btn-primary:hover::after {
  opacity: 1;
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 1px 2px rgba(0,32,91,0.2);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--text-light);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  transform: translateY(-1px);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-success {
  background: #065f46;
  color: white;
  border: none;
  box-shadow: 0 2px 4px rgba(6,95,70,0.2);
}

.btn-success:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6,95,70,0.25);
}

.btn-success:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* Button Groups */
.btns {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Result Tiles - with visual hierarchy */
.result {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

@media (min-width: 560px) {
  .result { grid-template-columns: 1fr 1fr; gap: 16px; }
  .result .tile:first-child { grid-column: span 2; }
}

.tile {
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  background: var(--primary);
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-elevated);
}

/* Primary tile - biggest, most prominent */
.tile-primary,
.tile:first-child {
  background: var(--primary);
}

.tile-primary .v,
.tile:first-child .v {
  font-size: 28px;
}

/* Secondary tile - less prominent */
.tile.light,
.tile-secondary {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.tile.light:hover,
.tile-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--border);
}

/* Accent tile - brand color attention grabber */
.tile-accent {
  background: linear-gradient(145deg, var(--brand-amber) 0%, #b45309 100%);
  color: white;
}

.tile .k {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tile .v {
  font-size: 24px;
  font-weight: 700;
  margin-top: 8px;
  word-break: break-word;
  letter-spacing: -0.02em;
}

.tile.light .v,
.tile-secondary .v {
  font-size: 20px;
  color: var(--primary);
}

/* Stats Cards */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1.5px solid var(--border-light);
  overflow: hidden;
  word-break: break-word;
}

.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--surface-alt);
}

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

/* Badges */
.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #ecfdf5;
  color: var(--success);
}

.badge-warning {
  background: #fffbeb;
  color: var(--warning);
}

.badge-danger {
  background: #fef2f2;
  color: var(--danger);
}

.badge-info {
  background: #eff6ff;
  color: var(--accent);
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.alert-info {
  background: #eff6ff;
  color: var(--accent);
  border: 1px solid #bfdbfe;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  width: min(440px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s ease-out;
}

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

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.modal-body {
  padding: 24px;
}

.modal-description {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px 0;
  line-height: 1.6;
}

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

.modal-actions .btn {
  min-width: 100px;
}

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

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}

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

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

/* Dropdown Panel (for product selection) */
.dropdown-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 32, 91, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
  animation: fadeIn 0.2s ease-out;
}

.dropdown-panel.open {
  display: flex;
}

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

.dropdown-card {
  width: min(620px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,0.2);
  overflow: hidden;
  animation: scaleIn 0.25s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.dropdown-head {
  padding: 16px;
  border-bottom: 1.5px solid var(--border-light);
  background: var(--surface-alt);
}

.dropdown-listbox {
  max-height: 55vh;
  overflow: auto;
}

.dropdown-listbox::-webkit-scrollbar {
  width: 6px;
}

.dropdown-listbox::-webkit-scrollbar-track {
  background: transparent;
}

.dropdown-listbox::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.dropdown-item {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--surface-alt);
}

.dropdown-item:active {
  background: #e2e8f0;
}

.dropdown-listbox .dropdown-item {
  display: block;
}

.dropdown-item .item-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.dropdown-item .item-meta {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
  white-space: nowrap;
}

/* Dividers */
hr {
  border: none;
  border-top: 1.5px solid var(--border-light);
  margin: 8px 0;
  grid-column: 1 / -1;
}

/* Footer */
.footer {
  margin-top: 16px;
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
}

.footer-white {
  color: rgba(255,255,255,0.5);
}

/* User Info */
.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: #fff;
}

.user-info .user-name {
  font-weight: 600;
}

.user-info .user-role {
  font-size: 12px;
  opacity: 0.8;
}

/* Loading States */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading p {
  margin-top: 16px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* Inline Empty State (inside table containers) */
.empty-state-inline {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state-inline .empty-icon {
  margin-bottom: 12px;
}

.empty-state-inline svg {
  opacity: 0.3;
}

.empty-state-inline h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
}

.empty-state-inline p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Utility Classes */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Auth Pages Specific */
.auth-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  font-weight: 500;
}

/* Dashboard Specific */
.dashboard-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

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

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

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

/* Copy Button */
.copy-btn {
  padding: 4px 8px;
  font-size: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--border-light);
}

.copy-btn.copied {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: var(--success);
}

/* ================================
   DASHBOARD SIDEBAR LAYOUT
   Mobile-first: slide-out drawer
   Desktop: hover-to-expand
================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Sidebar - Mobile-first: hidden off-screen by default */
.sidebar {
  width: 280px;
  background: var(--primary);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}

/* Mobile: Slide in when open */
.sidebar.open {
  transform: translateX(0);
}

/* Desktop (768px+): Collapsed hover-to-expand */
@media (min-width: 768px) {
  .sidebar {
    width: 72px;
    transform: translateX(0);
    transition: width 0.25s ease;
  }

  .sidebar:hover,
  .sidebar.expanded {
    width: 260px;
  }
}

.sidebar-logo {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sidebar-logo img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  transition: all 0.2s ease-out;
}

.sidebar:hover .sidebar-logo img,
.sidebar.expanded .sidebar-logo img {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.sidebar-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.2s ease-out;
  white-space: nowrap;
}

.sidebar:hover .sidebar-title,
.sidebar.expanded .sidebar-title {
  opacity: 1;
  max-height: 24px;
  margin-top: 4px;
}

.sidebar-subtitle {
  display: block;
  font-size: 11px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.2s ease-out;
  white-space: nowrap;
}

.sidebar:hover .sidebar-subtitle,
.sidebar.expanded .sidebar-subtitle {
  opacity: 0.7;
  max-height: 20px;
  margin-top: 2px;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-link.active svg {
  opacity: 1;
}

/* Hide link text when collapsed */
.sidebar-link span {
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.sidebar:hover .sidebar-link span,
.sidebar.expanded .sidebar-link span {
  opacity: 1;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.sidebar:hover .sidebar-user-details,
.sidebar.expanded .sidebar-user-details {
  opacity: 1;
}

.sidebar-user-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  display: block;
  font-size: 11px;
  opacity: 0.7;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  transition: all var(--transition);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  overflow: hidden;
}

.sidebar-logout:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  text-decoration: none;
}

.sidebar-logout svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-logout span {
  opacity: 0;
  transition: opacity 0.15s ease-out;
  white-space: nowrap;
}

.sidebar:hover .sidebar-logout span,
.sidebar.expanded .sidebar-logout span {
  opacity: 1;
}

/* Main Content Area - Mobile-first: no sidebar margin */
.main-content {
  flex: 1;
  margin-left: 0;
  padding: 72px 16px 24px;
  background: var(--surface);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
  max-width: 100vw;
}

/* Adjust padding for mobile header */
@media (max-width: 767px) {
  .main-content {
    padding-top: 72px;
  }
}

/* Desktop (768px+): Add margin for collapsed sidebar */
@media (min-width: 768px) {
  .main-content {
    margin-left: 72px;
    padding: 24px;
  }

  /* Expand margin when sidebar is hovered */
  .dashboard-layout:has(.sidebar:hover) .main-content,
  .dashboard-layout:has(.sidebar.expanded) .main-content {
    margin-left: 260px;
  }
}

/* ================================
   MOBILE HEADER BAR
   Sticky header with hamburger menu
================================ */
.mobile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  padding: 0 16px;
  background: var(--primary);
  color: white;
  z-index: 101;
  box-shadow: var(--shadow-card);
}

.mobile-header-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Desktop (768px+): Hide mobile header */
@media (min-width: 768px) {
  .mobile-header {
    display: none;
  }
}

/* Mobile Menu Button - Inside header, transforms to X when open */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Hamburger icon lines */
.mobile-menu-btn .menu-icon {
  width: 20px;
  height: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mobile-menu-btn .menu-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: white;
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Transform to X when sidebar is open */
body.sidebar-open .mobile-menu-btn .menu-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.sidebar-open .mobile-menu-btn .menu-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.sidebar-open .mobile-menu-btn .menu-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile header changes when sidebar open */
body.sidebar-open .mobile-header {
  background: transparent;
  box-shadow: none;
}

body.sidebar-open .mobile-header-title {
  opacity: 0;
  visibility: hidden;
}

body.sidebar-open .mobile-menu-btn {
  background: rgba(255,255,255,0.15);
}

/* Legacy SVG support */
.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Desktop (768px+): Hide mobile menu button */
@media (min-width: 768px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Prevent body scroll when sidebar is open */
body.sidebar-open {
  overflow: hidden;
}

/* Sidebar Backdrop - Mobile only */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 32, 91, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.open {
  display: block;
  opacity: 1;
}

/* Enhanced Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
  max-width: 100%;
  overflow: hidden;
}

.stats-grid .stat-card {
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
}

.stat-card.highlight .stat-value {
  color: white;
}

.stat-card.highlight .stat-label {
  color: rgba(255,255,255,0.95);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.users { background: rgba(0, 32, 91, 0.1); color: #00205B; }
.stat-icon.active { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.stat-icon.pending { background: rgba(217, 119, 6, 0.1); color: #D97706; }
.stat-icon.logins { background: rgba(70, 130, 180, 0.12); color: #4682B4; }
.stat-icon.calc { background: rgba(100, 149, 237, 0.12); color: #6495ED; }
.stat-icon.time { background: rgba(217, 119, 6, 0.1); color: #D97706; }
.stat-icon.success { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.stat-icon.products { background: rgba(139, 92, 246, 0.12); color: #8B5CF6; }

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
  max-width: 100%;
  overflow: hidden;
}

.charts-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.chart-card {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
  max-width: 100%;
}

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

.chart-header {
  margin-bottom: 16px;
}

.chart-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.chart-header h3 svg {
  color: var(--accent);
}

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

.chart-container {
  position: relative;
  height: 280px;
  max-width: 100%;
  overflow: visible;
}

/* Horizontal bar chart needs more height for readable labels */
#popularProductsChart {
  min-height: 280px;
}

.chart-container-donut {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-container-donut canvas {
  max-height: 260px;
}

/* Dashboard Sections */
.dashboard-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: 24px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
  animation: slideUp 0.4s ease-out;
  overflow: visible;
  max-width: 100%;
}

.dashboard-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-section h2 svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

/* Section Header with Actions */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header-with-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header-with-actions h2 {
  margin-bottom: 0;
}

.section-header h2 {
  margin-bottom: 0;
}

/* Date Filter Dropdown */
.date-filter-wrapper {
  position: relative;
}

.date-filter-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.date-filter-dropdown {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  min-width: 280px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.date-filter-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.date-filter-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.date-filter-tab {
  flex: 1;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.date-filter-tab:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.date-filter-tab.active {
  color: var(--primary);
}

.date-filter-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.date-filter-panel {
  padding: 8px 0;
}

.preset-list {
  display: flex;
  flex-direction: column;
}

.preset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.preset-item:hover {
  background: var(--surface-alt);
}

.preset-item.active {
  background: rgba(0, 32, 91, 0.08);
}

.preset-item.active .preset-label {
  color: var(--primary);
  font-weight: 600;
}

.preset-label {
  font-size: 14px;
  color: var(--text);
}

.preset-dates {
  font-size: 12px;
  color: var(--text-light);
}

.custom-range-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.range-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.range-input-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.range-input {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--background);
  transition: all 0.2s ease;
}

.range-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 32, 91, 0.1);
}

.range-apply-btn {
  margin-top: 8px;
}

/* Custom Date Input & Calendar */
.custom-date-input {
  position: relative;
}

.custom-date-input .range-input {
  width: 100%;
  padding-right: 36px;
  cursor: pointer;
}

.custom-date-input > svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.mini-calendar {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.mini-calendar.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mini-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-year {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-month-year:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.cal-month-year::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-left: 2px;
}

/* Year/Month Selector */
.cal-year-month-selector {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  z-index: 10;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.cal-year-month-selector.show {
  display: flex;
}

.cal-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.cal-selector-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cal-selector-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-size: 16px;
}

.cal-selector-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.cal-year-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal-year-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.cal-year-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  transition: color 0.15s ease;
}

.cal-year-btn:hover {
  color: var(--primary);
}

.cal-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.cal-month-btn {
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-month-btn:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
}

.cal-month-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cal-month-btn.current {
  border-color: var(--primary);
  color: var(--primary);
}

.cal-month-btn.disabled,
.cal-month-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  transition: color 0.15s ease;
}

.cal-nav-btn:hover {
  color: var(--primary);
}

.mini-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 8px;
  gap: 2px;
}

.mini-calendar-weekdays span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  padding: 4px 0;
}

.mini-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cal-day:hover:not(.empty):not(.disabled) {
  background: var(--surface-alt);
}

.cal-day.empty {
  cursor: default;
}

.cal-day.disabled {
  color: var(--text-light);
  opacity: 0.4;
  cursor: not-allowed;
}

.cal-day.today {
  background: var(--surface-alt);
  font-weight: 600;
  color: var(--primary);
}

.cal-day.selected {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.cal-day.selected:hover {
  background: var(--primary-dark);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease;
  max-width: 400px;
}

.toast.toast-success {
  border-left: 4px solid var(--success);
}

.toast.toast-error {
  border-left: 4px solid var(--danger);
}

.toast.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

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

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-warning .toast-icon {
  color: var(--warning);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}

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

.toast-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.toast-close:hover {
  background: var(--surface-alt);
  color: var(--text);
}

.toast.removing {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }

  .toast {
    max-width: 100%;
  }
}

/* Empty State Enhancement */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  background: var(--surface-alt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-state .empty-icon svg {
  width: 36px;
  height: 36px;
  opacity: 0.4;
}

.empty-state h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 20px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Empty State Button - Proper sizing */
.empty-state .btn {
  padding: 10px 20px;
  font-size: 14px;
  width: auto;
  max-width: 220px;
}

.empty-state .btn svg {
  width: 16px;
  height: 16px;
}

/* Empty Warning - Inline warning for empty tables */
.empty-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 16px;
}

.empty-warning svg {
  color: #f59e0b;
  flex-shrink: 0;
}

.empty-warning.hidden {
  display: none;
}

/* Two-column chart grid for user dashboard */
.charts-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Tablet Responsiveness */
@media (max-width: 1024px) {
  .charts-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .charts-grid,
  .charts-grid-2,
  .charts-grid-3 {
    grid-template-columns: 1fr;
  }

  /* On mobile, sidebar is full width slide-out drawer */
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }

  .sidebar:hover {
    width: 260px;
  }

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

  /* Always show text on mobile when open */
  .sidebar.open .sidebar-link span,
  .sidebar.open .sidebar-logout span,
  .sidebar.open .sidebar-user-details,
  .sidebar.open .sidebar-title,
  .sidebar.open .sidebar-subtitle {
    opacity: 1;
    max-height: none;
  }

  .sidebar.open .sidebar-logo img {
    width: 64px;
    height: 64px;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
    padding: 72px 12px 24px;
    transition: none;
  }

  /* Don't shift content on mobile */
  .dashboard-layout:has(.sidebar:hover) .main-content,
  .dashboard-layout:has(.sidebar.expanded) .main-content {
    margin-left: 0;
  }

  /* Stats grid - 2 columns on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px 12px;
  }

  .stat-card .stat-value {
    font-size: 22px;
  }

  .stat-card .stat-label {
    font-size: 11px;
  }

  .stat-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
  }

  .stat-icon svg {
    width: 18px;
    height: 18px;
  }

  /* Charts grid - single column */
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 16px;
  }

  .charts-grid-3 {
    grid-template-columns: 1fr;
  }

  .chart-card {
    padding: 14px;
  }

  .chart-header {
    margin-bottom: 12px;
  }

  .chart-header h3 {
    font-size: 14px;
  }

  .chart-subtitle {
    font-size: 12px;
  }

  .chart-container {
    height: 200px;
  }

  .chart-container-popular-products {
    height: 220px;
  }

  #popularProductsChart {
    min-height: 0;
  }

  .chart-card-popular-products {
    overflow: visible;
  }

  .chart-container-donut {
    height: 200px;
  }

  .chart-container-donut canvas {
    max-height: 180px;
  }

  /* Dashboard section */
  .dashboard-section {
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 16px;
    gap: 8px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .section-header h2 svg {
    width: 20px;
    height: 20px;
  }

  .section-header .sub {
    font-size: 13px;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 68px 10px 20px;
  }

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

  .stat-card {
    padding: 12px 10px;
  }

  .stat-card .stat-value {
    font-size: 20px;
  }

  .stat-card .stat-label {
    font-size: 10px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  /* Charts */
  .chart-card {
    padding: 12px;
  }

  .chart-container {
    height: 180px;
  }

  .chart-container-popular-products {
    height: 200px;
  }

  .chart-container-donut {
    height: 180px;
  }

  .chart-container-donut canvas {
    max-height: 160px;
  }

  .chart-header h3 {
    font-size: 13px;
  }

  .chart-subtitle {
    font-size: 11px;
  }

  /* Dashboard section */
  .dashboard-section {
    padding: 12px;
    margin-bottom: 12px;
  }

  .section-header h2 {
    font-size: 16px;
  }
}

/* ================================
   USER APP LAYOUT
   Mobile-first: same approach as dashboard
================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Mobile-first: no sidebar margin */
.app-layout .main-content {
  flex: 1;
  margin-left: 0;
  padding: 72px 16px 24px;
  background: var(--surface);
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

/* Desktop (768px+): Add margin for sidebar */
@media (min-width: 768px) {
  .app-layout .main-content {
    margin-left: 72px;
    padding: 24px;
  }

  .app-layout:has(.sidebar:hover) .main-content,
  .app-layout:has(.sidebar.expanded) .main-content {
    margin-left: 260px;
  }
}

/* Content Card (main card wrapper) */
.content-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--pad);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.08);
  animation: slideUp 0.35s ease-out;
  max-width: 1200px;
  margin: 0 auto;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.card-header h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

/* Brand accent bar under headings */
.card-header h1::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--brand-amber);
  border-radius: 2px;
}

/* ================================
   CALCULATOR STYLES
================================ */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.form-section {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--border);
}

.form-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.form-section h3 svg {
  color: var(--accent);
}

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

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  margin-bottom: 6px;
}

.form-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text, #1f2937);
  background: var(--surface, #fff);
  border: 1px solid #dee2e6;
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  box-sizing: border-box;
}

.form-input:focus {
  border-color: var(--primary, #00205B);
  box-shadow: 0 0 0 3px rgba(0, 32, 91, 0.1);
}

.form-input[readonly] {
  background: var(--bg-secondary, #f9fafb);
  cursor: default;
}

/* ================================
   EDIT CALCULATION MODAL
================================ */
.edit-calc-card {
  width: min(460px, calc(100% - 32px));
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,0.15);
  overflow: hidden;
  animation: scaleIn 0.2s ease-out;
}

.edit-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  color: white;
}

.edit-calc-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-calc-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.edit-calc-header svg {
  color: white;
}

.edit-calc-close {
  background: none;
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.edit-calc-close:hover {
  background: rgba(255,255,255,0.15);
  opacity: 1;
}

.edit-calc-body {
  padding: 20px;
}

.edit-calc-info-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.edit-calc-info {
  flex: 1;
  background: var(--surface-alt, #f8fafc);
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border-light, #e5e7eb);
}

.edit-calc-info-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #9ca3af);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.edit-calc-info-value {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1f2937);
}

.edit-calc-fields {
  margin-bottom: 16px;
}

.edit-calc-fields .form-group {
  margin-bottom: 14px;
}

.edit-calc-fields .form-group:last-child {
  margin-bottom: 0;
}

.edit-calc-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.edit-calc-fields-row .form-group {
  margin-bottom: 0;
}

.edit-calc-preview {
  background: var(--surface-alt, #f8fafc);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
}

.edit-calc-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
}

.edit-calc-preview-row span:first-child {
  color: var(--text-muted, #6b7280);
}

.edit-calc-preview-row span:last-child {
  font-weight: 600;
  color: var(--text, #1f2937);
}

.edit-calc-preview-row.highlight {
  border-top: 1px solid var(--border-light, #e5e7eb);
  margin-top: 4px;
  padding-top: 10px;
}

.edit-calc-preview-row.highlight span:last-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary, #00205B);
}

.edit-calc-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light, #e5e7eb);
  background: var(--surface-alt, #f8fafc);
}

.edit-calc-footer .btn {
  flex: 1;
}

@media (max-width: 480px) {
  .edit-calc-info-row {
    flex-direction: column;
    gap: 8px;
  }

  .edit-calc-fields-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .edit-calc-body {
    padding: 16px;
  }

  .edit-calc-footer {
    padding: 14px 16px;
  }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Results Section */
.results-section {
  margin-bottom: 24px;
}

.results-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text);
}

.results-section h3 svg {
  color: var(--accent);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.result-card {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
}

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

.result-card.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
}

.result-card.highlight .result-label {
  color: rgba(255,255,255,0.8);
}

.result-card.highlight .result-value {
  color: white;
}

.result-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.result-icon svg {
  width: 20px;
  height: 20px;
}

.result-icon.blue { background: rgba(0, 32, 91, 0.1); color: #00205B; }
.result-icon.orange { background: rgba(217, 119, 6, 0.1); color: #D97706; }
.result-icon.green { background: rgba(70, 130, 180, 0.12); color: #4682B4; }
.result-icon.purple { background: rgba(100, 149, 237, 0.12); color: #6495ED; }
.result-icon.profit { background: rgba(255,255,255,0.2); color: white; }

.result-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.result-value.large {
  font-size: 28px;
}

.result-value.profit-high { color: var(--success); }
.result-value.profit-medium { color: var(--warning); }
.result-value.profit-low { color: var(--danger); }

/* Results List Layout */
.results-list {
  display: flex;
  flex-direction: column;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row:hover {
  background: rgba(0, 0, 0, 0.02);
}

.result-row .result-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0;
}

.result-row .result-value {
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: 16px;
}

.result-row.highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-bottom: none;
}

.result-row.highlight .result-label {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.result-row.highlight .result-value {
  color: white;
  font-size: 22px;
}

/* Calculator Disclaimer */
.calculator-disclaimer {
  margin-top: 0.75rem;
  padding: 0 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.calculator-disclaimer p + p {
  margin-top: 0.25rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
}

.btn-lg svg {
  margin-right: 8px;
}

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

.btn-outline:hover {
  background: var(--surface-alt);
  border-color: var(--text-muted);
}

/* Spinner small */
.spinner-small {
  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 1s ease-in-out infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* ================================
   HISTORY PAGE STYLES
================================ */
.history-container {
  margin-top: 20px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.loading-state .spinner {
  margin: 0 auto;
}

.loading-state p {
  margin-top: 16px;
}

/* Table Container - MasrafX Style */
.table-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: visible;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.table-responsive {
  overflow-x: hidden;
  overflow-y: visible;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  border-right: 1px solid #f1f3f5;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Remove right border on last column */
.data-table th:last-child,
.data-table td:last-child {
  border-right: none;
}

.data-table th {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #495057;
  background: #f8f9fa;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
  border-right: 1px solid #e9ecef;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  font-family: inherit;
  font-size: 14px;
  color: #495057;
  vertical-align: middle;
}

/* Responsive table header text */
.th-desktop {
  display: inline;
}

.th-mobile {
  display: none;
}

/* Desktop-only columns (hidden on mobile) */
.desktop-only {
  display: table-cell;
}

/* Table column headers - no wrap */
.data-table th {
  white-space: nowrap;
}

/* Table cells - allow text wrap for long content */
.data-table td {
  white-space: normal;
}

/* Right-aligned columns for money values */
.data-table .text-right {
  text-align: right;
}

/* Center-aligned columns */
.data-table .text-center {
  text-align: center;
}

/* Action column - minimal width */
.data-table th:last-child,
.data-table td:last-child {
  width: 60px;
  text-align: center;
}

/* ================================
   TABLE COLUMN BEHAVIOR
================================ */

/* All cells - no wrap by default */
.data-table th,
.data-table td {
  white-space: nowrap;
}

/* ================================
   ADMIN CALCULATIONS TABLE
   Tarih | Kullanıcı | Ürün | Maliyet | Satış | Adet | Kar | %
================================ */
.calc-history-table {
  table-layout: fixed;
  width: 100%;
}
.calc-history-table th:nth-child(1),
.calc-history-table td:nth-child(1) { width: 100px; } /* Tarih */
.calc-history-table th:nth-child(2),
.calc-history-table td:nth-child(2) { width: 110px; } /* Kullanıcı */
.calc-history-table th:nth-child(3),
.calc-history-table td:nth-child(3) { width: 235px; }  /* Ürün */
.calc-history-table th:nth-child(4),
.calc-history-table td:nth-child(4) { width: 85px; } /* Maliyet */
.calc-history-table th:nth-child(5),
.calc-history-table td:nth-child(5) { width: 100px; } /* Satış */
.calc-history-table th:nth-child(6),
.calc-history-table td:nth-child(6) { width: 65px; }  /* Adet */
.calc-history-table th:nth-child(7),
.calc-history-table td:nth-child(7) { width: 85px; } /* Kâr */
.calc-history-table th:nth-child(8),
.calc-history-table td:nth-child(8) { width: 83px; padding-right: 20px; } /* % */

/* Ürün column - truncate */
.calc-history-table td:nth-child(3) {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================
   USER HISTORY TABLE (app.html)
   Tarih | Ürün | Maliyet | Satış | Adet | Kar | % | İşlem
================================ */
.history-container .data-table {
  table-layout: fixed;
  width: 100%;
}
/* User View History Table - Column Widths (7 columns, no İşlem) */
#historyContainer .calc-history-table th:nth-child(1),
#historyContainer .calc-history-table td:nth-child(1) { width: 95px; }  /* Tarih */
#historyContainer .calc-history-table th:nth-child(2),
#historyContainer .calc-history-table td:nth-child(2) { width: 180px; max-width: 220px; }  /* Ürün */
#historyContainer .calc-history-table th:nth-child(3),
#historyContainer .calc-history-table td:nth-child(3) { width: 90px; }  /* Maliyet */
#historyContainer .calc-history-table th:nth-child(4),
#historyContainer .calc-history-table td:nth-child(4) { width: 90px; }  /* Satış */
#historyContainer .calc-history-table th:nth-child(5),
#historyContainer .calc-history-table td:nth-child(5) { width: 55px; }  /* Adet */
#historyContainer .calc-history-table th:nth-child(6),
#historyContainer .calc-history-table td:nth-child(6) { width: 90px; }  /* Kâr */
#historyContainer .calc-history-table th:nth-child(7),
#historyContainer .calc-history-table td:nth-child(7) { width: 60px; }  /* % */

/* Ürün column - truncate */
#historyContainer .calc-history-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================
   USER ACTIVITY TABLE
   Kullanıcı | Durum | Giriş | Hesaplama | Toplam Süre | Son Giriş | Son Çıkış
================================ */
#activitySection .data-table {
  table-layout: fixed;
  width: 100%;
}
#activitySection .data-table th,
#activitySection .data-table td {
  white-space: nowrap;
  overflow: visible;
  text-align: left;
}
#activitySection .data-table th:nth-child(1),
#activitySection .data-table td:nth-child(1) { width: 140px; } /* Kullanıcı */
#activitySection .data-table th:nth-child(2),
#activitySection .data-table td:nth-child(2) { width: 110px; } /* Durum */
#activitySection .data-table th:nth-child(3),
#activitySection .data-table td:nth-child(3) { width: 60px; }  /* Giriş */
#activitySection .data-table th:nth-child(4),
#activitySection .data-table td:nth-child(4) { width: 90px; }  /* Hesaplama */
#activitySection .data-table th:nth-child(5),
#activitySection .data-table td:nth-child(5) { width: 105px; } /* Toplam Süre */
#activitySection .data-table th:nth-child(6),
#activitySection .data-table td:nth-child(6) { width: 130px; } /* Son Giriş */
#activitySection .data-table th:nth-child(7),
#activitySection .data-table td:nth-child(7) { width: 130px; } /* Son Çıkış */

/* ================================
   USERS TABLE
   Checkbox | Kullanıcı | Rol | Durum | Aktivasyon Kodu
================================ */
#usersSection .data-table {
  table-layout: fixed;
  width: 100%;
}
#usersSection .data-table th:nth-child(1),
#usersSection .data-table td:nth-child(1) { width: 50px; }  /* Checkbox */
#usersSection .data-table th:nth-child(2),
#usersSection .data-table td:nth-child(2) { width: auto; }  /* Kullanıcı */
#usersSection .data-table th:nth-child(3),
#usersSection .data-table td:nth-child(3) { width: 110px; } /* Rol */
#usersSection .data-table th:nth-child(4),
#usersSection .data-table td:nth-child(4) { width: 110px; } /* Durum */
#usersSection .data-table th:nth-child(5),
#usersSection .data-table td:nth-child(5) { width: 180px; } /* Aktivasyon Kodu */

/* Kullanıcı column - truncate */
#usersSection .data-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Zebra striping - MasrafX Style */
.data-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.data-table tbody tr {
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.data-table tbody tr:hover {
  background-color: #e3f2fd;
  box-shadow: 0 4px 8px rgba(0,62,131,0.15);
}

.data-table tbody tr:nth-child(even):hover {
  background-color: #e3f2fd;
  box-shadow: 0 4px 8px rgba(0,62,131,0.15);
}

.date-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.date-main {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
}

.date-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.product-name {
  color: var(--text);
}

.discount-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--surface-alt);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Enhanced Profit Margin Indicator */
.profit-indicator {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 80px;
}

.profit-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.profit-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.profit-bar.high {
  background: linear-gradient(90deg, var(--success) 0%, #059669 100%);
}

.profit-bar.medium {
  background: linear-gradient(90deg, var(--warning) 0%, #d97706 100%);
}

.profit-bar.low {
  background: linear-gradient(90deg, var(--danger) 0%, #b91c1c 100%);
}

.profit-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

.profit-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profit-icon.high {
  background: #ecfdf5;
  color: var(--success);
}

.profit-icon.medium {
  background: #fffbeb;
  color: var(--warning);
}

.profit-icon.low {
  background: #fef2f2;
  color: var(--danger);
}

.profit-text.high { color: var(--success); }
.profit-text.medium { color: var(--warning); }
.profit-text.low { color: var(--danger); }

.profit-text.profit-good { color: var(--success); }
.profit-text.profit-ok { color: var(--warning); }
.profit-text.profit-low { color: var(--danger); }
.profit-text.profit-loss { color: var(--danger); }

/* Action button enhancements */
.action-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (min-width: 641px) {
  .data-table tbody tr .action-group {
    opacity: 0.5;
    transition: opacity 0.2s ease;
  }

  .data-table tbody tr:hover .action-group {
    opacity: 1;
  }
}

.btn-delete:hover svg {
  animation: trashShake 0.4s ease;
}

@keyframes trashShake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

.btn-icon {
  padding: 8px;
  min-width: auto;
}

.btn-icon svg {
  margin: 0;
}

/* Header stats (mini) */
.header-stats {
  display: flex;
  gap: 16px;
}

.mini-stat {
  text-align: center;
  background: var(--surface-alt);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.mini-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.mini-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ================================
   PROFILE PAGE STYLES
================================ */
/* Profile Hero Card */
.profile-hero-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.profile-hero-bg {
  height: 100px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.profile-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 24px 24px;
  margin-top: -40px;
  position: relative;
}

.profile-hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  border: 4px solid var(--surface);
  box-shadow: var(--shadow-md);
  margin-bottom: 12px;
}

.profile-hero-name {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.profile-hero-email {
  color: var(--text-muted);
  margin: 8px 0 0;
  font-size: 13px;
}

.profile-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Profile Forms Grid */
.profile-forms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

  .profile-hero-bg {
    height: 80px;
  }

  .profile-hero-content {
    margin-top: -32px;
    padding: 0 16px 20px;
  }

  .profile-hero-avatar {
    width: 64px;
    height: 64px;
    font-size: 22px;
  }

  .profile-hero-name {
    font-size: 18px;
  }
}

/* Legacy - keep for backward compat */
.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

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

.profile-section {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 14px;
  border: 1px solid var(--border);
}

.profile-section-header {
  grid-column: span 2;
  padding: 10px 14px;
}

@media (max-width: 768px) {
  .profile-section-header {
    grid-column: span 1;
  }
}

.profile-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.profile-section h3 svg {
  color: var(--accent);
}

/* Profile Header */
.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-section-header .profile-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-avatar-large {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-info h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.profile-email {
  color: var(--text-muted);
  margin: 0;
  font-size: 12px;
}

.profile-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-role-badge.manager {
  background: var(--primary);
  color: white;
}

.profile-role-badge.user {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Profile Details Grid */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.detail-item {
  padding: 6px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.detail-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.detail-value {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Activity Stats */
.activity-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.activity-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.activity-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: transparent;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s ease;
}

.activity-stat:hover .activity-icon {
  transform: scale(1.05);
}

/* Glow effect on hover */
.activity-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.activity-stat:hover .activity-icon::after {
  opacity: 1;
}

.activity-icon.blue::after { background: rgba(0, 32, 91, 0.12); }
.activity-icon.green::after { background: rgba(70, 130, 180, 0.12); }
.activity-icon.purple::after { background: rgba(217, 119, 6, 0.12); }

.activity-icon svg {
  width: 16px;
  height: 16px;
}

.activity-icon.blue { background: rgba(0, 32, 91, 0.1); color: #00205B; }
.activity-icon.green { background: rgba(70, 130, 180, 0.12); color: #4682B4; }
.activity-icon.purple { background: rgba(217, 119, 6, 0.1); color: #D97706; }

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

.activity-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.activity-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================
   MOBILE RESPONSIVENESS FOR APP PAGES
   (Mobile-first: base styles are mobile)
================================ */

/* Mobile sidebar open state - show all text */
.sidebar.open .sidebar-link span,
.sidebar.open .sidebar-logout span,
.sidebar.open .sidebar-user-details,
.sidebar.open .sidebar-title,
.sidebar.open .sidebar-subtitle {
  opacity: 1;
  max-height: none;
}

.sidebar.open .sidebar-logo img {
  width: 64px;
  height: 64px;
}

/* Mobile adjustments (base state) */
@media (max-width: 767px) {
  .content-card {
    padding: 16px;
    border-radius: var(--radius-sm);
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .result-value {
    font-size: 16px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
    justify-content: center;
  }

  .card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-stats {
    justify-content: center;
  }

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

  .profile-avatar-large {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }

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

  .profile-name-row {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .profile-email {
    word-break: break-all;
  }

  #profileSection .profile-section:has(.activity-stats) {
    display: none;
  }

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

  .detail-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #profileSection .profile-section form .btn {
    width: 100%;
    justify-content: center;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* Mobile table - Compact fit without scroll */
@media (max-width: 640px) {
  /* Show short column names on mobile */
  .th-desktop {
    display: none;
  }

  .th-mobile {
    display: inline;
  }

  /* Hide desktop-only columns on mobile */
  .desktop-only {
    display: none !important;
  }

  /* Reduce gap between subtitle and filter on history section */
  #historySection .section-header-with-actions {
    gap: 8px;
  }
  #historySection .section-header-with-actions .sub {
    margin-bottom: 0;
  }

  /* ================================
     MOBILE TABLE → CARD LAYOUTS
     All data tables convert to clean card lists
  ================================ */

  /* --- Base: table → card reset (all 5 tables) --- */
  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .table-responsive {
    overflow: visible;
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table {
    display: block;
    table-layout: auto;
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table thead {
    display: none;
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table tbody tr {
    display: grid;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    position: relative;
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table tbody tr:nth-child(even) {
    background: var(--surface);
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table tbody tr:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: var(--accent);
  }

  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table td {
    border: none;
    border-right: none;
    border-bottom: none;
    padding: 0;
    width: auto !important;
    max-width: none !important;
    white-space: normal;
    text-align: left;
  }

  /* Data labels via ::before pseudo-element */
  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
  }

  /* Hide labels on cells that don't need them */
  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table td[data-label=""]::before,
  :is(#historyContainer, #calculationsContainer, #activityContainer, #usersSection, #productsContainer) .data-table td:not([data-label])::before {
    display: none;
  }

  /* --------------------------------
     1. HISTORY TABLE (app.html)
     8 TDs: Tarih | Ürün | Maliyet | Satış | Adet | Kâr | % | İşlem
     Mirrors calculations table layout (minus User column)
  -------------------------------- */
  #historyContainer .data-table tbody tr {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 14px 16px;
    position: relative;
  }

  /* Date */
  #historyContainer .data-table td:nth-child(1) {
    grid-column: 1 / -1; grid-row: 1;
    padding: 0 36px 2px 0;
    font-size: 12px;
    color: var(--text-muted);
  }
  #historyContainer .data-table td:nth-child(1)::before { display: none; }
  #historyContainer .data-table td:nth-child(1) .date-cell {
    flex-direction: row; gap: 6px; align-items: center;
  }
  #historyContainer .data-table td:nth-child(1) .date-main { font-size: 12px; }
  #historyContainer .data-table td:nth-child(1) .date-time { font-size: 11px; }
  #historyContainer .data-table td:nth-child(1) .date-time::before { display: none; }

  /* Product name */
  #historyContainer .data-table td:nth-child(2) {
    grid-column: 1 / -1; grid-row: 2;
    padding: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
  }
  #historyContainer .data-table td:nth-child(2)::before { display: none; }

  /* Cost */
  #historyContainer .data-table td:nth-child(3) {
    grid-column: 1; grid-row: 3;
    padding: 0 8px 8px 0;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Sale */
  #historyContainer .data-table td:nth-child(4) {
    grid-column: 2; grid-row: 3;
    padding: 0 0 8px 8px;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Qty */
  #historyContainer .data-table td:nth-child(5) {
    grid-column: 1; grid-row: 4;
    padding: 0 8px 10px 0;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Profit */
  #historyContainer .data-table td:nth-child(6) {
    grid-column: 2; grid-row: 4;
    padding: 0 0 10px 8px;
    display: flex; flex-direction: column;
    font-weight: 700; font-size: 15px;
  }

  /* % badge */
  #historyContainer .data-table td:nth-child(7) {
    grid-column: 1 / -1; grid-row: 5;
    padding: 10px 0 0;
    border-top: 1px solid var(--border-light);
    display: flex; align-items: center;
  }
  #historyContainer .data-table td:nth-child(7)::before { display: none; }

  /* Kebab - absolute top right */
  #historyContainer .data-table td:nth-child(8),
  #historyContainer .data-table td:last-child {
    position: absolute;
    top: 10px; right: 10px;
    grid-column: unset; grid-row: unset;
  }
  #historyContainer .data-table td:nth-child(8)::before,
  #historyContainer .data-table td:last-child::before { display: none; }

  /* --------------------------------
     2. CALCULATIONS TABLE (dashboard)
     9 TDs: Tarih | Kullanıcı | Ürün | Maliyet | Satış | Adet | Kâr | % | İşlem
  -------------------------------- */
  #calculationsContainer .data-table tbody tr {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 14px 16px;
    position: relative;
  }

  /* Date */
  #calculationsContainer .data-table td:nth-child(1) {
    grid-column: 1 / -1; grid-row: 1;
    padding: 0 36px 2px 0;
    font-size: 12px;
    color: var(--text-muted);
  }
  #calculationsContainer .data-table td:nth-child(1)::before { display: none; }
  #calculationsContainer .data-table td:nth-child(1) .date-cell {
    flex-direction: row; gap: 6px; align-items: center;
  }
  #calculationsContainer .data-table td:nth-child(1) .date-main { font-size: 12px; }
  #calculationsContainer .data-table td:nth-child(1) .date-time { font-size: 11px; }
  #calculationsContainer .data-table td:nth-child(1) .date-time::before { display: none; }

  /* User name */
  #calculationsContainer .data-table td:nth-child(2) {
    grid-column: 1 / -1; grid-row: 2;
    padding: 0 0 2px;
    font-size: 12px;
    color: var(--text-muted);
  }
  #calculationsContainer .data-table td:nth-child(2)::before { display: none; }

  /* Product name */
  #calculationsContainer .data-table td:nth-child(3) {
    grid-column: 1 / -1; grid-row: 3;
    padding: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 10px;
  }
  #calculationsContainer .data-table td:nth-child(3)::before { display: none; }

  /* Cost */
  #calculationsContainer .data-table td:nth-child(4) {
    grid-column: 1; grid-row: 4;
    padding: 0 8px 8px 0;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Sale */
  #calculationsContainer .data-table td:nth-child(5) {
    grid-column: 2; grid-row: 4;
    padding: 0 0 8px 8px;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Qty */
  #calculationsContainer .data-table td:nth-child(6) {
    grid-column: 1; grid-row: 5;
    padding: 0 8px 10px 0;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }

  /* Profit */
  #calculationsContainer .data-table td:nth-child(7) {
    grid-column: 2; grid-row: 5;
    padding: 0 0 10px 8px;
    display: flex; flex-direction: column;
    font-weight: 700; font-size: 15px;
  }

  /* % badge */
  #calculationsContainer .data-table td:nth-child(8) {
    grid-column: 1 / -1; grid-row: 6;
    padding: 10px 0 0;
    border-top: 1px solid var(--border-light);
    display: flex; align-items: center;
  }
  #calculationsContainer .data-table td:nth-child(8)::before { display: none; }

  /* Kebab - absolute top right */
  #calculationsContainer .data-table td:nth-child(9),
  #calculationsContainer .data-table td:last-child {
    position: absolute;
    top: 10px; right: 10px;
    grid-column: unset; grid-row: unset;
  }
  #calculationsContainer .data-table td:nth-child(9)::before,
  #calculationsContainer .data-table td:last-child::before { display: none; }

  /* --------------------------------
     3. ACTIVITY TABLE (dashboard)
     7 TDs: Kullanıcı | Durum | Giriş | Hesaplama | Süre | Son Aktivite | Son Çıkış
  -------------------------------- */
  #activityContainer .data-table tbody tr {
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 14px 16px;
  }

  /* User name */
  #activityContainer .data-table td:nth-child(1) {
    grid-column: 1; grid-row: 1;
    padding: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
  }
  #activityContainer .data-table td:nth-child(1)::before { display: none; }

  /* Status badge */
  #activityContainer .data-table td:nth-child(2) {
    grid-column: 2; grid-row: 1;
    padding: 0 0 8px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  #activityContainer .data-table td:nth-child(2)::before { display: none; }

  /* Stats: Giriş | Hesaplama */
  #activityContainer .data-table td:nth-child(3) {
    grid-column: 1; grid-row: 2;
    padding: 10px 8px 8px 0;
    border-top: 1px solid var(--border-light);
    display: flex; flex-direction: column;
    font-weight: 700; font-size: 15px;
  }
  #activityContainer .data-table td:nth-child(4) {
    grid-column: 2; grid-row: 2;
    padding: 10px 0 8px 8px;
    border-top: 1px solid var(--border-light);
    display: flex; flex-direction: column;
    font-weight: 700; font-size: 15px;
  }

  /* Stats: Süre | Son Aktivite */
  #activityContainer .data-table td:nth-child(5) {
    grid-column: 1; grid-row: 3;
    padding: 0 8px 8px 0;
    display: flex; flex-direction: column;
    font-weight: 600; font-size: 14px;
  }
  #activityContainer .data-table td:nth-child(6) {
    grid-column: 2; grid-row: 3;
    padding: 0 0 8px 8px;
    display: flex; flex-direction: column;
    align-items: flex-start;
    font-size: 13px;
    color: var(--text-muted);
  }
  #activityContainer .data-table td:nth-child(6) .last-activity-cell {
    display: flex; gap: 6px; align-items: center;
  }
  #activityContainer .data-table td:nth-child(6) .activity-exact-time {
    display: none;
  }

  /* Son Çıkış */
  #activityContainer .data-table td:nth-child(7) {
    grid-column: 1 / -1; grid-row: 4;
    padding: 8px 0 0;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-light);
  }
  #activityContainer .data-table td:nth-child(7) .date-cell {
    flex-direction: row; gap: 6px; align-items: center;
  }
  #activityContainer .data-table td:nth-child(7) .date-time::before {
    display: none;
  }

  /* --------------------------------
     4. USERS TABLE (dashboard)
     6 TDs: Checkbox | Kullanıcı | Rol | Durum | Kod | Eylemler

     Mobile card:
     ┌──────────────────────────────────┐
     │  Name                            │
     │  email@company.com               │
     │  [Rol] [Durum]                   │
     ├──────────────────────────────────┤
     │ [✓]  Kod: ABC123 [📋]    [Btn] │
     └──────────────────────────────────┘
  -------------------------------- */

  /* Override ALL desktop/generic rules for users table */
  #usersSection .data-table.data-table-enhanced td:nth-child(1),
  #usersSection .data-table.data-table-enhanced td:nth-child(2),
  #usersSection .data-table.data-table-enhanced td:nth-child(3),
  #usersSection .data-table.data-table-enhanced td:nth-child(4),
  #usersSection .data-table.data-table-enhanced td:nth-child(5),
  #usersSection .data-table.data-table-enhanced td:nth-child(6) {
    width: auto !important;
    overflow: visible !important;
    text-overflow: unset !important;
    min-width: 0 !important;
    max-width: none !important;
    justify-content: flex-start !important;
    border: none !important;
    margin: 0 !important;
  }

  #usersSection .data-table.data-table-enhanced tbody tr {
    display: grid !important;
    grid-template-columns: auto auto 1fr;
    grid-template-rows: auto auto auto;
    padding: 0;
    gap: 0;
  }

  #usersSection .data-table.data-table-enhanced td::before { display: none !important; }

  /* Checkbox — same line as name, top-right */
  #usersSection .data-table.data-table-enhanced td:nth-child(1) {
    position: absolute !important;
    top: 9px;
    right: 10px;
    padding: 0 !important;
    z-index: 1;
  }

  /* Row 1: User name + email — compact */
  #usersSection .data-table.data-table-enhanced td:nth-child(2) {
    grid-column: 1 / -1; grid-row: 1;
    padding: 8px 36px 8px 12px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    border-bottom: none !important;
    margin-bottom: 0 !important;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(2) .user-cell {
    display: flex; align-items: flex-start; gap: 0;
    flex-direction: column;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(2) .user-avatar {
    display: none;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(2) .user-name {
    font-weight: 600; font-size: 15px;
    white-space: normal !important; overflow: visible !important;
    text-overflow: unset !important;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(2) .user-email {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 100%;
  }

  /* Row 2: [Role] [Status] ... [Action btn] — with top border separator */
  #usersSection .data-table.data-table-enhanced td:nth-child(3) {
    grid-column: 1; grid-row: 2;
    padding: 10px 4px 10px 12px !important;
    display: flex !important; align-items: center;
    border-top: 1px solid var(--border-light) !important;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(4) {
    grid-column: 2; grid-row: 2;
    padding: 10px 4px 10px 0 !important;
    display: flex !important; align-items: center;
    border-top: 1px solid var(--border-light) !important;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(6),
  #usersSection .data-table.data-table-enhanced td:last-child {
    grid-column: 3; grid-row: 2;
    padding: 10px 12px 10px 0 !important;
    display: flex !important; align-items: center; justify-content: flex-end !important;
    border-top: 1px solid var(--border-light) !important;
    margin-top: 0 !important;
  }

  /* Uniform pill size: role, status, action btn */
  #usersSection .data-table.data-table-enhanced td:nth-child(3) .role-badge,
  #usersSection .data-table.data-table-enhanced td:nth-child(4) .status-badge,
  #usersSection .data-table.data-table-enhanced td:nth-child(6) .btn,
  #usersSection .data-table.data-table-enhanced td:last-child .btn {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    min-height: 0;
    line-height: 1.3;
  }
  #usersSection .data-table.data-table-enhanced td:nth-child(6) .btn svg,
  #usersSection .data-table.data-table-enhanced td:last-child .btn svg {
    width: 12px; height: 12px;
  }

  /* Row 3: Code — full width */
  #usersSection .data-table.data-table-enhanced td:nth-child(5) {
    grid-column: 1 / -1; grid-row: 3;
    padding: 10px 14px !important;
    border-top: 1px solid var(--border-light) !important;
    font-size: 12px;
    display: flex !important; align-items: center;
  }

  /* Hide code row for activated users */
  #usersSection .data-table.data-table-enhanced tbody tr[data-is-activated="true"] td:nth-child(5) {
    display: none !important;
  }

  /* --------------------------------
     5. PRODUCTS TABLE (dashboard)
     5 TDs: Ürün Adı | Fiyat | Hacim | Durum | İşlemler
  -------------------------------- */
  #productsContainer .data-table tbody tr {
    grid-template-columns: 1fr 1fr auto;
    gap: 0;
  }

  /* Product name */
  #productsContainer .data-table td:nth-child(1) {
    grid-column: 1 / 3; grid-row: 1;
    padding: 12px 0 8px 16px;
    font-size: 15px;
    font-weight: 600;
  }
  #productsContainer .data-table td:nth-child(1)::before { display: none; }

  /* Kebab */
  #productsContainer .data-table td:nth-child(5),
  #productsContainer .data-table td:last-child {
    grid-column: 3; grid-row: 1;
    padding: 2px 8px 0 0;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
  }
  #productsContainer .data-table td:nth-child(5)::before,
  #productsContainer .data-table td:last-child::before { display: none; }

  #productsContainer .kebab-btn {
    width: 26px;
    height: 26px;
    min-height: 26px;
    min-width: 28px;
    border-radius: 6px;
  }
  #productsContainer .kebab-btn svg {
    width: 14px;
    height: 14px;
  }

  /* Price | Volume | Status */
  #productsContainer .data-table td:nth-child(2) {
    grid-column: 1; grid-row: 2;
    padding: 8px 8px 12px 16px;
    border-top: 1px solid var(--border-light);
    font-weight: 600; font-size: 14px;
  }
  #productsContainer .data-table td:nth-child(3) {
    grid-column: 2; grid-row: 2;
    padding: 8px 8px 12px;
    border-top: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-muted);
  }
  #productsContainer .data-table td:nth-child(4) {
    grid-column: 3; grid-row: 2;
    padding: 8px 16px 12px 0;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }
  #productsContainer .data-table td:nth-child(4)::before { display: none; }
}

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

  .result-row {
    padding: 12px 14px;
  }

  .result-row .result-value {
    font-size: 15px;
  }

  .result-row.highlight .result-value {
    font-size: 18px;
  }

  .activity-stat {
    flex-direction: column;
    text-align: center;
  }

  .mini-stat {
    padding: 10px 16px;
  }

  .mini-stat-value {
    font-size: 20px;
  }
}

/* Dashboard Mobile Enhancements */
@media (max-width: 640px) {
  .section-header {
    padding: 0 4px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .section-header .sub {
    font-size: 13px;
  }

  /* Table card on mobile - keep background for Excel look */
  .table-card {
    padding: 0;
    border-radius: var(--radius-sm);
    overflow: visible;
  }

  /* Date cell compact on mobile - stack vertically */
  .date-cell {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .date-main {
    font-size: 12px;
  }

  .date-time {
    font-size: 11px;
  }

  .date-time::before {
    display: none;
  }

  /* Badges smaller on mobile */
  .badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Action buttons */
  .btn-sm {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* Very small screens (320px) */
@media (max-width: 360px) {
  .main-content {
    padding: 64px 8px 16px;
  }

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

  .stat-card {
    padding: 10px 8px;
  }

  .stat-card .stat-value {
    font-size: 18px;
  }

  .stat-card .stat-label {
    font-size: 9px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
    border-radius: 6px;
  }

  .stat-icon svg {
    width: 14px;
    height: 14px;
  }

  .chart-container {
    height: 160px;
  }

  .chart-container-popular-products {
    height: 190px;
  }

  .chart-container-donut {
    height: 160px;
  }

  .dashboard-section {
    padding: 10px;
    margin-bottom: 10px;
  }

  .section-header h2 {
    font-size: 15px;
  }
}

/* =====================================================
   Section-Specific Stat Card Overrides
   (Placed AFTER generic media queries so cascade works)
===================================================== */

/* User View (app.html) - Horizontal stat cards */
#homeSection .stats-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

#homeSection .stat-card {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#homeSection .stat-card .stat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  margin-bottom: 0;
}

#homeSection .stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

#homeSection .stat-card .stat-content {
  flex: 1;
  min-width: 0;
}

#homeSection .stat-card .stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

#homeSection .stat-card .stat-label {
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Highlight card */
#homeSection .stat-card.highlight .stat-value {
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#homeSection .stat-card.highlight .stat-label {
  color: rgba(255,255,255,0.95);
}

@media (max-width: 900px) {
  #homeSection .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Dashboard Stats - Compact horizontal cards */
#overviewSection .stats-grid,
.activity-stats-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

#overviewSection .stats-grid .stat-card,
.activity-stats-grid .stat-card {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#overviewSection .stats-grid .stat-card .stat-icon,
.activity-stats-grid .stat-card .stat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  margin-bottom: 0;
}

#overviewSection .stats-grid .stat-card .stat-icon svg,
.activity-stats-grid .stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

#overviewSection .stats-grid .stat-card .stat-content,
.activity-stats-grid .stat-card .stat-content {
  flex: 1;
  min-width: 0;
}

#overviewSection .stats-grid .stat-card .stat-value,
.activity-stats-grid .stat-card .stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

#overviewSection .stats-grid .stat-card .stat-label,
.activity-stats-grid .stat-card .stat-label {
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  color: var(--text-muted);
}

/* Dashboard highlight card */
#overviewSection .stats-grid .stat-card.highlight .stat-value {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  #overviewSection .stats-grid,
  .activity-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  #overviewSection .stats-grid,
  .activity-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================
   Calculation Detail Modal
===================================================== */
/* Modal Overlay - Shared */
.modal-overlay,
#calcDetailModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 32, 91, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.calc-detail-modal {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-detail-card {
  width: min(500px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: scaleIn 0.25s ease-out;
}

.calc-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary);
  color: white;
}

.calc-detail-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.calc-detail-header .close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.calc-detail-header .close-btn:hover {
  background: rgba(255,255,255,0.3);
}

.calc-detail-content {
  padding: 20px;
  max-height: calc(90vh - 60px);
  overflow-y: auto;
}

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

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.detail-row span:first-child {
  color: var(--text-light);
}

.detail-row span:last-child {
  font-weight: 500;
  color: var(--text);
}

.detail-row.highlight {
  background: var(--surface-alt);
  margin: 8px -20px 0;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
}

.detail-row.highlight span:last-child {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* History Detail Modal - Hero & Content */
.calc-detail-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1e3a8a 100%);
  color: white;
  padding: 20px;
  margin: -20px -20px 20px -20px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.calc-detail-hero h4 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
}

.calc-detail-hero .calc-date {
  font-size: 13px;
  opacity: 0.8;
}

.calc-profit-summary {
  text-align: center;
  padding: 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.calc-profit-summary.high {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
}

.calc-profit-summary.medium {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid #f59e0b;
}

.calc-profit-summary.low {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
}

.calc-profit-summary .profit-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.calc-profit-summary .profit-margin {
  font-size: 14px;
  color: var(--text-muted);
}

.calc-profit-summary.high .profit-value { color: #059669; }
.calc-profit-summary.medium .profit-value { color: #d97706; }
.calc-profit-summary.low .profit-value { color: #dc2626; }

.calc-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.calc-detail-grid .detail-card {
  background: var(--surface-alt);
  padding: 16px;
  border-radius: var(--radius-sm);
}

.calc-detail-grid .detail-card h5 {
  margin: 0 0 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-detail-grid .detail-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.calc-detail-grid .detail-row:last-child {
  border-bottom: none;
}

.calc-detail-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.calc-detail-actions .btn {
  gap: 8px;
}

@media (max-width: 500px) {
  .calc-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Confirmation Modal */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1100;
  animation: fadeIn 0.2s ease-out;
}

.confirm-modal-overlay.open {
  display: flex;
}

.confirm-modal {
  width: min(380px, 100%);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0,0,0,0.15);
  padding: 28px;
  text-align: center;
  animation: scaleIn 0.2s ease-out;
  overflow: hidden;
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.confirm-modal-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-modal h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.confirm-modal p {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.confirm-modal-actions .btn {
  flex: 1;
  white-space: nowrap;
}

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

.btn-danger:hover {
  background: #dc2626;
}

/* Checkbox Styles */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-1px);
}

.checkbox-wrapper:hover .checkbox-custom {
  border-color: var(--accent);
}

/* Bulk Action Bar */
.bulk-action-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.08) 100%);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  gap: 16px;
}

.bulk-action-bar.show {
  display: flex;
}

.bulk-action-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bulk-count {
  font-size: 14px;
  color: var(--text);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.btn-link:hover {
  color: #2563eb;
}

.bulk-action-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-warning-outline {
  background: transparent;
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.btn-warning-outline:hover {
  background: rgba(245, 158, 11, 0.1);
}

.btn-success-outline {
  background: transparent;
  border: 1px solid #22c55e;
  color: #22c55e;
}

.btn-success-outline:hover {
  background: rgba(34, 197, 94, 0.1);
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  gap: 4px;
}

.btn-xs svg {
  width: 14px;
  height: 14px;
}

.td-actions {
  white-space: nowrap;
}

.td-actions .btn-text-desktop {
  display: none;
}

@media (min-width: 768px) {
  .td-actions .btn-text-desktop {
    display: inline;
  }
}

/* Selectable table - override generic data-table column rules */
.data-table-selectable {
  table-layout: auto;
}

.data-table-selectable th,
.data-table-selectable td {
  width: auto !important;
  text-align: left !important;
}

.data-table-selectable tbody tr.selected {
  background: rgba(59, 130, 246, 0.06);
}

/* Checkbox column - keep small */
.data-table-selectable .th-checkbox,
.data-table-selectable .td-checkbox {
  width: 40px !important;
  min-width: 40px;
  max-width: 40px;
  padding: 8px !important;
  text-align: center !important;
}

/* Users table column widths - Kullanıcı wider, Aktivasyon Kodu narrower */
#usersSection .data-table-selectable th:nth-child(2),
#usersSection .data-table-selectable td:nth-child(2) {
  width: 25% !important;
  min-width: 180px;
}

#usersSection .data-table-selectable th:nth-child(5),
#usersSection .data-table-selectable td:nth-child(5) {
  width: 140px !important;
  max-width: 160px;
}

/* Profit Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge.profit-good {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge.profit-ok {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge.profit-low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Clickable Table Row */
.clickable-row {
  cursor: pointer;
  transition: background var(--transition);
}

.clickable-row:hover {
  background: var(--surface-alt);
}

/* Deleted row visual cue for history */
.deleted-row-subtle {
  opacity: 1;
  cursor: default;
}

.deleted-row-subtle:hover {
  opacity: 1;
  background: var(--surface-alt);
}

.deleted-row-subtle .product-name {
  text-decoration: line-through;
  text-decoration-color: var(--text-light);
}

/* Product inactive row - light amber background */
.data-table tr.product-inactive {
  background: #fffbeb;
}

.data-table tr.product-inactive:hover {
  background: #fef3c7;
}

/* ================================
   CALCULATIONS HISTORY PAGE
================================ */

/* Mini Stat Cards Row */
.calc-history-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

/* User view history stats - same 4 columns as dashboard */

.mini-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.mini-stat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-stat-icon.blue {
  background: rgba(0, 32, 91, 0.1);
  color: #00205B;
}

.mini-stat-icon.green {
  background: rgba(70, 130, 180, 0.12);
  color: #4682B4;
}

.icon-tl {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.mini-stat-icon.purple {
  background: rgba(100, 149, 237, 0.12);
  color: #6495ED;
}

.mini-stat-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.mini-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

.mini-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
}

/* Section Icon Purple Variant */
.section-icon-purple {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

/* Calculation History Table Specific Styles */
.calc-history-table th,
.calc-history-table td {
  text-align: left;
}

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

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

/* Date Cell Compact */
.date-cell-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.date-day {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.date-cell-compact .date-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* User Cell Compact */
.user-cell-compact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-name-sm {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Product Name */
.product-name {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Money Value */
.money-value {
  font-family: 'Inter', system-ui, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.money-value.profit-good { color: var(--success); }
.money-value.profit-ok { color: var(--warning); }
.money-value.profit-low { color: var(--danger); }
.money-value.profit-loss { color: var(--danger); }

/* Profit Badge */
.profit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.profit-badge.profit-good {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.profit-badge.profit-ok {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}

.profit-badge.profit-low {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.profit-badge.profit-loss {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* Tablet responsive for calc history */
@media (max-width: 900px) {
  .calc-history-stats,
  #historyStatsGrid.calc-history-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .calc-history-stats .mini-stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  /* Products stats: reorder to [Aktif][Pasif] then [Toplam] */
  #productsStatsGrid .mini-stat-card:nth-child(1) { order: 2; grid-column: 1 / -1; }
  #productsStatsGrid .mini-stat-card:nth-child(2) { order: 0; grid-column: auto; }
  #productsStatsGrid .mini-stat-card:nth-child(3) { order: 1; grid-column: auto; }
  #productsStatsGrid .mini-stat-card:last-child:nth-child(odd) { grid-column: auto; }
}

/* Mobile responsive for calc history */
@media (max-width: 560px) {
  .calc-history-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .mini-stat-card {
    padding: 10px 12px;
  }

  .calc-history-table th,
  .calc-history-table td {
    width: auto !important;
  }
}

/* ================================
   PAGINATION
================================ */

.pagination-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 16px;
}

.pagination-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pagination-limit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-limit label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-limit select {
  padding: 6px 32px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background-color: var(--surface);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.pagination-limit select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.pagination-right {
  display: flex;
  align-items: center;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.pagination-page:hover {
  background: var(--surface-alt);
  border-color: var(--text-light);
}

.pagination-page.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pagination-page.active:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.pagination-ellipsis {
  padding: 0 8px;
  font-size: 14px;
  color: var(--text-muted);
}

/* ================================
   CUSTOM DROPDOWN COMPONENT
================================ */

/* Base custom select styling */
.custom-select,
.pagination-select {
  position: relative;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 80px;
}

.custom-select:hover,
.pagination-select:hover {
  border-color: var(--text-light);
  background-color: var(--surface-alt);
}

.custom-select:focus,
.pagination-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Style the options when dropdown is open (limited browser support) */
.custom-select option,
.pagination-select option {
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}

/* Filter Group */
.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Compact filter group for history sections */
.filter-group-compact {
  gap: 8px;
  flex-wrap: nowrap;
}

.filter-group-compact .custom-select,
.filter-group-compact .cs-wrapper {
  min-width: 200px;
  flex: 1 1 0;
}

/* Compact clear button (icon only) */
.btn-filter-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.btn-filter-clear:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #dc2626;
}

/* Active Filter Chips */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-bottom: 16px;
}

.active-filters:empty {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #1d4ed8;
  line-height: 1.3;
}

.filter-chip-label {
  color: #64748b;
  font-weight: 400;
}

.filter-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(29, 78, 216, 0.15);
  color: #1d4ed8;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}

.filter-chip-remove:hover {
  background: rgba(220, 38, 38, 0.15);
  color: #dc2626;
}

.filter-chip-remove svg {
  width: 10px;
  height: 10px;
}

.filter-dropdown {
  min-width: 160px;
}

.filter-dropdown .dropdown-trigger {
  min-width: 160px;
}

.filter-select {
  position: relative;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.15s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 140px;
  max-width: 180px;
}

.filter-select:hover {
  border-color: var(--text-light);
  background-color: var(--surface-alt);
}

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

.filter-select option {
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
}

/* Custom Dropdown (JavaScript-powered) */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.dropdown-trigger:hover {
  border-color: var(--text-light);
  background: var(--surface-alt);
}

.dropdown-trigger.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.dropdown-trigger-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.dropdown-trigger.active .dropdown-trigger-icon {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu-inner {
  padding: 6px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.1s ease;
}

.dropdown-item:hover {
  background: var(--surface-alt);
}

.dropdown-item.selected {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
  font-weight: 500;
}

.dropdown-item-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.dropdown-item.selected .dropdown-item-icon {
  color: var(--accent);
}

.dropdown-item-check {
  width: 16px;
  height: 16px;
  margin-left: auto;
  opacity: 0;
  color: var(--accent);
}

.dropdown-item.selected .dropdown-item-check {
  opacity: 1;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.dropdown-header {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Dropdown with search */
.dropdown-search {
  padding: 8px;
  border-bottom: 1px solid var(--border-light);
}

.dropdown-search input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface-alt);
  color: var(--text);
}

.dropdown-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.dropdown-search input::placeholder {
  color: var(--text-light);
}

/* Empty state */
.dropdown-empty {
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Mobile pagination */
@media (max-width: 640px) {
  .pagination-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px;
  }

  .pagination-left {
    justify-content: space-between;
    width: 100%;
  }

  .pagination-right {
    justify-content: center;
    width: 100%;
  }

  .pagination-controls {
    justify-content: center;
    flex-wrap: wrap;
  }

  .pagination-pages {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Old mobile table overrides removed - now handled in unified card layout at 640px */

/* ================================
   BRAND PERSONALITY TOUCHES
================================ */

/* Sidebar active indicator - amber accent */
.sidebar-link {
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--brand-amber);
  border-radius: 0 2px 2px 0;
  transition: transform 0.2s ease;
}

.sidebar-link:hover::before,
.sidebar-link.active::before {
  transform: translateY(-50%) scaleY(1);
}

/* Result card amber accent for top performers */
.result-icon.amber {
  background: rgba(217, 119, 6, 0.12);
  color: var(--brand-amber);
}

/* Profit indicator with bar */
.result-value.profit-high {
  position: relative;
  padding-left: 12px;
}

.result-value.profit-high::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: var(--success);
  border-radius: 2px;
}

/* ================================
   MICRO-INTERACTIONS
   Human-feeling animations
================================ */

/* Staggered entrance for stat cards */
.stats-grid .stat-card {
  opacity: 0;
  animation: fadeSlideUp 0.4s ease forwards;
}

.stats-grid .stat-card:nth-child(1) { animation-delay: 0.05s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: 0.1s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: 0.15s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: 0.2s; }
.stats-grid .stat-card:nth-child(5) { animation-delay: 0.25s; }
.stats-grid .stat-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered entrance for result rows */
.results-list .result-row {
  opacity: 0;
  animation: fadeSlideUp 0.35s ease forwards;
}

.results-list .result-row:nth-child(1) { animation-delay: 0.05s; }
.results-list .result-row:nth-child(2) { animation-delay: 0.1s; }
.results-list .result-row:nth-child(3) { animation-delay: 0.15s; }
.results-list .result-row:nth-child(4) { animation-delay: 0.2s; }
.results-list .result-row:nth-child(5) { animation-delay: 0.25s; }

/* Input focus pulse animation */
@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
  50% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15); }
}

.input:focus-within {
  animation: focusPulse 2s ease infinite;
}

/* Card hover lift effect */
.stat-card,
.result-card,
.chart-card,
.profile-section,
.activity-stat {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.result-card:hover,
.chart-card:hover,
.activity-stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

/* Button press feedback */
button:active,
.btn:active {
  transform: scale(0.98);
}

/* Smooth number transitions for stat values */
.stat-value,
.result-value {
  transition: transform 0.3s var(--transition-bounce);
}

.stat-value.updating,
.result-value.updating {
  transform: scale(1.05);
}

/* ================================
   PAGE NAVIGATION ANIMATIONS
================================ */

/* Page fade in on load */
.app-layout,
.dashboard-layout,
.page-center {
  animation: pageFadeIn 0.4s ease-out;
}

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

/* Sidebar link click feedback */
.sidebar-link {
  transition: all 0.15s ease, transform 0.1s ease;
}

.sidebar-link:active {
  transform: scale(0.96);
}

/* Page exit animation class - add via JS before navigation */
.page-exit {
  animation: pageExit 0.2s ease-out forwards;
}

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

/* Content area entrance */
.content-card,
.dashboard-section {
  animation: contentSlideIn 0.4s ease-out;
}

@keyframes contentSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================
   ENHANCED UI COMPONENTS
   Users & Add User Pages Redesign
================================ */

/* Enhanced Section Header */
.section-header-enhanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
  margin: -24px -24px 24px -24px;
  padding: 24px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius) var(--radius) 0 0;
}

.section-header-content {
  display: flex;
  align-items: center;
}

.section-icon-badge {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
}

.section-icon-badge svg {
  width: 24px;
  height: 24px;
}

.section-icon-badge-amber {
  background: linear-gradient(135deg, var(--brand-amber) 0%, #b45309 100%);
}

.section-title-group {
  display: flex;
  align-items: center;
}

.section-title-group h2 {
  margin-bottom: 2px;
}

.section-title-group h2 svg {
  display: none;
}

.section-header-actions {
  display: flex;
  gap: 12px;
}

/* Users Toolbar */
/* History toolbar (app.html) */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  gap: 10px;
  min-width: 260px;
  transition: all 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-light);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  width: 100%;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--text-light);
}

.filter-chips {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--text-light);
  color: var(--text);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Filter Separator */
.filter-separator {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* Toolbar Actions */
.toolbar-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* Download Dropdown */
.dropdown-wrapper {
  position: relative;
}

.dropdown-wrapper .btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dropdown-wrapper .dropdown-arrow {
  transition: transform 0.2s ease;
}

.dropdown-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  min-width: 170px;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  padding: 4px;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  border-radius: 12px;
}

.dropdown-item:hover {
  background: var(--surface-alt);
  color: var(--primary);
}

.dropdown-item:hover svg {
  color: var(--primary);
}

.dropdown-item:first-child {
  border-radius: 12px;
}

.dropdown-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 6px 0;
}

.dropdown-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-light);
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.dropdown-info svg {
  flex-shrink: 0;
}

/* Enhanced Stats Grid for Users */
.users-stats-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.users-stats-grid-enhanced .stat-card {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-stats-grid-enhanced .stat-card .stat-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  margin-bottom: 0;
}

.users-stats-grid-enhanced .stat-card .stat-icon svg {
  width: 18px;
  height: 18px;
}

.users-stats-grid-enhanced .stat-card .stat-content {
  flex: 1;
  min-width: 0;
}

.users-stats-grid-enhanced .stat-card .stat-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.users-stats-grid-enhanced .stat-card .stat-label {
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .users-stats-grid-enhanced {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Featured Stat Card */
.stat-card-featured {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .stat-card-featured {
    grid-column: span 1;
    grid-row: span 1;
  }
}

.stat-card-featured::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 160px;
  height: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.stat-card-featured .stat-icon {
  background: rgba(255,255,255,0.2);
  color: white;
}

.stat-card-featured .stat-value {
  font-size: 28px;
  color: white;
}

.stat-card-featured .stat-label {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
}

/* Stat Trend Indicator */
.stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-muted);
}

.stat-trend.positive {
  color: #a7f3d0;
}

.stat-trend svg {
  width: 14px;
  height: 14px;
}

/* Amber accent card */
.stat-card-amber {
  border-left: 4px solid var(--brand-amber);
}

.stat-card-amber .stat-icon {
  background: rgba(217, 119, 6, 0.12);
  color: var(--brand-amber);
}

/* Success accent card */
.stat-card-success .stat-icon {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

/* Enhanced Table Card */
.table-card-enhanced {
  border: none;
  box-shadow: var(--shadow-card);
  overflow: visible;
  border-radius: var(--radius-card);
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}

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

.table-count strong {
  color: var(--text);
  font-weight: 600;
}

/* Enhanced Data Table */
.data-table-enhanced th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  color: var(--text-muted);
  font-weight: 600;
}

.data-table-enhanced td {
  padding: 16px;
  vertical-align: middle;
}

.data-table-enhanced tbody tr {
  transition: background 0.15s ease;
}

.data-table-enhanced tbody tr:hover {
  background: var(--surface-alt);
}


/* User Cell with Avatar */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #2563eb 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.user-name,
.user-email {
  text-align: left;
  width: 100%;
}

.user-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Role Badges */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.role-manager {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.role-user {
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

/* Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-active .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-pending .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-pending .status-dot {
  animation: statusPulse 2s ease infinite;
}

/* Activation Code */
.activation-code {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
  font-size: 13px;
  background: var(--surface-alt);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  color: var(--text);
  letter-spacing: 0.05em;
}

.code-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn-small {
  padding: 6px;
  background: transparent;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copy-btn-small:hover {
  background: var(--surface-alt);
  color: var(--accent);
}

.copy-btn-small.copied {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.copy-btn-small svg {
  width: 16px;
  height: 16px;
}

/* Action Group */
.action-group {
  display: flex;
  gap: 6px;
}

.btn-icon-small {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-icon-small svg {
  width: 14px;
  height: 14px;
}

.btn-icon-small:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.btn-danger-ghost:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(220, 38, 38, 0.05);
}

/* ================================
   ADD USER PAGE LAYOUT
================================ */

.add-user-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 900px) {
  .add-user-layout {
    grid-template-columns: 1fr 340px;
    gap: 32px;
  }
}

/* Add User Mode Tabs */
.add-user-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.add-user-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: 24px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-user-tab:hover {
  border-color: var(--text-light);
  color: var(--text);
  transform: translateY(-1px);
}

.add-user-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 32, 91, 0.2);
}

.add-user-tab.active svg {
  stroke: white;
}

.add-user-tab svg {
  flex-shrink: 0;
  transition: stroke 0.2s ease;
}

/* Bulk Add Textarea */
.bulk-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
  transition: var(--transition);
}

.bulk-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bulk-textarea::placeholder {
  color: var(--text-light);
}

/* Bulk Results */
.bulk-results {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.bulk-results h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text);
}

.bulk-result-section {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
}

.bulk-result-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.bulk-result-failed {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.bulk-result-section h5 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px 0;
}

.bulk-result-success h5 {
  color: var(--success);
}

.bulk-result-failed h5 {
  color: var(--danger);
}

.bulk-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulk-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-input);
  font-size: 13px;
}

.bulk-result-item-failed {
  background: rgba(255,255,255,0.7);
}

.bulk-result-email {
  font-weight: 500;
  color: var(--text);
  min-width: 180px;
}

.bulk-result-name {
  color: var(--text-muted);
  flex: 1;
}

.bulk-result-role {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.bulk-result-role.role-manager {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
}

.bulk-result-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  padding: 4px 8px;
  background: var(--primary);
  color: white;
  border-radius: 4px;
}

.bulk-result-reason {
  color: var(--danger);
  font-size: 12px;
}

@media (max-width: 640px) {
  .add-user-tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .add-user-tab {
    flex-shrink: 0;
    padding: 10px 18px;
    font-size: 13px;
  }

  .bulk-result-item {
    flex-wrap: wrap;
  }

  .bulk-result-email {
    min-width: 100%;
  }
}

/* File Upload Zone */
.file-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
  transition: var(--transition);
}

.file-upload-zone:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.03);
}

.file-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
  border-style: solid;
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  color: var(--accent);
}

.file-upload-icon svg {
  width: 24px;
  height: 24px;
}

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

.file-upload-text strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}

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

.file-upload-formats {
  font-size: 12px;
  color: var(--text-light);
  padding: 6px 12px;
  background: var(--surface);
  border-radius: 16px;
}

.file-upload-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-start;
}

.file-upload-actions .btn {
  gap: 6px;
}

/* Optional Tag */
.optional-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  background: var(--surface-alt);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
}

/* Bulk Divider */
.bulk-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.bulk-divider::before,
.bulk-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.bulk-divider span {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* File Upload Status */
.file-upload-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-input);
  margin-top: 12px;
}

.file-upload-status svg {
  width: 18px;
  height: 18px;
  color: var(--success);
  flex-shrink: 0;
}

.file-upload-status-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.file-upload-status-text strong {
  display: block;
  margin-bottom: 2px;
}

.file-upload-status-text span {
  color: var(--text-muted);
  font-size: 12px;
}

.file-upload-status .btn-remove {
  padding: 4px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: var(--transition);
}

.file-upload-status .btn-remove:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--danger);
}

@media (max-width: 640px) {
  .file-upload-zone {
    padding: 24px 16px;
  }
}

/* Form Column */
.add-user-form-column {
  max-width: 100%;
}

.form-section-elevated {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}

.form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

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

.form-section-header h3 svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.form-step {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 500;
}

/* Enhanced Form Group */
.form-group-enhanced {
  margin-bottom: 24px;
}

.form-group-enhanced label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.required-star {
  color: var(--danger);
  margin-left: 2px;
}

.input-helper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 8px;
}

.input-helper svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.input-icon {
  display: flex;
  align-items: center;
  color: var(--text-light);
}

.input-icon svg {
  width: 18px;
  height: 18px;
}

/* Role Selector Cards */
.role-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.role-option {
  cursor: pointer;
}

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.role-option:hover .role-card {
  border-color: var(--text-light);
}

.role-option input:checked + .role-card {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.04);
}

.role-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.role-icon svg {
  width: 24px;
  height: 24px;
}

.role-icon-manager {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
}

.role-info {
  flex: 1;
}

.role-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 2px;
}

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

.role-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.role-check svg {
  width: 14px;
  height: 14px;
}

.role-option input:checked + .role-card .role-check {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.role-option input:checked + .role-card .role-icon:not(.role-icon-manager) {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

/* Info Sidebar */
.add-user-info-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.info-card-subtle {
  background: var(--surface-alt);
  border-color: var(--border-light);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}

.info-card-header svg {
  width: 18px;
  height: 18px;
  color: var(--brand-amber);
}

.info-card-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.info-card-body {
  padding: 16px 20px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.info-list li:first-child {
  padding-top: 0;
}

.info-list li:last-child {
  padding-bottom: 0;
}

.info-list li svg {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Permission Groups */
.permission-group {
  margin-bottom: 16px;
}

.permission-group:last-child {
  margin-bottom: 0;
}

.permission-role {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
}

.permission-role-manager {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.permission-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0 8px;
}

.permission-list li {
  position: relative;
  padding: 5px 0 5px 18px;
  font-size: 12px;
  color: var(--text-muted);
}

.permission-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: var(--border);
  border-radius: 50%;
}

/* ================================
   MOBILE RESPONSIVE - ENHANCED UI
================================ */

@media (max-width: 767px) {
  .section-header-enhanced {
    margin: -14px -14px 20px -14px;
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .section-header-with-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .section-header-with-actions .section-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .section-header-with-actions .section-header-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .date-filter-wrapper,
  .dropdown-wrapper {
    width: 100%;
  }

  .date-filter-wrapper .btn,
  .dropdown-wrapper .btn {
    width: 100%;
    justify-content: center;
  }

  .filter-group {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .filter-group .custom-select {
    width: 100%;
  }

  .filter-group .btn {
    width: 100%;
    justify-content: center;
  }

  /* Compact filter: selects in a row on mobile */
  .filter-group-compact {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-group-compact .custom-select,
  .filter-group-compact .cs-wrapper {
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .filter-group-compact .btn-filter-clear {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .date-filter-dropdown {
    left: 16px !important;
    right: 16px !important;
    min-width: auto;
  }

  .section-title-group {
    flex-direction: row;
    align-items: center;
  }

  .section-icon-badge {
    width: 42px;
    height: 42px;
    margin-right: 12px;
  }

  .section-icon-badge svg {
    width: 20px;
    height: 20px;
  }

  .section-header-actions {
    width: 100%;
  }

  .section-header-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .history-toolbar {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 16px;
  }

  .users-toolbar {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-box {
    width: 100%;
    min-width: auto;
    flex: 0 0 100%;
  }

  .filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
  }

  .filter-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 6px;
    flex-shrink: 0;
    display: block;
  }

  .chip {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  .toolbar-actions {
    flex: 0 0 100%;
    margin-left: 0;
  }

  .toolbar-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .dropdown-menu {
    left: 0;
    right: 0;
  }

  .users-stats-grid-enhanced {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .users-stats-grid-enhanced .stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .stat-card-featured {
    grid-column: span 2;
    padding: 20px;
  }

  .stat-card-featured .stat-value {
    font-size: 28px;
  }

  /* Table to cards on mobile */
  .table-card-enhanced .table-responsive {
    padding: 12px;
  }

  .data-table-enhanced thead {
    display: none;
  }

  .data-table-enhanced tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .data-table-enhanced tbody tr {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
  }

  .data-table-enhanced tbody tr:hover {
    background: var(--surface);
  }

  .data-table-enhanced td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
  }

  .data-table-enhanced td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .data-table-enhanced td.td-user {
    flex-direction: column;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 14px;
    margin-bottom: 6px;
  }

  .data-table-enhanced td.td-user::before {
    display: none;
  }

  .user-cell {
    width: 100%;
  }

  .td-actions {
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    margin-top: 6px;
  }

  .td-actions::before {
    display: none;
  }

  .action-group {
    width: 100%;
    justify-content: flex-end;
  }

  /* Bulk action bar mobile */
  .bulk-action-bar {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .bulk-action-info {
    width: 100%;
    justify-content: space-between;
  }

  .bulk-action-buttons {
    width: 100%;
    flex-direction: column;
  }

  .bulk-action-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Checkbox in mobile cards */
  .td-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0 !important;
    border: none !important;
  }

  .td-checkbox::before {
    display: none !important;
  }

  .data-table-selectable tbody tr {
    position: relative;
    padding-right: 50px;
  }

  /* Old users table mobile cards removed — now handled in the 640px card layout block */
}

/* Mobile Add User Page */
@media (max-width: 899px) {
  .add-user-layout {
    grid-template-columns: 1fr;
  }

  .add-user-info-column {
    order: -1;
  }

  /* Hide second info card on mobile */
  .add-user-info-column .info-card:nth-child(2) {
    display: none;
  }

  .form-section-elevated {
    padding: 20px;
  }

  .form-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .role-card {
    padding: 14px 16px;
  }

  .role-icon {
    width: 42px;
    height: 42px;
  }

  .role-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* ================================
   CALCULATION DETAIL MODAL
================================ */

.detail-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.detail-modal-overlay.open {
  opacity: 1;
}

.detail-modal {
  width: min(560px, 100%);
  max-height: 90vh;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.25s ease;
}

.detail-modal-overlay.open .detail-modal {
  transform: translateY(0) scale(1);
}

/* Modal Header */
.detail-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}

.detail-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.detail-modal-title svg {
  color: var(--accent);
}

.detail-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.detail-modal-close:hover {
  background: var(--border-light);
  color: var(--text);
}

/* Product Hero Section */
.detail-hero {
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-hero-left {
  flex: 1;
  min-width: 0;
}

.detail-hero-product {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  opacity: 0.85;
}

.detail-hero-date,
.detail-hero-user {
  display: flex;
  align-items: center;
  gap: 5px;
}

.detail-user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
}

/* Profit/Status Summary - inline badge in hero */
.detail-hero-summary {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: white;
  min-width: 90px;
  text-align: center;
}

.detail-hero-summary-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.detail-hero-summary-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--success);
}

.detail-hero-summary.profit-good .detail-hero-summary-value { color: var(--success); }
.detail-hero-summary.profit-ok .detail-hero-summary-value { color: var(--warning); }
.detail-hero-summary.profit-low .detail-hero-summary-value { color: var(--danger); }
.detail-hero-summary.profit-loss .detail-hero-summary-value { color: #b91c1c; }

/* Legacy detail-profit-card — kept for any remaining usage */
.detail-profit-card {
  margin: 0 20px 20px;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-profit-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-input);
  border: 1px solid var(--border-light);
  text-align: center;
}

.detail-profit-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-profit-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.detail-profit-amount {
  text-align: right;
}

.detail-profit-amount-label {
  font-size: 11px;
  color: var(--text-muted);
}

.detail-profit-amount-value {
  font-size: 18px;
  font-weight: 600;
}

/* Profit Color Variants */
.detail-profit-card.profit-good {
  border-left: 4px solid var(--success);
}

.detail-profit-card.profit-good .detail-profit-value,
.detail-profit-card.profit-good .detail-profit-amount-value {
  color: var(--success);
}

.detail-profit-card.profit-ok {
  border-left: 4px solid var(--warning);
}

.detail-profit-card.profit-ok .detail-profit-value,
.detail-profit-card.profit-ok .detail-profit-amount-value {
  color: var(--warning);
}

.detail-profit-card.profit-low {
  border-left: 4px solid var(--danger);
}

.detail-profit-card.profit-low .detail-profit-value,
.detail-profit-card.profit-low .detail-profit-amount-value {
  color: var(--danger);
}

.detail-profit-card.profit-loss {
  border-left: 4px solid #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.detail-profit-card.profit-loss .detail-profit-value,
.detail-profit-card.profit-loss .detail-profit-amount-value {
  color: #b91c1c;
  font-weight: 700;
}

/* Detail Grid - Simple stacked layout */
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 24px 32px;
  overflow-y: auto;
}

.detail-card {
  display: flex;
  flex-direction: column;
}

.detail-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.detail-card-header svg {
  color: var(--accent);
}

.detail-card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Detail Items - Distinguishable rows */
.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  transition: border-color 0.15s ease;
}

.detail-item:hover {
  border-color: var(--text-light);
}

.detail-item-label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-item-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  text-align: right;
}

.detail-item.highlight {
  background: var(--surface-alt);
  border-color: var(--border-light);
}

.detail-item-value.accent {
  color: var(--success);
  font-size: 18px;
}

.detail-item-value.accent-loss {
  color: #b91c1c;
  font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 560px) {
  .detail-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .detail-modal {
    width: 100%;
    max-height: 90vh;
    border-radius: var(--radius) var(--radius) 0 0;
  }

  .detail-hero {
    padding: 16px;
    flex-direction: column;
    gap: 14px;
  }

  .detail-hero-product {
    font-size: 18px;
    display: flex;
    align-items: center;
  }

  .detail-hero-meta {
    gap: 8px;
  }

  .detail-hero-summary {
    align-self: stretch;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
  }

  .detail-hero-summary-label {
    margin-bottom: 0;
  }

  .detail-hero-summary-value {
    font-size: 16px;
  }

  .detail-profit-card {
    margin: 0 16px 16px;
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .detail-profit-amount {
    text-align: left;
  }

  .detail-grid {
    padding: 16px 20px 28px;
    gap: 20px;
  }

  .detail-item {
    padding: 12px 14px;
  }
}

/* Detail Profit Stats Row */
.detail-profit-stats {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.detail-profit-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-input);
  border: 1px solid var(--border-light);
  text-align: center;
}

.detail-profit-stat .label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-profit-stat .value {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 560px) {
  .detail-profit-stats {
    flex-wrap: wrap;
    gap: 8px;
  }

  .detail-profit-stat {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 12px 14px;
  }

  .detail-profit-stat:last-child {
    flex: 1 1 100%;
  }
}

/* Mini Stat Icon Orange (for total profit) */
.mini-stat-icon.orange {
  background: rgba(217, 119, 6, 0.1);
  color: var(--brand-amber);
}

/* ================================
   USER ACTIVITY DETAIL MODAL
================================ */

/* User Hero Section */
.activity-user-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.activity-user-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.activity-user-info {
  flex: 1;
  min-width: 0;
}

.activity-user-name {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.activity-user-email {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Visit Count Badge */
.visit-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

/* Session Items */
.activity-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  gap: 12px;
}

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

.activity-session-item.active {
  background: rgba(34, 197, 94, 0.05);
}

.session-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-date {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13px;
}

.session-time {
  color: var(--text-muted);
  font-size: 12px;
}

.session-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.session-duration {
  padding: 3px 8px;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.session-duration.live {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.session-stat {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  background: var(--surface-alt);
  border-radius: 4px;
}

/* Activity Timeline */
.activity-timeline {
  max-height: 280px;
  overflow-y: auto;
}

.activity-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

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

.timeline-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  border-radius: 50%;
}

.timeline-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* Device Badge */
.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.device-badge svg {
  flex-shrink: 0;
}

/* PWA Badge */
.pwa-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--surface-alt);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.pwa-badge.active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* Spin animation for loading */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile responsive for activity detail modal */
@media (max-width: 560px) {
  .activity-user-hero {
    gap: 12px;
  }

  .activity-user-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .activity-user-name {
    font-size: 18px;
  }

  .activity-session-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
  }

  .session-stats {
    justify-content: flex-start;
  }

  .activity-timeline {
    max-height: 200px;
  }

  .activity-timeline-item {
    padding: 10px 14px;
    gap: 10px;
  }

  .timeline-icon {
    width: 24px;
    height: 24px;
  }
}

/* Old activity table mobile overrides removed - now handled in unified card layout at 640px */

/* Activity stats cards on mobile */
@media (max-width: 640px) {
  #activitySection .activity-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  #activitySection .activity-stats-grid .stat-card {
    padding: 10px 12px;
    gap: 10px;
  }
}

/* ================================
   SKELETON LOADING ANIMATION
================================ */
@keyframes skeletonShimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    #f8f8f8 50%,
    var(--border-light) 100%
  );
  background-size: 200px 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-row {
  display: grid;
  grid-template-columns: 18% 22% 10% 10% 10% 12% 18%;
  gap: 12px;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border-light);
}

.skeleton-cell {
  height: 20px;
}

.skeleton-cell.wide {
  height: 32px;
}

.skeleton-cell.badge {
  width: 60px;
  height: 24px;
  border-radius: 12px;
}

.skeleton-cell.button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.skeleton-table {
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.skeleton-header {
  display: grid;
  grid-template-columns: 18% 22% 10% 10% 10% 12% 18%;
  gap: 12px;
  padding: 14px 12px;
  background: var(--surface-alt);
  border-bottom: 2px solid var(--border);
}

.skeleton-header .skeleton-cell {
  height: 14px;
  opacity: 0.7;
}

/* Mobile skeleton cards */
@media (max-width: 640px) {
  .skeleton-table {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
  }

  .skeleton-header {
    display: none;
  }

  .skeleton-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
  }

  .skeleton-row .skeleton-cell {
    width: 100%;
  }
}

/* ================================
   ENHANCED EMPTY STATE
================================ */
.empty-state-enhanced {
  text-align: center;
  padding: 60px 24px;
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--surface) 100%);
  border-radius: var(--radius-card);
  border: 2px dashed var(--border);
}

.empty-state-enhanced .empty-icon {
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emptyPulse 3s ease-in-out infinite;
}

@keyframes emptyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.empty-state-enhanced .empty-icon svg {
  width: 56px;
  height: 56px;
  color: var(--accent);
  opacity: 0.8;
}

.empty-state-enhanced h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px;
}

.empty-state-enhanced p {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Last active indicator for activity table */
.last-active {
  display: flex;
  align-items: center;
  gap: 6px;
}

.last-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.last-active.recent .last-active-dot {
  background: var(--success);
  animation: activePulse 2s ease infinite;
}

.last-active.today .last-active-dot {
  background: var(--accent);
}

.last-active.old .last-active-dot {
  background: var(--text-light);
}

@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

/* Online/Offline Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Status Badge - Active (actively using now, within 5 min) */
.status-badge.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.status-badge.status-active .status-dot {
  background: #10b981;
  animation: activePulse 2s ease infinite;
}

/* Status Badge - Present (recent activity within 15 min) */
.status-badge.status-present {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.status-badge.status-present .status-dot {
  background: #3b82f6;
  animation: presentPulse 3s ease infinite;
}

/* Status Badge - Away (used within 24 hours) */
.status-badge.status-away {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.status-badge.status-away .status-dot {
  background: #f59e0b;
}

/* Status Badge - Offline / Pasif */
.status-badge.status-offline {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.status-badge.status-offline .status-dot {
  background: #ef4444;
}


/* Products toolbar: keep all items grouped together instead of space-between */
#productsToolbar {
  justify-content: flex-start;
}

/* ------------------------------------------------
   Kebab Menu (Three-Dots Action Menu)
   ------------------------------------------------ */
@keyframes kebabFadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kebab-wrapper {
  position: relative;
  display: inline-block;
}

.kebab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--primary);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  padding: 0;
}

.kebab-btn:hover {
  background: linear-gradient(135deg, var(--primary) 0%, #0052a8 100%);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 32, 91, 0.4);
}

.kebab-btn:active {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 32, 91, 0.3);
}

.kebab-btn svg {
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .kebab-btn:hover svg {
    transform: rotate(90deg);
  }
}

.kebab-btn.open {
  background: var(--primary);
  color: white;
}

.kebab-btn.open svg {
  transform: rotate(90deg);
}

.kebab-menu {
  position: fixed;
  z-index: 9999;
  min-width: 140px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 12px;
  border: 2px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 62, 131, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: kebabFadeInDown 0.2s ease-out;
  display: none;
}

.kebab-menu.open {
  display: block;
}

.kebab-menu.closing {
  display: block;
  animation: kebabFadeOutDown 0.15s ease-in forwards;
}

.kebab-menu.open-up.closing {
  animation: kebabFadeOutUp 0.15s ease-in forwards;
}

.kebab-menu.open-up {
  animation: kebabFadeInUp 0.2s ease-out;
}

@keyframes kebabFadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes kebabFadeOutDown {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

@keyframes kebabFadeOutUp {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(6px); }
}

.kebab-menu-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 0;
  background: white;
  border: none;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

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

.kebab-menu-item svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.kebab-menu-item.item-edit {
  color: #0284c7;
}
.kebab-menu-item.item-edit:hover {
  background: #f0f9ff;
}

.kebab-menu-item.item-deactivate {
  color: #d97706;
}
.kebab-menu-item.item-deactivate:hover {
  background: #fffbeb;
}

.kebab-menu-item.item-activate {
  color: #059669;
}
.kebab-menu-item.item-activate:hover {
  background: #ecfdf5;
}

.kebab-menu-item.item-delete {
  color: #dc2626;
}
.kebab-menu-item.item-delete:hover {
  background: #fef2f2;
}

/* Status Badge - Pending (signed up, awaiting activation) */
.status-badge.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.status-badge.status-pending .status-dot {
  background: #f59e0b;
  animation: pendingPulse 2s ease infinite;
}

/* Status Badge - Waiting (not yet signed up) */
.status-badge.status-waiting {
  background: rgba(156, 163, 175, 0.1);
  color: #6b7280;
}

.status-badge.status-waiting .status-dot {
  background: #9ca3af;
}

@keyframes pendingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Status Badge - Online (legacy) */
.status-badge.status-online {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.status-badge.status-online .status-dot {
  background: #10b981;
  animation: activePulse 2s ease infinite;
}

@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

@keyframes presentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0); }
}

/* Last Activity Cell Styles */
.last-activity-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-time-ago {
  font-weight: 500;
  color: var(--text-primary);
}

.activity-exact-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Utility: hide on mobile */
@media (max-width: 768px) {
  .mobile-hidden {
    display: none !important;
  }
}
