/* ==========================================================================
   STOCK TRACKER - ULTRA PREMIUM MODERN DARK DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg-main: #060913;
  --bg-surface: #0b0f19;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-modal: #0f172a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --success: #10b981;
  --success-light: #34d399;
  --success-bg: rgba(16, 185, 129, 0.14);
  
  --danger: #f43f5e;
  --danger-light: #fb7185;
  --danger-bg: rgba(244, 63, 94, 0.14);
  
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.14);
  
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.14);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow-main: 0 12px 32px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 45%),
    radial-gradient(at 90% 90%, rgba(16, 185, 129, 0.08) 0px, transparent 45%),
    radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.05) 0px, transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.main-content {
  flex: 1;
  padding: 28px 24px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.container-fluid {
  width: 100%;
}

/* Glassmorphism Card Style */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-main);
}

/* Navbar */
.navbar-header {
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 38px;
  margin-left: 12px;
}

.user-info-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.2;
  gap: 3px;
}

.user-fullname {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
  line-height: 1.2;
}

.user-role-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: #818cf8;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.logout-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(244, 63, 94, 0.18);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.4);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-white);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-logo-img {
  height: 38px;
  width: 38px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: var(--transition);
}

.brand-logo-img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.65);
}

.brand-badge-img {
  padding: 0 !important;
  overflow: hidden;
  border-radius: 16px !important;
}

.login-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

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

.nav-link.active {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.navbar-left-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}



.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-white);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-accent {
  background: var(--primary-glow);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-admin {
  background: var(--warning-bg);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-view {
  background: var(--info-bg);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.stock-symbol-badge {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(99, 102, 241, 0.25);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Page Header */
.page-header {
  margin-bottom: 24px;
}

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

.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.4px;
}

.page-title i {
  color: var(--primary);
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.refresh-action-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.last-updated-badge {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Summary Cards Grid */
.summary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: var(--transition);
}

.summary-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.card-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.card-total .card-icon {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.card-gainers .card-icon {
  background: var(--success-bg);
  color: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.card-losers .card-icon {
  background: var(--danger-bg);
  color: var(--danger-light);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
}

.card-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-white);
  margin-top: 2px;
}

/* Toolbar Card */
.toolbar-card {
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.toolbar-search {
  flex: 1;
  min-width: 280px;
}

.input-icon-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.input-icon-wrapper input {
  padding-left: 42px;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Form Controls */
.form-control, .form-select {
  width: 100%;
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(15, 23, 42, 0.9);
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.form-row {
  display: flex;
  gap: 16px;
}

.col-6 {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

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

.btn-lg {
  padding: 13px 26px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-white);
}

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

.btn-outline:hover {
  color: var(--text-white);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--danger-light);
}

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

.btn-outline-warning {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.btn-outline-warning:hover {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.btn-outline-info {
  background: transparent;
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #38bdf8;
}

.btn-outline-info:hover {
  background: var(--info);
  color: white;
  border-color: var(--info);
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.disabled-btn {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

/* Stock & User Tables */
.table-card {
  overflow: hidden;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

#usersTable th,
#usersTable td {
  text-align: center !important;
}

.custom-table th {
  background: rgba(11, 15, 25, 0.85);
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.stock-name-cell {
  white-space: normal !important;
  word-break: break-word;
  max-width: 180px;
  min-width: 120px;
  line-height: 1.35;
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-table tbody tr:hover td {
  background: var(--bg-card-hover);
}

.pnl-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
}

.pnl-positive {
  color: var(--success-light);
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pnl-negative {
  color: var(--danger-light);
  background: var(--danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.price-cell {
  font-size: 0.92rem;
}

.text-success-light { color: var(--success-light); font-weight: 600; }
.text-danger-light { color: var(--danger-light); font-weight: 600; }
.text-success { color: var(--success-light); }
.text-danger { color: var(--danger-light); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--text-white); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.text-center { text-align: center; }

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.modal-content {
  width: 100%;
  max-width: 520px;
  background: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(11, 15, 25, 0.5);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i {
  color: var(--primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-white);
}

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

.modal-footer {
  padding: 16px 24px;
  background: rgba(11, 15, 25, 0.6);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--danger-light);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success-light);
}

/* Login Page Styling */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 440px;
}

.login-card {
  padding: 40px 32px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-glow);
  border: 1px solid rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
  font-size: 1.8rem;
  color: var(--primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.login-header h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.4px;
}

.password-input-wrapper {
  position: relative;
}

.btn-toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

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

/* PWA Banner */
.pwa-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  border: 1px solid var(--primary);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  z-index: 999;
  max-width: 420px;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.pwa-icon {
  font-size: 1.8rem;
  color: var(--primary);
}

.pwa-banner-actions {
  display: flex;
  gap: 8px;
}

.pwa-status-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pwa-status-badge.offline {
  color: var(--danger-light);
}

/* Settings Page Styling */
.settings-card {
  padding: 32px;
  max-width: 900px;
  margin: 0 auto;
}

.settings-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-white);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-title i {
  color: var(--primary);
}

.holiday-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.holiday-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(11, 15, 25, 0.4);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.flex-1 {
  flex: 1;
}

.holiday-formatted-tag {
  font-size: 0.85rem;
  min-width: 140px;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.mt-4 { margin-top: 24px; }
.pt-3 { padding-top: 16px; }
.mb-3 { margin-bottom: 16px; }

.username-tag {
  font-family: monospace;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.hidden {
  display: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { transform: translateX(-40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { background: #059669; }
.toast-danger { background: #e11d48; }
.toast-info { background: #0284c7; }

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 18px 24px;
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(11, 15, 25, 0.4);
}

.footer-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ==========================================================================
   RESPONSIVENESS & MOBILE ENHANCEMENTS
   ========================================================================== */

@media (max-width: 768px) {
  .main-content {
    padding: 12px 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .navbar-container {
    padding: 8px 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
    gap: 6px;
    box-sizing: border-box;
  }

  .navbar-left-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex: 1;
    width: 100%;
    min-width: 0;
  }

  .brand-logo {
    font-size: 0.95rem;
    gap: 6px;
    flex-shrink: 0;
    height: 32px;
    display: flex;
    align-items: center;
  }

  .brand-logo-img {
    height: 28px;
    width: 28px;
  }

  .navbar-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow: visible;
  }

  .nav-link {
    padding: 5px 10px;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-link i {
    font-size: 0.76rem;
    margin-right: 4px;
  }

  .nav-text {
    font-size: 0.76rem;
    white-space: nowrap;
  }

  .navbar-user {
    display: flex;
    align-items: center;
    gap: 4px;
    height: auto;
    flex-shrink: 0;
    margin-left: 2px;
    align-self: flex-start;
  }

  .user-info-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    line-height: 1.05;
    gap: 1px;
    margin: 0;
    padding: 0;
    max-width: 105px;
    overflow: hidden;
  }

  .user-fullname {
    font-size: 0.78rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .user-role-text {
    font-size: 0.68rem;
    font-weight: 700;
    color: #818cf8;
    text-transform: capitalize;
    letter-spacing: 0.5px;
    white-space: nowrap;
  }

  .logout-icon-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(244, 63, 94, 0.18);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.4);
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
  }

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

  .page-title {
    font-size: 1.25rem;
  }

  .page-subtitle {
    font-size: 0.78rem;
  }

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

  .header-actions {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .refresh-action-wrapper {
    align-items: flex-start !important;
  }

  .summary-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 14px;
    width: 100%;
  }

  .summary-card {
    padding: 10px 4px;
    gap: 4px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    overflow: hidden;
  }

  .card-icon {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  .card-label {
    font-size: 0.68rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .card-value {
    font-size: 1.15rem;
    margin-top: 0;
  }

  .toolbar-card {
    padding: 12px;
    gap: 10px;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .toolbar-search {
    min-width: 100%;
    width: 100%;
  }

  .toolbar-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  .form-control, .form-select {
    width: 100%;
    font-size: 0.85rem;
  }

  .table-card {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
  }

  .table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .custom-table {
    width: 100%;
    min-width: 100%;
  }

  .custom-table th, .custom-table td {
    padding: 8px 4px;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .stock-name-cell {
    max-width: 95px;
    font-size: 0.74rem;
    line-height: 1.15;
  }

  .action-buttons {
    gap: 3px;
    justify-content: center;
  }

  .btn-icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .settings-card {
    padding: 16px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .holiday-item-row {
    padding: 6px;
    gap: 6px;
    width: 100%;
  }

  .holiday-date-input {
    font-size: 0.82rem;
    padding: 6px 8px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .col-6 {
    width: 100%;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-content {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .modal-body {
    padding: 16px;
  }

  .modal-header, .modal-footer {
    padding: 14px 16px;
  }

  .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
    touch-action: manipulation;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 0.78rem;
  }

  .pwa-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .pwa-banner-actions {
    justify-content: flex-end;
  }

  .toast-container {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .toast {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }

  .login-header h2 {
    font-size: 1.45rem;
  }

  .brand-logo .brand-name {
    font-size: 1.05rem;
  }
}
