/* ==========================================================================
   MANGANO INTERNAL — Base Stylesheet
   Design system: ./design_system/
   Reference: manganocrm-sales.manus.space
   ========================================================================== */

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

:root {
  /* ── Layout ─────────────────────────────────────────────────────────── */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 64px;

  /* ── Brand ──────────────────────────────────────────────────────────── */
  --brand-primary: #FF6B00;
  --brand-primary-hover: #E55A00;
  --brand-primary-light: #FFF3E6;

  /* ── Bootstrap overrides ────────────────────────────────────────────── */
  --bs-primary: #FF6B00;
  --bs-primary-hover: #E55A00;
  --bs-primary-rgb: 255, 107, 0;

  /* ── Backgrounds ────────────────────────────────────────────────────── */
  --bg-body: #f5f6fa;
  --bg-surface: #ffffff;
  --bg-sidebar: #1e1e2d;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.08);
  --bg-sidebar-active: rgba(255, 255, 255, 0.12);
  --bg-menu-section: #161625;
  --bg-menu-sub: #131320;
  --bg-subtle: #f8f9fc;
  --bg-hover: #f1f3f9;
  --bg-sidebar-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);

  /* ── Text ───────────────────────────────────────────────────────────── */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: rgba(255, 255, 255, 0.75);
  --text-sidebar-header: rgba(255, 255, 255, 0.45);
  --text-on-primary: #ffffff;
  --language-btn-color: #475569;

  /* ── Borders ────────────────────────────────────────────────────────── */
  --border-color: #e8ecf1;
  --border-sidebar: rgba(255, 255, 255, 0.1);
  --sidebar-footer-border: rgba(255, 255, 255, 0.1);
  --border-focus: var(--brand-primary);

  /* ── Topbar ─────────────────────────────────────────────────────────── */
  --topbar-bg: #ffffff;
  --topbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  --topbar-border-bottom: none;
  --profile-menu-bg: #ffffff;
  --dropdown-divider: #e8ecf1;

  /* ── Interactive ────────────────────────────────────────────────────── */
  --sidebar-active-border-color: var(--brand-primary);
  --menu-section-header-hover: rgba(255, 255, 255, 0.7);

  /* ── Shadows ────────────────────────────────────────────────────────── */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* ── Border Radius ──────────────────────────────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
}

/* ── Global Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  box-shadow: var(--bg-sidebar-shadow);
  color: var(--text-sidebar);
  padding-top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.2s ease;
}

.sidebar-brand {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: var(--brand-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-brand-text .brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.sidebar-brand-text .brand-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-brand-inner {
  display: none;
}

.sidebar-menu {
  list-style: none;
  padding: 8px 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-menu li {
  padding: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-sidebar);
  text-decoration: none;
  transition: all 0.15s ease;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.sidebar-menu a i,
.sidebar-menu a .menu-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  opacity: 0.7;
  flex-shrink: 0;
}

.sidebar-menu a:hover {
  background: var(--bg-sidebar-hover);
  color: rgba(255, 255, 255, 0.95);
  border-left-color: transparent;
}

.sidebar-menu a:hover i,
.sidebar-menu a:hover .menu-icon {
  opacity: 1;
}

.sidebar-menu a.active {
  background: var(--bg-sidebar-active);
  color: #ffffff;
  border-left-color: var(--brand-primary);
  font-weight: 600;
}

.sidebar-menu a.active i,
.sidebar-menu a.active .menu-icon {
  opacity: 1;
  color: var(--brand-primary);
}

/* ── Sidebar Collapsed ──────────────────────────────────────────────────── */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px 10px;
}

.sidebar.collapsed .sidebar-menu a span {
  display: none;
}

.sidebar.collapsed .menu-section-header {
  display: none;
}

.sidebar.collapsed .menu-section-items {
  display: block !important;
}

.sidebar.collapsed .sidebar-menu a {
  text-align: center;
  padding: 12px 10px;
  justify-content: center;
  border-left: none;
}

.sidebar.collapsed .sidebar-menu a i,
.sidebar.collapsed .sidebar-menu a .menu-icon {
  font-size: 18px;
}

.sidebar.collapsed .sidebar-menu a::after {
  content: attr(data-icon);
  display: block;
  font-size: 18px;
}

.sidebar.collapsed + .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.sidebar-toggle {
  display: none;
}

/* ── Sidebar Menu Sections ───────────────────────────────────────────────── */
.menu-section-header {
  padding: 14px 20px 6px;
  color: var(--text-sidebar-header);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.menu-section-header:hover {
  color: var(--menu-section-header-hover);
}

.menu-section-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  opacity: 0.5;
}

.menu-section-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
}

.menu-section-items.show {
  display: block;
}

.menu-section-items li a {
  padding: 9px 20px 9px 24px;
  font-size: 13px;
}

.menu-subitems {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-subitems li a {
  padding: 8px 20px 8px 44px;
  color: var(--text-sidebar-header);
  font-size: 12px;
}

.menu-subitems li a:hover,
.menu-subitems li a.active {
  color: white;
  background: var(--bg-sidebar);
}

.menu-section-header.expanded .menu-section-arrow {
  transform: rotate(180deg);
}

.menu-divider {
  height: 1px;
  background: var(--border-sidebar);
  margin: 6px 20px;
}

.menu-section-subheader {
  padding: 6px 20px 6px 24px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sidebar-header);
}

/* ── Sidebar Footer ──────────────────────────────────────────────────────── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-footer-border);
  flex-shrink: 0;
}

.logout-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-sidebar-header);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.15s ease;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-footer {
  padding: 12px;
  text-align: center;
}

.sidebar.collapsed .logout-btn {
  width: 36px;
  height: 36px;
}

/* ── Main Content ────────────────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: margin-left 0.2s ease;
}

.page-content {
  padding: 24px 28px;
}

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Search Bar ──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  gap: 10px;
  width: 100%;
  max-width: 480px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
  background: var(--bg-surface);
}

.search-bar i {
  color: var(--text-muted);
  font-size: 14px;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  width: 100%;
  font-family: 'Inter', sans-serif;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar .search-shortcut {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

/* ── Back Button ─────────────────────────────────────────────────────────── */
.back-btn {
  padding: 7px 14px;
  background: var(--brand-primary);
  color: var(--text-on-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.back-btn:hover {
  background: var(--brand-primary-hover);
}

/* ── Notification Bell ───────────────────────────────────────────────────── */
.notification-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
}

.notification-bell:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notification-bell .bell-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 17px;
  height: 17px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  line-height: 1;
}

/* ── Dark Mode Toggle ────────────────────────────────────────────────────── */
.dark-mode-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 16px;
}

.dark-mode-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Language Switcher ───────────────────────────────────────────────────── */
.language-switcher {
  display: flex;
  gap: 4px;
}

.language-btn {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--language-btn-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s ease;
}

.language-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.language-btn.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-primary);
}

/* ── Profile Dropdown ────────────────────────────────────────────────────── */
.profile-dropdown {
  position: relative;
  display: inline-block;
}

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.profile-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.error-alert-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 2px solid #ef4444;
  background: #fef2f2;
  color: #ef4444;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.15s ease;
  margin-right: 8px;
}

.error-alert-btn:hover {
  background: #ef4444;
  color: white;
}

.error-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  border-radius: var(--radius-full);
  width: 17px;
  height: 17px;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border: 2px solid var(--bg-surface);
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--profile-menu-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dropdown);
  min-width: 260px;
  z-index: 1010;
  display: none;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.profile-menu.show {
  display: block;
}

.profile-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
  font-size: 36px;
  color: var(--text-muted);
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-info strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}

.profile-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0;
}

.profile-logout {
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.profile-logout:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

a.profile-logout {
  color: var(--text-secondary);
  text-decoration: none;
}

/* ── Stat Cards ──────────────────────────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--border-color);
}

.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.stat-card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card-icon.blue { background: #eef2ff; color: #4f46e5; }
.stat-card-icon.green { background: #ecfdf5; color: #059669; }
.stat-card-icon.orange { background: var(--brand-primary-light); color: var(--brand-primary); }
.stat-card-icon.red { background: #fef2f2; color: #dc2626; }
.stat-card-icon.purple { background: #f5f3ff; color: #7c3aed; }
.stat-card-icon.teal { background: #f0fdfa; color: #0d9488; }

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

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

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.page-header .subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

/* ── Data Table ──────────────────────────────────────────────────────────── */
.data-table {
  margin-top: 0;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

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

.data-table th {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  background: var(--bg-subtle);
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--bg-subtle);
}

/* ── Filters ─────────────────────────────────────────────────────────────── */
.filters {
  margin-bottom: 20px;
}

.explorer-filters {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.filter-inline .filter-title {
  white-space: nowrap;
  margin: 0;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"] {
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  background: var(--bg-surface);
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.filter-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-secondary);
}

.filter-row + .filter-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ── Action Buttons ──────────────────────────────────────────────────────── */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  margin: 2px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover { opacity: 0.85; text-decoration: none; color: white; }
.action-btn.view { background: #3b82f6; color: white; }
.action-btn.edit { background: var(--brand-primary); color: white; }
.action-btn.delete { background: #ef4444; color: white; }
.action-btn.delete:disabled { opacity: 0.5; cursor: not-allowed; }
.actions-column { min-width: 140px; white-space: nowrap; }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination .page-link {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  margin: 0 2px;
  font-family: 'Inter', sans-serif;
}

.pagination .page-link:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-default);
}

.pagination .page-item.active .page-link {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: white;
}

.pagination .page-link svg {
  width: 12px;
  height: 12px;
}

/* ── Alerts ──────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-lg);
  border: none;
  font-size: 13px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
  border-radius: var(--radius-md);
  border-color: var(--border-color);
  font-size: 13px;
  padding: 7px 12px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

/* Improve select visibility in forms */
.form-group select.form-control {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.form-group select.form-control option {
  color: var(--text-primary);
  background: var(--bg-surface);
}

/* ── Login Invite ────────────────────────────────────────────────────────── */
.login-invite-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}

.login-invite-box {
  text-align: center;
  padding: 40px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-hover);
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.login-invite-icon {
  font-size: 48px;
  color: var(--brand-primary);
  margin-bottom: 20px;
}

.login-invite-box h2 {
  margin-bottom: 10px;
  color: var(--text-primary);
}

.login-invite-box p {
  color: var(--text-muted);
  margin-bottom: 25px;
}

/* ── Notes Panel ─────────────────────────────────────────────────────────── */
.notes-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35);
  cursor: pointer;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.notes-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(255, 107, 0, 0.45);
}

.notes-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid #fff;
}

.notes-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1060;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

.notes-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.notes-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-surface);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  z-index: 1070;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notes-panel.open {
  transform: translateX(0);
}

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

.notes-panel-header h5 {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 15px;
}

.notes-panel-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.notes-panel-close:hover { color: var(--text-primary); }

.notes-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.notes-quick-actions {
  display: flex;
  gap: 8px;
}

.notes-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg-subtle);
  transition: box-shadow 0.15s;
}

.notes-item:hover {
  box-shadow: var(--shadow-card);
}

.notes-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.notes-item-type {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  flex-shrink: 0;
}

.notes-item-subject {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.notes-item-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.notes-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.notes-item-date {
  font-size: 11px;
  color: var(--text-muted);
}

.notes-item-author {
  font-size: 11px;
  color: var(--text-muted);
}

.notes-item-assign {
  font-size: 11px;
  color: var(--brand-primary);
  font-weight: 500;
}

.notes-item-actions {
  display: flex;
  gap: 4px;
}

.notes-complete-btn, .notes-edit-btn {
  padding: 3px 8px;
  font-size: 11px;
}

.notes-item-completed {
  opacity: 0.5;
  background: var(--bg-subtle);
  border-style: dashed;
}

.notes-item-completed .notes-item-subject {
  text-decoration: line-through;
  color: var(--text-muted);
}

.notes-item-schedule {
  border-left: 3px solid #10b981;
}

.notes-item-duedate {
  font-size: 13px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.06);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.notes-item-duedate strong {
  font-weight: 700;
}

.notes-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.notes-toast {
  position: fixed;
  bottom: 100px;
  right: 28px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: notesToastIn 0.3s ease;
}

.notes-toast-danger { background: #ef4444; }
.notes-toast-success { background: #10b981; }
.notes-toast-info { background: #3b82f6; }

.notes-toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

#noteDeleteModal,
#noteCheckDateModal {
  z-index: 1080 !important;
}

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

/* ── Modal Overrides ─────────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
}

.modal-title {
  font-weight: 600;
  font-size: 16px;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
}

/* ── Badge Overrides ─────────────────────────────────────────────────────── */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-badge.admin {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.role-badge.user {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }
  .sidebar-brand-text {
    display: none;
  }
  .sidebar-brand {
    justify-content: center;
    padding: 16px 10px;
  }
  .sidebar-menu a span {
    display: none;
  }
  .sidebar-menu a {
    text-align: center;
    padding: 12px 10px;
    justify-content: center;
    border-left: none;
  }
  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }
  .search-bar {
    min-width: 0;
    max-width: 200px;
  }
  .search-bar .search-shortcut {
    display: none;
  }
  .stat-cards {
    grid-template-columns: 1fr;
  }
}
