/* Premium Styling for Multi-Business Management Dashboard */

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

:root {
  /* HSL Color System */
  --primary-hue: 162; /* Emerald/Teal */
  --primary: hsl(var(--primary-hue), 76%, 41%);
  --primary-hover: hsl(var(--primary-hue), 76%, 33%);
  --primary-glow: hsla(var(--primary-hue), 76%, 41%, 0.15);
  
  --secondary: hsl(210, 100%, 50%); /* Vibrant Blue */
  --accent: hsl(32, 98%, 51%); /* Orange */
  --danger: hsl(354, 76%, 53%); /* Red */
  --success: hsl(142, 69%, 45%); /* Green */
  --warning: hsl(45, 93%, 47%); /* Yellow */
  
  /* Fonts */
  --font-main: 'Outfit', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px hsla(var(--primary-hue), 76%, 41%, 0.2);
  
  /* Dark Mode Default Values */
  --bg-app: hsl(222, 47%, 7%);
  --bg-sidebar: hsl(222, 47%, 4%);
  --bg-card: hsl(222, 40%, 11%);
  --bg-input: hsl(222, 35%, 15%);
  --border-color: hsl(222, 30%, 18%);
  
  --text-main: hsl(210, 40%, 98%);
  --text-muted: hsl(215, 20%, 65%);
  --text-inverse: hsl(222, 47%, 10%);
  
  --backdrop-blur: blur(12px);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* Light Mode Overrides */
body.light-mode {
  --bg-app: hsl(210, 50%, 98%);
  --bg-sidebar: hsl(210, 40%, 95%);
  --bg-card: hsl(0, 0%, 100%);
  --bg-input: hsl(210, 30%, 96%);
  --border-color: hsl(210, 20%, 90%);
  
  --text-main: hsl(222, 47%, 12%);
  --text-muted: hsl(215, 16%, 47%);
  --text-inverse: hsl(210, 40%, 98%);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(0, 0, 0, 0.06);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.15);
  --shadow-lg: 0 16px 40px rgba(149, 157, 165, 0.25);
  --shadow-glow: 0 0 20px hsla(var(--primary-hue), 76%, 41%, 0.1);
}

/* Base resets & styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 10px;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Layout Grid */
#app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

@media (max-width: 1024px) {
  #app-container {
    grid-template-columns: 80px 1fr;
  }
}

@media (max-width: 768px) {
  #app-container {
    grid-template-columns: 1fr;
  }
}

/* Login Page Overlay */
#login-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: radial-gradient(circle at 30% 30%, hsl(var(--primary-hue), 60%, 15%), var(--bg-app));
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

body.light-mode #login-page {
  background: radial-gradient(circle at 30% 30%, hsl(var(--primary-hue), 60%, 90%), var(--bg-app));
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--glass-border);
  padding: 30px;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 25px;
}

.login-tabs-nav {
  display: flex;
  background: var(--bg-input);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.login-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.login-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.login-section-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.login-section-content.active {
  display: block;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

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

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.login-footer {
  margin-top: 25px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Sidebar Styling */
aside {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: all var(--transition-normal);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.active-store-card-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

@media (max-width: 1024px) {
  .brand-name, .active-store-card-sidebar {
    display: none;
  }
  aside {
    padding: 16px 8px;
    align-items: center;
  }
}

.menu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

.menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.menu-item a i {
  font-size: 1.1rem;
}

.menu-item.active a,
.menu-item a:hover {
  color: var(--text-main);
  background-color: var(--primary-glow);
}

.menu-item.active a {
  border-left: 3px solid var(--primary);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

@media (max-width: 1024px) {
  .menu-item a span {
    display: none;
  }
  .menu-item a {
    justify-content: center;
    padding: 12px;
  }
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 15px;
}

.current-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.current-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border-color);
}

.current-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.current-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.current-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

@media (max-width: 1024px) {
  .current-user-info {
    display: none;
  }
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-logout:hover {
  background: hsla(354, 76%, 53%, 0.08);
  color: var(--danger);
  border-color: var(--danger);
}

/* Header Area */
header {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

@media (max-width: 768px) {
  header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
}

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

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

.store-select,
.quick-user-switch {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  outline: none;
}

.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

/* Content Area */
.content-wrapper {
  padding: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 16px;
    gap: 16px;
  }
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-card.profit .metric-icon { background: hsla(162, 76%, 41%, 0.15); color: var(--primary); }
.metric-card.income .metric-icon { background: hsla(142, 69%, 45%, 0.15); color: var(--success); }
.metric-card.expense .metric-icon { background: hsla(354, 76%, 53%, 0.15); color: var(--danger); }
.metric-card.alerts .metric-icon { background: hsla(32, 98%, 51%, 0.15); color: var(--accent); }

/* Dashboard layouts */
.dashboard-details-layout {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .dashboard-details-layout {
    grid-template-columns: 1fr;
  }
}

.chart-card,
.alerts-card,
.logs-card,
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

/* Alert list */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

.alert-item.danger {
  background: hsla(354, 76%, 53%, 0.06);
  border-color: hsla(354, 76%, 53%, 0.15);
}

.alert-item.warning {
  background: hsla(45, 93%, 47%, 0.06);
  border-color: hsla(45, 93%, 47%, 0.15);
}

.alert-item i {
  font-size: 1rem;
  margin-top: 1px;
}

.alert-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.alert-title {
  font-weight: 600;
}

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

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 25px;
  font-size: 0.85rem;
}

/* Section Actions */
.section-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.search-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.input-search,
.select-filter {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-fast);
}

.input-search:focus,
.select-filter:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-accent,
.btn-danger,
.btn-cancel {
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-glow); }

.btn-secondary { background: var(--bg-input); color: var(--text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--primary); }

.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { opacity: 0.9; }

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

.btn-cancel { background: transparent; color: var(--text-muted); }
.btn-cancel:hover { background: var(--bg-input); }

.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon:hover { border-color: var(--primary); }

/* Table styles */
.responsive-table-container {
  width: 100%;
  overflow-x: auto;
}

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

th {
  background-color: var(--bg-sidebar);
  color: var(--text-muted);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 2px solid var(--border-color);
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

tr:hover td {
  background-color: var(--bg-input);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.income { background: hsla(142, 69%, 45%, 0.12); color: var(--success); }
.badge.expense { background: hsla(354, 76%, 53%, 0.12); color: var(--danger); }
.badge.low-stock { background: hsla(32, 98%, 51%, 0.12); color: var(--accent); }
.badge.in-stock { background: hsla(162, 76%, 41%, 0.12); color: var(--primary); }
.badge.out-of-stock { background: hsla(354, 76%, 53%, 0.12); color: var(--danger); }
.badge.expired { background: hsla(354, 76%, 53%, 0.12); color: var(--danger); }
.badge.expiring { background: hsla(45, 93%, 47%, 0.12); color: var(--warning); }
.badge.fresh { background: hsla(162, 76%, 41%, 0.12); color: var(--primary); }

.badge.pending { background: hsla(32, 98%, 51%, 0.12); color: var(--accent); }
.badge.approved { background: hsla(142, 69%, 45%, 0.12); color: var(--success); }
.badge.rejected { background: hsla(354, 76%, 53%, 0.12); color: var(--danger); }

/* Stores grid */
.store-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.store-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

.store-hub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-hub-card-name {
  font-weight: 700;
  font-size: 1rem;
}

.store-hub-card-icon {
  font-size: 1.5rem;
}

.store-hub-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.store-hub-card-stat {
  display: flex;
  flex-direction: column;
}

.store-hub-card-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.store-hub-card-stat-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.store-hub-card-link {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.store-hub-card-link:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

/* Snooker Billing Layout */
.snooker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.snooker-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-normal);
}

.snooker-card.in-use {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

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

.snooker-table-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.snooker-timer-display {
  background: var(--bg-input);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.timer-digits {
  font-size: 2.2rem;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.snooker-card.in-use .timer-digits {
  color: var(--primary);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.fee-digits {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.snooker-card.in-use .fee-digits {
  color: var(--success);
}

.snooker-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.snooker-actions button {
  flex: 1;
  justify-content: center;
}

/* Palm Garden Calendar styling */
.palm-layout-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 20px;
}

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

.palm-calendar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.calendar-days-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

.calendar-day-cell {
  aspect-ratio: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.calendar-day-cell:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.calendar-day-cell.other-month {
  opacity: 0.3;
}

.calendar-day-cell.today {
  border: 2px solid var(--primary);
  font-weight: 700;
}

.day-dots-container {
  display: flex;
  gap: 2px;
  position: absolute;
  bottom: 4px;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.dot-fertilizing { background-color: var(--primary); }
.dot-mowing { background-color: var(--accent); }
.dot-harvesting { background-color: var(--success); }
.dot-other { background-color: var(--secondary); }

.palm-activities-list-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.palm-activities-list {
  overflow-y: auto;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.palm-activity-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 14px;
  border-radius: 12px;
  position: relative;
}

.palm-activity-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.palm-activity-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.palm-activity-item-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.palm-activity-item-financials {
  margin-top: 8px;
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Affiliate layout styling */
.platform-stat-bar-container {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.platform-stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.platform-stat-bar-outer {
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.platform-stat-bar-inner {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(95deg, var(--primary), var(--secondary));
}

.platform-list-item-manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-input);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* AI Analysis card details */
.ai-output-container {
  background: hsla(var(--primary-hue), 76%, 41%, 0.05);
  border: 1px solid hsla(var(--primary-hue), 76%, 41%, 0.2);
  border-radius: 12px;
  padding: 16px;
}

.ai-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--primary);
  padding: 15px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.ai-text-content {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-main);
}

.ai-text-content ul {
  padding-left: 20px;
  margin-top: 6px;
}

.ai-text-content li {
  margin-bottom: 6px;
}

.ai-insight-heading {
  font-weight: 700;
  color: var(--primary);
  margin-top: 10px;
  margin-bottom: 4px;
}

/* Config Grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.config-item {
  background: var(--bg-input);
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Audit logs list */
.audit-logs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.log-entry {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  gap: 10px;
}

.log-info {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.log-user {
  font-weight: 700;
  color: var(--primary);
}

.log-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 700;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.image-preview-box {
  background: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-img {
  max-width: 100%;
  max-height: 140px;
  border-radius: 6px;
  object-fit: contain;
}

/* Kanban column */
.todolist-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .todolist-container {
    grid-template-columns: 1fr;
  }
}

.column-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
}

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

.column-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.column-count {
  font-size: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 6px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  padding-bottom: 20px;
}

.task-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  cursor: grab;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.task-card:hover {
  border-color: var(--primary);
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.task-priority {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.priority-high { background-color: hsla(354, 76%, 53%, 0.12); color: var(--danger); }
.priority-medium { background-color: hsla(45, 93%, 47%, 0.12); color: var(--warning); }
.priority-low { background-color: hsla(162, 76%, 41%, 0.12); color: var(--primary); }

.task-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.task-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.task-assignee {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-assignee-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
}

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

.task-due.overdue {
  color: var(--danger);
  font-weight: 600;
}

.task-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.task-actions button {
  flex: 1;
  padding: 4px;
  font-size: 0.7rem;
  justify-content: center;
}

/* Menu Grid Details */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.menu-image-container {
  height: 150px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.menu-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-details {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.menu-title {
  font-size: 0.95rem;
  font-weight: 700;
}

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

.menu-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.menu-cost {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
}

.menu-ingredients-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}

.menu-ingredients-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.menu-instructions {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  white-space: pre-line;
  max-height: 100px;
  overflow-y: auto;
  padding-right: 2px;
}

/* Visibility rules */
.owner-only { display: none; }
.employee-only { display: none; }

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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