/* Ramest360 - Self-Contained Dashboard CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #0a0d16; /* Soft premium dark blue-black background */
  --bg-sidebar: #111622; /* High-contrast elevated dark color for sidebar */
  --panel-bg: rgba(22, 28, 45, 0.45);
  --panel-bg-hover: rgba(30, 38, 60, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc; /* Clear Slate 50 text */
  --text-secondary: #94a3b8; /* Clear Slate 400 secondary text */
  --accent-cyan: #00f2fe;
  --accent-purple: #bd5cff;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;
  --font-main: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em; /* Elegant crisp letter spacing */
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

/* Background Ambient Glows */
.ambient-glow-1 {
  position: fixed;
  top: -15%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(189, 92, 255, 0.1) 0%, rgba(0,0,0,0) 75%);
  z-index: 0;
  pointer-events: none;
  filter: blur(80px);
}

.ambient-glow-2 {
  position: fixed;
  bottom: -15%;
  left: 20%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, rgba(0,0,0,0) 75%);
  z-index: 0;
  pointer-events: none;
  filter: blur(100px);
}

/* ==========================================
   LEFT SIDEBAR NAVIGATION
   ========================================== */
.sidebar {
  width: 250px;
  min-width: 250px;
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 24px;
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
  user-select: none;
}

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

.nav-item.active {
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
  border-left-color: var(--accent-cyan);
  font-weight: 600;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sidebar-footer:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 242, 254, 0.25);
}

.sidebar-version {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #000;
  font-weight: bold;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ==========================================
   MAIN WORKSPACE
   ========================================== */
.main-workspace {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 5;
  overflow: hidden;
  position: relative;
}

.top-bar {
  height: 56px;
  min-height: 56px;
  border-bottom: 1px solid var(--glass-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.12);
}

.page-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-time {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
}

.view-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
}

.app-view {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.2s ease-out;
}

.app-view.hidden {
  display: none !important;
}

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

/* Scrollbar Styling */
.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 3px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

/* ==========================================
   DASHBOARD KPI GRID
   ========================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--card-color, var(--accent-cyan));
}

.metric-card:hover {
  transform: translateY(-1px);
  background: var(--panel-bg-hover);
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

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

.metric-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

/* Charts */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

.chart-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 16px;
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-wrapper {
  position: relative;
  height: 220px;
  width: 100%;
}

.chart-fallback {
  display: none;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: 100%;
  justify-content: flex-end;
  padding: 10px 0;
}

.chart-fallback.active {
  display: flex;
}

.chart-fallback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-fallback-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 100px;
  text-align: right;
}

.chart-fallback-bar-fill {
  height: 22px;
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.5s ease;
}

.chart-fallback-bar-value {
  font-size: 12px;
  color: #fff;
  font-weight: 600;
}

/* ==========================================
   TABLE VIEW
   ========================================== */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 12px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon-text {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 8px 12px 8px 34px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255,255,255,0.05);
}

.filter-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
  min-width: 140px;
  cursor: pointer;
}

.filter-select option {
  background-color: var(--bg-sidebar);
  color: #fff;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.1);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background: rgba(255, 255, 255, 0.02);
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px; /* Enhanced cell breathing space */
  border-bottom: 1px solid rgba(255, 255, 255, 0.04); /* Visible but subtle clean row separators */
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035); /* Crisp highlight feedback */
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
}

.badge-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

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

/* ==========================================
/* ==========================================
   iOS APP LAUNCHER FOR KNOWLEDGE HUB
   ========================================== */
.ios-hub-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.ios-hub-header {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  backdrop-filter: blur(20px);
}

.ios-hub-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ios-hub-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ios-hub-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

/* iOS Segmented Control Pills */
.ios-segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  align-items: center;
}

.ios-seg-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 7px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-seg-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.ios-seg-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.3);
}

/* iOS App Icon Grid */
.ios-app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 24px 20px;
  padding: 10px 0 30px;
}

.ios-app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ios-app-card:hover {
  transform: translateY(-6px) scale(1.04);
}

.ios-app-card:active {
  transform: scale(0.95);
}

.ios-app-icon {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #fff;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.15) inset;
  background-size: cover;
  background-position: center;
  transition: all 0.2s;
}

.ios-app-card:hover .ios-app-icon {
  box-shadow: 0 15px 35px rgba(0, 242, 254, 0.35), 0 0 0 1px rgba(255,255,255,0.3) inset;
}

.ios-app-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 10px;
  line-height: 1.3;
  max-width: 110px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ios-app-category-tag {
  font-size: 10px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ios-app-delete-btn {
  position: absolute;
  top: -6px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-rose);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.ios-app-edit-btn {
  position: absolute;
  top: -6px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}

.ios-app-card:hover .ios-app-delete-btn,
.ios-app-card:hover .ios-app-edit-btn {
  opacity: 1;
}

.ios-app-badge {
  position: absolute;
  bottom: 22px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #ff9800;
  border: 1px solid rgba(255, 152, 0, 0.4);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  z-index: 2;
}

/* iOS Icon Picker inside Modal */
.ios-icon-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-sizing: border-box;
  width: 100%;
}

.ios-icon-picker-item {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  user-select: none;
}

.ios-icon-picker-item:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 15px rgba(0, 242, 254, 0.4);
}

.ios-icon-picker-item.active {
  box-shadow: 0 0 0 3px var(--accent-cyan), 0 6px 15px rgba(0, 242, 254, 0.5);
  transform: scale(1.1);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.link-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s;
  position: relative;
}

.link-card:hover {
  background: var(--panel-bg-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.1);
  border-color: rgba(255,255,255,0.09);
}

.link-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.link-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.link-open-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(0, 242, 254, 0.06);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 14px;
}

.link-open-btn:hover {
  background: var(--accent-cyan);
  color: var(--bg-primary);
}

.link-note {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.link-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.link-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.02);
  padding-top: 8px;
}

.link-cat-badge {
  font-size: 10px;
  color: var(--accent-purple);
  font-weight: 600;
}

/* ==========================================
   FORMS & MANAGER
   ========================================== */
.manager-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.manager-form-panel {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.manager-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
}

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

.form-group label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-input {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255,255,255,0.05);
}

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

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.form-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--accent-cyan);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary:hover {
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
  transform: translateY(-0.5px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-weight: 500;
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon-delete {
  color: var(--accent-rose);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
  font-size: 14px;
}

.btn-icon-delete:hover {
  background: rgba(244, 63, 94, 0.08);
}

/* Cancel task button - amber warning */
.btn-cancel-task {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #f59e0b;
  font-weight: 600;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.btn-cancel-task:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* Delete task button - rose danger */
.btn-delete-task {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: var(--accent-rose);
  font-weight: 600;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.btn-delete-task:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.15);
}

/* Drag Drop Zone */
.drag-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.005);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drag-drop-zone:hover, .drag-drop-zone.dragging {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.02);
}

/* ==========================================
   SETTINGS
   ========================================== */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
}

.settings-nav {
  border-right: 1px solid var(--glass-border);
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.settings-nav-item:hover, .settings-nav-item.active {
  background: rgba(255,255,255,0.02);
  color: #fff;
}

.settings-nav-item.active {
  color: var(--accent-cyan);
  font-weight: 600;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.config-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.01);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
}

.color-preview {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

/* ==========================================
   SLIDE-OUT DRAWER
   ========================================== */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

.drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: rgba(13, 17, 26, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid var(--glass-border);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 850;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer.active {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.drawer-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  transition: color 0.2s;
}

.drawer-close:hover {
  color: #fff;
}

.drawer-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.5;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: rgba(255,255,255,0.015);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.detail-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.015);
  padding-bottom: 6px;
}

.detail-meta-item:last-child {
  border: none;
  padding-bottom: 0;
}

.detail-meta-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.detail-meta-value {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.detail-notes-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-notes-content {
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

/* Timeline Steps */
.workflow-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 8px;
  margin: 6px 0;
}

.workflow-timeline::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 15px;
  width: 1.5px;
  height: calc(100% - 16px);
  background: rgba(255,255,255,0.06);
  z-index: 1;
}

.timeline-step {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.timeline-step.clickable {
  cursor: pointer;
}
.timeline-step.clickable:hover .step-node {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.25);
  box-shadow: 0 0 6px rgba(0, 242, 254, 0.3);
}
.timeline-step.clickable:hover .step-label {
  color: #fff;
}

.step-node {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #1d2535;
  border: 2px solid rgba(255,255,255,0.12);
  transition: all 0.2s;
  flex-shrink: 0;
}

.timeline-step.completed .step-node {
  background: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.timeline-step.current .step-node {
  background: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.2);
  box-shadow: 0 0 8px var(--accent-cyan);
}

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

.timeline-step.completed .step-label {
  color: #fff;
  text-decoration: line-through;
  opacity: 0.5;
}

.timeline-step.current .step-label {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==========================================
   MODAL
   ========================================== */
.mapping-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

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

.mapping-modal {
  width: 440px;
  max-width: 90vw;
  background: var(--bg-sidebar);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================
   THEME SYSTEM - Multiple color schemes
   ========================================== */

/* Theme: Night (Default) - already set in :root */

/* Theme: Ocean */
[data-theme="ocean"] {
  --bg-primary: #0a1628;
  --bg-sidebar: #0f1f3d;
  --panel-bg: rgba(15, 35, 70, 0.5);
  --panel-bg-hover: rgba(20, 45, 85, 0.6);
  --glass-border: rgba(100, 180, 255, 0.08);
  --text-primary: #e8f0fe;
  --text-secondary: #8fadc8;
  --accent-cyan: #4fc3f7;
  --accent-purple: #7c4dff;
}

/* Theme: Sunset */
[data-theme="sunset"] {
  --bg-primary: #1a0e1e;
  --bg-sidebar: #2a1530;
  --panel-bg: rgba(50, 25, 55, 0.45);
  --panel-bg-hover: rgba(65, 35, 70, 0.55);
  --glass-border: rgba(255, 140, 200, 0.08);
  --text-primary: #fce4ec;
  --text-secondary: #c9889e;
  --accent-cyan: #ff6b9d;
  --accent-purple: #e040fb;
}

/* Theme: Forest */
[data-theme="forest"] {
  --bg-primary: #0a1510;
  --bg-sidebar: #0f2018;
  --panel-bg: rgba(15, 40, 25, 0.45);
  --panel-bg-hover: rgba(20, 55, 35, 0.55);
  --glass-border: rgba(100, 220, 150, 0.08);
  --text-primary: #e8f5e9;
  --text-secondary: #81c784;
  --accent-cyan: #69f0ae;
  --accent-purple: #b388ff;
}

/* Theme: Light */
[data-theme="light"] {
  --bg-primary: #f0f2f5;
  --bg-sidebar: #ffffff;
  --panel-bg: rgba(255, 255, 255, 0.92);
  --panel-bg-hover: rgba(240, 242, 248, 0.95);
  --glass-border: rgba(0, 0, 0, 0.10);
  --text-primary: #1a1a2e;
  --text-secondary: #475569;
  --accent-cyan: #0891b2;
  --accent-purple: #7c3aed;
}

[data-theme="light"] .sidebar {
  background-color: #fff;
  border-right-color: rgba(0,0,0,0.1);
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

[data-theme="light"] .nav-item {
  color: #374151;
}

[data-theme="light"] .nav-item.active {
  background: rgba(8, 145, 178, 0.10);
  color: #0891b2;
  border-left-color: #0891b2;
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0,0,0,0.04);
  color: #111827;
}

[data-theme="light"] .top-bar {
  background: rgba(255,255,255,0.85);
  border-bottom-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .page-title { color: #111827; font-weight: 700; }
[data-theme="light"] .drawer { background: rgba(255,255,255,0.98); border-left: 1px solid rgba(0,0,0,0.08); }
[data-theme="light"] .drawer-title { color: #111827; }
[data-theme="light"] .detail-meta-value { color: #111827; font-weight: 600; }
[data-theme="light"] .detail-meta-label { color: #475569; font-weight: 500; }
[data-theme="light"] .metric-value { color: #111827; }
[data-theme="light"] .metric-label { color: #475569; }
[data-theme="light"] .manager-title { color: #111827; }
[data-theme="light"] .settings-section-title { color: #111827; }
[data-theme="light"] .search-input { color: #111827; background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .search-input::placeholder { color: #94a3b8; }
[data-theme="light"] .filter-select { color: #111827; background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.1); }
[data-theme="light"] .filter-select option { background: #fff; color: #111827; }
[data-theme="light"] .form-input { color: #111827; background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.12); }
[data-theme="light"] .form-input::placeholder { color: #94a3b8; }
[data-theme="light"] label { color: #374151; }

/* Data table */
[data-theme="light"] .data-table th { color: #374151; background: rgba(0,0,0,0.03); font-weight: 700; }
[data-theme="light"] .data-table td { color: #1e293b; }
[data-theme="light"] .data-table tr:hover td { background: rgba(8,145,178,0.05); }
[data-theme="light"] .task-title { color: #111827; font-weight: 600; }
[data-theme="light"] .task-meta-sub { color: #475569; }

/* Drawer content */
[data-theme="light"] .detail-notes-content { background: rgba(0,0,0,0.04); color: #1e293b; border: 1px solid rgba(0,0,0,0.08); }
[data-theme="light"] .link-title { color: #111827; }
[data-theme="light"] .link-url { color: #0891b2; }
[data-theme="light"] .detail-section-title { color: #374151; font-weight: 700; }

/* Misc */
[data-theme="light"] .ambient-glow-1 { opacity: 0.2; }
[data-theme="light"] .ambient-glow-2 { opacity: 0.15; }
[data-theme="light"] .step-node { background: #e2e8f0; border-color: rgba(0,0,0,0.12); color: #1e293b; }
[data-theme="light"] .user-name { color: #111827; font-weight: 600; }
[data-theme="light"] .logo-text { color: #111827; }
[data-theme="light"] .chart-card { background: rgba(255,255,255,0.85); border: 1px solid rgba(0,0,0,0.08); }
[data-theme="light"] .config-item { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.08); color: #1e293b; }
[data-theme="light"] .mapping-modal { background: #fff; border: 1px solid rgba(0,0,0,0.12); }
[data-theme="light"] .modal-title { color: #111827; }
[data-theme="light"] .modal-backdrop { background: rgba(0,0,0,0.35); }
[data-theme="light"] .tab-btn { color: #475569; }
[data-theme="light"] .tab-btn.active { color: #0891b2; border-bottom-color: #0891b2; }
[data-theme="light"] .stat-strip { background: rgba(255,255,255,0.7); }
[data-theme="light"] .stat-value { color: #111827; }
[data-theme="light"] .stat-label { color: #475569; }
[data-theme="light"] .btn-secondary { color: #374151; background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .btn-secondary:hover { background: rgba(0,0,0,0.1); color: #111827; }

/* ── Calendar – Light Theme ── */
[data-theme="light"] .calendar-container {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

/* Calendar topbar */
[data-theme="light"] .calendar-topbar {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .calendar-month-title {
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #111827;
  background-clip: unset;
  color: #111827;
  font-weight: 800;
}

[data-theme="light"] .cal-nav-btn {
  color: #475569;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
}

[data-theme="light"] .cal-nav-btn:hover {
  background: rgba(8,145,178,0.12);
  color: #0891b2;
  border-color: #0891b2;
}

/* Day header row */
[data-theme="light"] .calendar-day-header-cell {
  color: #475569;
  font-weight: 700;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-theme="light"] .calendar-day-header-cell.is-sun { color: #dc2626; }
[data-theme="light"] .calendar-day-header-cell.is-sat { color: #0891b2; }

/* Month grid cells */
[data-theme="light"] .calendar-cell {
  border-right: 1px solid rgba(0,0,0,0.07);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.7);
}

[data-theme="light"] .calendar-cell:hover {
  background: rgba(8,145,178,0.06);
  box-shadow: inset 0 0 0 1px rgba(8,145,178,0.35);
}

[data-theme="light"] .calendar-cell.other-month {
  background: rgba(0,0,0,0.03);
  opacity: 0.75;
}

[data-theme="light"] .calendar-cell.is-today {
  background: rgba(8,145,178,0.07);
  box-shadow: inset 0 0 0 1.5px rgba(8,145,178,0.55);
}

[data-theme="light"] .calendar-day-num {
  color: #1e293b;
  font-weight: 700;
}

[data-theme="light"] .calendar-cell.is-weekend .calendar-day-num {
  color: #dc2626;
}

[data-theme="light"] .calendar-cell.is-today .calendar-day-num {
  background: linear-gradient(135deg, #0891b2, #7c3aed);
  color: #fff;
  box-shadow: 0 2px 8px rgba(8,145,178,0.4);
}

[data-theme="light"] .calendar-cell.is-today::after {
  background: #0891b2;
  color: #fff;
}

/* Legend */
[data-theme="light"] .cal-legend-badge {
  color: #1e293b;
  background: rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.12);
}

/* Event chips in light mode — solid, visible colours */
[data-theme="light"] .cal-event-chip.shared {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fbbf24;
}

[data-theme="light"] .cal-event-chip.personal {
  background: #cffafe;
  color: #155e75;
  border: 1px solid #22d3ee;
}

[data-theme="light"] .cal-event-chip.google {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #60a5fa;
}

[data-theme="light"] .cal-event-chip.task-due {
  background: #f3e8ff;
  color: #5b21b6;
  border: 1px solid #a78bfa;
}

/* Overflow badge */
[data-theme="light"] .cal-overflow-badge {
  color: #475569;
  font-weight: 600;
}

/* View mode tabs */
[data-theme="light"] .cal-view-modes {
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
}

[data-theme="light"] .cal-view-tab {
  color: #475569;
}

[data-theme="light"] .cal-view-tab:hover {
  background: rgba(0,0,0,0.06);
  color: #111827;
}

[data-theme="light"] .cal-view-tab.active {
  background: linear-gradient(135deg, rgba(8,145,178,0.2), rgba(124,58,237,0.2));
  color: #0891b2;
  border: 1px solid rgba(8,145,178,0.5);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(8,145,178,0.15);
}

/* Day view - light */
[data-theme="light"] .cal-day-schedule-card {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

[data-theme="light"] .cal-day-title-text {
  color: #111827;
}

[data-theme="light"] .cal-day-item-card {
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.08);
}

[data-theme="light"] .cal-day-item-card:hover {
  background: rgba(8,145,178,0.06);
  border-color: rgba(8,145,178,0.35);
}

[data-theme="light"] .cal-day-item-title {
  color: #111827;
  font-weight: 700;
}

[data-theme="light"] .cal-day-item-notes {
  color: #475569;
}

[data-theme="light"] .cal-day-item-time {
  color: #0891b2;
  background: rgba(8,145,178,0.1);
}

/* Week view - light */
[data-theme="light"] .cal-week-grid {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

[data-theme="light"] .cal-week-col {
  border-right: 1px solid rgba(0,0,0,0.07);
  background: rgba(255,255,255,0.5);
}

[data-theme="light"] .cal-week-col.is-today {
  background: rgba(8,145,178,0.05);
}

[data-theme="light"] .cal-week-col-header {
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-theme="light"] .cal-week-day-name {
  color: #475569;
}

[data-theme="light"] .cal-week-day-num {
  color: #111827;
}

[data-theme="light"] .cal-week-col.is-today .cal-week-day-num {
  background: linear-gradient(135deg, #0891b2, #7c3aed);
  color: #fff;
}

/* Year view - light */
[data-theme="light"] .cal-mini-month-card {
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

[data-theme="light"] .cal-mini-month-card:hover {
  border-color: rgba(8,145,178,0.5);
  box-shadow: 0 8px 24px rgba(8,145,178,0.12);
}

[data-theme="light"] .cal-mini-month-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

[data-theme="light"] .cal-mini-month-title {
  color: #111827;
}

[data-theme="light"] .cal-mini-badge {
  background: rgba(8,145,178,0.12);
  color: #0891b2;
}

[data-theme="light"] .cal-mini-day-head {
  color: #475569;
}

[data-theme="light"] .cal-mini-cell {
  color: #374151;
}

[data-theme="light"] .cal-mini-cell.has-events {
  background: rgba(8,145,178,0.12);
  color: #0891b2;
}

[data-theme="light"] .cal-mini-cell.has-events::after {
  background: #0891b2;
}

[data-theme="light"] .cal-mini-cell.is-today {
  background: #0891b2 !important;
  color: #fff !important;
}



/* ==========================================
   THEME TOGGLE BUTTON
   ========================================== */
.theme-switcher {
  position: relative;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--panel-bg);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  white-space: nowrap;
}

.theme-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent-cyan);
}

.theme-label {
  font-size: 11px;
  font-weight: 500;
}

/* ==========================================
   HAMBURGER MENU BUTTON
   ========================================== */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.hamburger-btn:hover {
  background: rgba(255,255,255,0.05);
}

.hamburger-topbar {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.hamburger-topbar:hover {
  background: rgba(255,255,255,0.05);
}

/* Mobile Sidebar Overlay */
.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 3000;
}

.sidebar-mobile-overlay.active {
  display: block;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Tablet / Narrow screens */
@media (max-width: 1100px) {
  .charts-container { grid-template-columns: 1fr; }
  .manager-layout { grid-template-columns: 1fr; }
}

/* Small tablet */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -270px;
    top: 0;
    width: 250px;
    min-width: 250px;
    height: 100dvh;
    height: 100vh;
    z-index: 3100 !important;
    padding-bottom: 85px !important;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 35px rgba(0,0,0,0.6);
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .hamburger-topbar { display: block; }
  .hamburger-btn { display: block; }

  .knowledge-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { border-right: none; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; flex-direction: row; gap: 8px; }

  .drawer { width: 320px; right: -340px; }

  .view-container { padding: 16px; }
  .theme-label { display: none; }
}

/* Mobile phone */
@media (max-width: 600px) {
  .sidebar {
    width: 240px;
    min-width: 240px;
    left: -250px;
    padding-bottom: 85px !important;
  }

  .filter-bar { flex-direction: column; }
  .search-input-wrapper { min-width: unset; width: 100%; }
  .filter-select { width: 100%; }

  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .link-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }

  #add-link-form { flex-wrap: wrap !important; }
  #add-link-form .form-input { flex: unset !important; width: 100%; }

  .drawer { width: 100vw; right: -100vw; }
  .drawer.active { right: 0; }

  .view-container { padding: 12px; }
  .top-bar { padding: 0 12px; }
}

@media (max-width: 400px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   LOGIN & AUTH SYSTEM
   ========================================== */
.login-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: var(--bg-primary);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease;
}

.login-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.login-box {
  width: 420px;
  max-width: 92vw;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 42px 40px 36px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,242,254,0.06);
  animation: loginSlideUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

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

.login-field {
  margin-bottom: 15px;
}

.login-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
}

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

.login-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  padding: 11px 40px 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.login-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.07);
}

.login-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 15px;
  opacity: 0.45;
  transition: opacity 0.2s;
  padding: 4px;
  line-height: 1;
}

.login-eye-btn:hover { opacity: 1; }

.login-error {
  font-size: 12px;
  color: var(--accent-rose);
  min-height: 18px;
  transition: all 0.2s;
}

.login-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  font-weight: 700;
  font-size: 14px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 8px;
  letter-spacing: 0.02em;
  font-family: var(--font-main);
}

.login-submit-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 242, 254, 0.28);
}

.login-submit-btn:active { transform: translateY(0); }

/* User list items in settings */
.user-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.user-list-item:hover {
  background: rgba(255,255,255,0.035);
}

.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #000;
  flex-shrink: 0;
}

.user-list-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-list-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.role-badge {
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.role-badge.admin {
  background: rgba(189, 92, 255, 0.15);
  color: var(--accent-purple);
  border: 1px solid rgba(189, 92, 255, 0.3);
}

.role-badge.editor {
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
}

.role-badge.viewer {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(156, 163, 175, 0.2);
}

.role-badge.staff {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ==========================================
   MINIMALIST TASK TRACKER & KPI STYLING
   ========================================== */

/* 1. Stat Strip on top of Task Tracker */
.tasks-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-strip-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.stat-strip-card:hover {
  background: rgba(255, 255, 255, 0.035);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.1);
}

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

.stat-strip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-strip-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-feature-settings: "tnum";
}

.stat-strip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.03);
}

/* 2. Refined Minimal Data Table */
.data-table th {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.task-title-cell {
  max-width: 340px;
}

.task-title-text {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-meta-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3. Modern KPI Status Pills */
.kpi-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.kpi-pill.ontime {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.kpi-pill.late {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.kpi-pill.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.kpi-pill.neutral {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-secondary);
  border: 1px solid rgba(156, 163, 175, 0.2);
}

/* 4. Minimalist Sectioned Modal Form */
.modal-form-section {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 2px;
}

.modal-section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-preview-box {
  background: rgba(0, 242, 254, 0.03);
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.kpi-preview-title {
  color: var(--text-secondary);
}

.kpi-preview-result {
  font-weight: 700;
}

/* 5. Minimal Drawer KPI Scorecard */
.drawer-kpi-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}

.drawer-kpi-label {
  color: var(--text-secondary);
}

.drawer-kpi-val {
  font-weight: 600;
  color: var(--text-primary);
}

/* 6. Minimalist Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  transition: .25s ease;
  border-radius: 22px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #9ca3af;
  transition: .25s ease;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #10b981;
}

/* ==========================================
   MINIMALIST CALENDAR & ASSIGNEE/REF STYLING
   ========================================== */

/* Task ID and Reference Number Badges */
.task-id-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(0, 242, 254, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
  font-family: var(--font-mono, monospace);
}

.task-ref-text {
  font-size: 11px;
  color: #93c5fd;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-assignee-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================
   MODERN CALENDAR & SCHEDULE MODULE (FUTURISTIC GLASS)
   ========================================== */
.calendar-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* 1. Futuristic Glass Topbar */
.calendar-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px 22px;
  flex-wrap: wrap;
  gap: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.calendar-month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cal-nav-btn:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.calendar-month-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 190px;
  text-align: center;
  user-select: none;
}

.cal-today-btn {
  padding: 8px 16px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  border-color: rgba(0, 242, 254, 0.3) !important;
  color: var(--accent-cyan) !important;
  background: rgba(0, 242, 254, 0.05) !important;
  transition: all 0.2s ease !important;
}

.cal-today-btn:hover {
  background: rgba(0, 242, 254, 0.15) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2) !important;
}

.calendar-actions-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.calendar-legend-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-legend-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.cal-legend-badge .legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.cal-legend-badge.badge-shared { color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); }
.cal-legend-badge.badge-shared .legend-dot { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

.cal-legend-badge.badge-personal { color: var(--accent-cyan); border-color: rgba(0, 242, 254, 0.3); background: rgba(0, 242, 254, 0.08); }
.cal-legend-badge.badge-personal .legend-dot { background: var(--accent-cyan); box-shadow: 0 0 6px var(--accent-cyan); }

.cal-legend-badge.badge-google { color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.1); }
.cal-legend-badge.badge-google .legend-dot { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }

.cal-legend-badge.badge-task { color: #c084fc; border-color: rgba(189, 92, 255, 0.3); background: rgba(189, 92, 255, 0.08); }
.cal-legend-badge.badge-task .legend-dot { background: #c084fc; box-shadow: 0 0 6px #c084fc; }

.calendar-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cal-quick-btn {
  padding: 7px 13px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  border-radius: 9px !important;
}

.cal-add-btn {
  padding: 7px 16px !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
}

/* 2. Main Calendar Grid */
.calendar-main-grid {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.calendar-day-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid var(--glass-border);
}

.calendar-day-header-cell {
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.calendar-day-header-cell .header-short { display: none; }
.calendar-day-header-cell.is-sun { color: var(--accent-rose); }
.calendar-day-header-cell.is-sat { color: var(--accent-cyan); }

@media (max-width: 768px) {
  .calendar-day-header-cell .header-full { display: none; }
  .calendar-day-header-cell .header-short { display: inline; }
}

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

/* 3. Individual Day Cell */
.calendar-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  height: 130px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.005);
}

.calendar-cell:nth-child(7n) {
  border-right: none;
}

.calendar-cell:hover {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(0, 242, 254, 0.25);
  z-index: 2;
}

.calendar-cell.other-month {
  opacity: 0.65;
  background: rgba(0, 0, 0, 0.2);
}

.calendar-cell.other-month .calendar-day-num {
  color: var(--text-secondary);
  opacity: 0.85;
}

.calendar-cell.is-today {
  background: rgba(0, 242, 254, 0.04);
  box-shadow: inset 0 0 0 1.5px rgba(0, 242, 254, 0.5);
}

.calendar-cell.is-today::after {
  content: 'วันนี้';
  position: absolute;
  top: 7px;
  right: 8px;
  font-size: 9px;
  font-weight: 800;
  color: #000;
  background: var(--accent-cyan);
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

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

.calendar-day-num {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.calendar-cell.is-today .calendar-day-num {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 242, 254, 0.4);
}

.calendar-cell.is-weekend .calendar-day-num {
  color: #fda4af;
}

/* 4. Event Chips Container & Items */
.calendar-events-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.cal-event-chip {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cal-event-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

.cal-event-chip.shared {
  background: rgba(245, 158, 11, 0.16);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.cal-event-chip.personal {
  background: rgba(0, 242, 254, 0.13);
  color: #a5f3fc;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.cal-event-chip.google {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.cal-event-chip.task-due {
  background: rgba(189, 92, 255, 0.15);
  color: #e9d5ff;
  border: 1px solid rgba(189, 92, 255, 0.35);
}

/* Note chips in calendar — distinct pink with emoji prefix */
.cal-event-chip.note-cal-chip {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
  cursor: pointer;
}
.cal-event-chip.note-cal-chip:hover {
  background: rgba(244, 63, 94, 0.28);
  color: #fff;
  transform: translateY(-1px);
}

/* Note items in Day view */
.cal-day-item-card.note-cal-item {
  border-left: 3px solid #f43f5e;
}
.cal-day-item-card.note-cal-item:hover {
  background: rgba(244, 63, 94, 0.08);
}


/* Event Details Modal */
.event-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  gap: 10px;
}

/* ==========================================
   VIEW MODES: DAY, WEEK, YEAR
   ========================================== */

/* 1. View Switcher Pill Tabs */
.cal-view-modes {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-left: 8px;
}

.cal-view-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cal-view-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.cal-view-tab.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.25), rgba(189, 92, 255, 0.25));
  color: #fff;
  border: 1px solid rgba(0, 242, 254, 0.4);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 242, 254, 0.2);
}

/* 2. Day View (Hourly Schedule / Event Timeline) */
.cal-day-view-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  width: 100%;
}

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

.cal-day-schedule-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.cal-day-title-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.cal-day-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding-right: 4px;
}

.cal-day-item-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.cal-day-item-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(4px);
  border-color: rgba(0, 242, 254, 0.3);
}

.cal-day-item-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  min-width: 60px;
  padding: 4px 8px;
  background: rgba(0, 242, 254, 0.08);
  border-radius: 8px;
  text-align: center;
  flex-shrink: 0;
}

.cal-day-item-content {
  flex: 1;
}

.cal-day-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.cal-day-item-notes {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* 3. Week View (7 Full Columns with Clear Time Slots & Rich Cards) */
.cal-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

.cal-week-col {
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  min-height: 480px;
  background: rgba(255, 255, 255, 0.005);
}

.cal-week-col:last-child {
  border-right: none;
}

.cal-week-col.is-today {
  background: rgba(0, 242, 254, 0.025);
}

.cal-week-col-header {
  padding: 12px 8px;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--glass-border);
}

.cal-week-day-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.cal-week-day-num {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.cal-week-col.is-today .cal-week-day-num {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  box-shadow: 0 2px 8px rgba(0, 242, 254, 0.4);
}

.cal-week-events-body {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.cal-week-card {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.cal-week-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

/* 4. Year View (12 Minimalist Mini-Calendars with Event Density Heatmap) */
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1200px) {
  .cal-year-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 800px) {
  .cal-year-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .cal-year-grid { grid-template-columns: 1fr; }
}

.cal-mini-month-card {
  background: var(--panel-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cal-mini-month-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 10px 25px rgba(0, 242, 254, 0.15);
}

.cal-mini-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cal-mini-month-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.cal-mini-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
}

.cal-mini-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  font-size: 10px;
  text-align: center;
}

.cal-mini-day-head {
  font-weight: 700;
  color: var(--text-secondary);
  padding-bottom: 3px;
}

.cal-mini-cell {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
}

.cal-mini-cell.has-events {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  font-weight: 700;
}

.cal-mini-cell.has-events::after {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-cyan);
  position: absolute;
  bottom: 2px;
}

.cal-mini-cell.is-today {
  background: var(--accent-cyan) !important;
  color: #000 !important;
  font-weight: 800;
}



/* ================================================================
   PERSONAL NOTES SYSTEM — v146
   ================================================================ */

/* ---- Notes View Layout ---- */
.notes-view-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100%;
  overflow: hidden;
}

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.notes-search-wrapper {
  flex: 1;
  min-width: 180px;
  position: relative;
}

.notes-search-wrapper .search-icon-text {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}

.notes-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--glass-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.08));
  border-radius: 10px;
  color: var(--text-primary, #fff);
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.notes-search-input:focus { border-color: var(--accent-cyan, #00f2fe); }

/* ---- Filter Tabs ---- */
.notes-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.notes-filter-tab {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.1));
  background: transparent;
  color: var(--text-secondary, #aaa);
  font-family: 'Prompt', sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}
.notes-filter-tab:hover { border-color: var(--accent-cyan, #00f2fe); color: var(--text-primary, #fff); }
.notes-filter-tab.active {
  background: linear-gradient(135deg, var(--accent-cyan, #00f2fe), var(--accent-purple, #bd5cff));
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

/* ---- Notes Board ---- */
.notes-board {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.notes-board::-webkit-scrollbar { width: 5px; }
.notes-board::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.notes-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary, #aaa);
  margin: 0 0 10px 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

/* ---- Note Card ---- */
.note-card {
  border-radius: 14px;
  padding: 14px 14px 12px;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1.5px solid transparent;
  min-height: 120px;
}
.note-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); }

/* ---- Note Card Color Themes (Dark palette — classic) ---- */
.note-card.color-amber    { background: linear-gradient(135deg, #2d1f00, #3d2a00); border-color: #f59e0b55; }
.note-card.color-amber    .note-card-title  { color: #fcd34d; }
.note-card.color-amber    .note-card-content { color: rgba(252,211,77,0.85); }
.note-card.color-amber    .note-action-btn  { color: rgba(252,211,77,0.6); }

.note-card.color-orange   { background: linear-gradient(135deg, #2d1100, #3d1a00); border-color: #f9731655; }
.note-card.color-orange   .note-card-title  { color: #fb923c; }
.note-card.color-orange   .note-card-content { color: rgba(251,146,60,0.85); }
.note-card.color-orange   .note-action-btn  { color: rgba(251,146,60,0.6); }

.note-card.color-rose     { background: linear-gradient(135deg, #2d0014, #3d0020); border-color: #f43f5e55; }
.note-card.color-rose     .note-card-title  { color: #fb7185; }
.note-card.color-rose     .note-card-content { color: rgba(251,113,133,0.85); }
.note-card.color-rose     .note-action-btn  { color: rgba(251,113,133,0.6); }

.note-card.color-emerald  { background: linear-gradient(135deg, #00231a, #003026); border-color: #10b98155; }
.note-card.color-emerald  .note-card-title  { color: #34d399; }
.note-card.color-emerald  .note-card-content { color: rgba(52,211,153,0.85); }
.note-card.color-emerald  .note-action-btn  { color: rgba(52,211,153,0.6); }

.note-card.color-cyan     { background: linear-gradient(135deg, #00202d, #002d3d); border-color: #00f2fe55; }
.note-card.color-cyan     .note-card-title  { color: #67e8f9; }
.note-card.color-cyan     .note-card-content { color: rgba(103,232,249,0.85); }
.note-card.color-cyan     .note-action-btn  { color: rgba(103,232,249,0.6); }

.note-card.color-purple   { background: linear-gradient(135deg, #1a0d2d, #250d3d); border-color: #bd5cff55; }
.note-card.color-purple   .note-card-title  { color: #c084fc; }
.note-card.color-purple   .note-card-content { color: rgba(192,132,252,0.85); }
.note-card.color-purple   .note-action-btn  { color: rgba(192,132,252,0.6); }

.note-card.color-dark     { background: linear-gradient(135deg, #111827, #1f2937); border-color: rgba(255,255,255,0.12); }
.note-card.color-dark     .note-card-title  { color: #f1f5f9; }
.note-card.color-dark     .note-card-content { color: rgba(241,245,249,0.75); }
.note-card.color-dark     .note-action-btn  { color: rgba(241,245,249,0.5); }

/* ---- Pastel Shades — light background, dark readable text ---- */
.note-card.color-pastel-pink     { background: linear-gradient(135deg, #fce7f3, #fbcfe8); border-color: #ec489966; }
.note-card.color-pastel-pink     .note-card-title   { color: #9d174d; }
.note-card.color-pastel-pink     .note-card-content  { color: #831843; }
.note-card.color-pastel-pink     .note-action-btn   { color: #be185d; }
.note-card.color-pastel-pink     .note-card-footer  { color: #9d174d; }
.note-card.color-pastel-pink     .note-checklist-item { color: #831843; }
.note-card.color-pastel-pink     .note-reminder-badge { background: rgba(157,23,77,0.15); color: #9d174d; }

.note-card.color-pastel-peach    { background: linear-gradient(135deg, #fff7ed, #fed7aa); border-color: #f9731655; }
.note-card.color-pastel-peach    .note-card-title   { color: #9a3412; }
.note-card.color-pastel-peach    .note-card-content  { color: #7c2d12; }
.note-card.color-pastel-peach    .note-action-btn   { color: #c2410c; }
.note-card.color-pastel-peach    .note-card-footer  { color: #9a3412; }
.note-card.color-pastel-peach    .note-checklist-item { color: #7c2d12; }

.note-card.color-pastel-yellow   { background: linear-gradient(135deg, #fefce8, #fef08a); border-color: #ca8a0455; }
.note-card.color-pastel-yellow   .note-card-title   { color: #713f12; }
.note-card.color-pastel-yellow   .note-card-content  { color: #78350f; }
.note-card.color-pastel-yellow   .note-action-btn   { color: #92400e; }
.note-card.color-pastel-yellow   .note-card-footer  { color: #713f12; }
.note-card.color-pastel-yellow   .note-checklist-item { color: #78350f; }

.note-card.color-pastel-mint     { background: linear-gradient(135deg, #ecfdf5, #a7f3d0); border-color: #10b98155; }
.note-card.color-pastel-mint     .note-card-title   { color: #064e3b; }
.note-card.color-pastel-mint     .note-card-content  { color: #065f46; }
.note-card.color-pastel-mint     .note-action-btn   { color: #047857; }
.note-card.color-pastel-mint     .note-card-footer  { color: #064e3b; }
.note-card.color-pastel-mint     .note-checklist-item { color: #065f46; }

.note-card.color-pastel-sky      { background: linear-gradient(135deg, #f0f9ff, #bae6fd); border-color: #0ea5e955; }
.note-card.color-pastel-sky      .note-card-title   { color: #0c4a6e; }
.note-card.color-pastel-sky      .note-card-content  { color: #075985; }
.note-card.color-pastel-sky      .note-action-btn   { color: #0369a1; }
.note-card.color-pastel-sky      .note-card-footer  { color: #0c4a6e; }
.note-card.color-pastel-sky      .note-checklist-item { color: #075985; }

.note-card.color-pastel-lavender { background: linear-gradient(135deg, #f5f3ff, #ddd6fe); border-color: #7c3aed55; }
.note-card.color-pastel-lavender .note-card-title   { color: #4c1d95; }
.note-card.color-pastel-lavender .note-card-content  { color: #5b21b6; }
.note-card.color-pastel-lavender .note-action-btn   { color: #6d28d9; }
.note-card.color-pastel-lavender .note-card-footer  { color: #4c1d95; }
.note-card.color-pastel-lavender .note-checklist-item { color: #5b21b6; }

.note-card.color-pastel-sage     { background: linear-gradient(135deg, #f0fdf4, #bbf7d0); border-color: #16a34a55; }
.note-card.color-pastel-sage     .note-card-title   { color: #14532d; }
.note-card.color-pastel-sage     .note-card-content  { color: #166534; }
.note-card.color-pastel-sage     .note-action-btn   { color: #15803d; }
.note-card.color-pastel-sage     .note-card-footer  { color: #14532d; }
.note-card.color-pastel-sage     .note-checklist-item { color: #166534; }

.note-card.color-pastel-cream    { background: linear-gradient(135deg, #fffbeb, #fef3c7); border-color: #d9770655; }
.note-card.color-pastel-cream    .note-card-title   { color: #78350f; }
.note-card.color-pastel-cream    .note-card-content  { color: #92400e; }
.note-card.color-pastel-cream    .note-action-btn   { color: #b45309; }
.note-card.color-pastel-cream    .note-card-footer  { color: #78350f; }
.note-card.color-pastel-cream    .note-checklist-item { color: #92400e; }

/* ---- Universal Pastel Note Card Rules (Ensures dark, crystal-clear text on light pastel backgrounds) ---- */
.note-card[class*="color-pastel-"] {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.note-card[class*="color-pastel-"] .note-card-title {
  font-weight: 700;
}
.note-card[class*="color-pastel-"] .note-card-content {
  font-weight: 500;
  opacity: 0.95;
}
.note-card[class*="color-pastel-"] .note-checklist-item {
  font-weight: 500;
}
.note-card[class*="color-pastel-"] .note-checklist-item span {
  color: inherit !important;
}
.note-card[class*="color-pastel-"] .note-checklist-item.done span {
  color: rgba(0, 0, 0, 0.42) !important;
  text-decoration: line-through !important;
}
.note-card[class*="color-pastel-"] .note-action-btn {
  color: rgba(0, 0, 0, 0.45);
}
.note-card[class*="color-pastel-"] .note-action-btn:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.08);
}
.note-card[class*="color-pastel-"] .note-date-text {
  color: rgba(0, 0, 0, 0.55) !important;
  font-weight: 600;
}
.note-card[class*="color-pastel-"] .note-checklist-more {
  color: rgba(0, 0, 0, 0.5) !important;
}
/* High contrast badges inside pastel cards */
.note-card[class*="color-pastel-"] .note-badge.reminder-upcoming {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.2) !important;
  font-weight: 700;
}
.note-card[class*="color-pastel-"] .note-badge.reminder-overdue {
  background: rgba(225, 29, 72, 0.14) !important;
  color: #be123c !important;
  border: 1px solid rgba(225, 29, 72, 0.3) !important;
  font-weight: 700;
}
.note-card[class*="color-pastel-"] .note-badge.calendar-badge {
  background: rgba(109, 40, 217, 0.12) !important;
  color: #6d28d9 !important;
  border: 1px solid rgba(109, 40, 217, 0.25) !important;
  font-weight: 700;
}

/* Pinned glow */
.note-card.pinned { box-shadow: 0 0 0 2px #f59e0b88, 0 4px 20px rgba(245,158,11,0.2); }
.note-card.pinned .note-pin-btn { color: #f59e0b !important; }

/* Overdue pulse */
.note-card.overdue {
  animation: noteOverduePulse 2s ease-in-out infinite;
}
@keyframes noteOverduePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,63,94,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(244,63,94,0); }
}

/* ---- Card Header ---- */
.note-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.note-card-title {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  line-height: 1.35;
  flex: 1;
  word-break: break-word;
}

.note-card-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.18s;
}
.note-card:hover .note-card-actions { opacity: 1; }

.note-action-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s, background 0.15s;
}
.note-action-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.note-pin-btn { font-size: 13px; }

/* ---- Card Content ---- */
.note-card-content {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}

/* ---- Checklist ---- */
.note-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.note-checklist-item {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  padding: 2px 0;
}
.note-checklist-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent-cyan, #00f2fe);
  cursor: pointer;
  flex-shrink: 0;
}
.note-checklist-item.done span { text-decoration: line-through; color: rgba(255,255,255,0.45); }
.note-checklist-more { color: rgba(255,255,255,0.45); }

/* ---- Card Footer / Badges ---- */
.note-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.note-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.note-badge.reminder-upcoming { background: rgba(0,242,254,0.18); color: #67e8f9; }
.note-badge.reminder-overdue  { background: rgba(244,63,94,0.22);  color: #fb7185; }
.note-badge.calendar-badge    { background: rgba(189,92,255,0.18); color: #d8b4fe; }

.note-date-text {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-left: auto;
}

/* ---- Sidebar Badge ---- */
.note-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent-rose, #f43f5e);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  line-height: 1;
}

/* ---- Note Modal Overlay ---- */
.note-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3500;
  padding: 16px;
}
.note-modal-overlay.hidden { display: none; }

.note-modal-box {
  background: #16192a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  padding: 24px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.note-modal-box::-webkit-scrollbar { width: 4px; }
.note-modal-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ---- Note modal inputs — always visible white text on dark modal ---- */
.note-modal-box .form-input {
  background: rgba(255,255,255,0.08) !important;
  border: 1.5px solid rgba(255,255,255,0.18) !important;
  color: #fff !important;
  font-size: 13px;
}
.note-modal-box .form-input:focus {
  background: rgba(255,255,255,0.12) !important;
  border-color: var(--accent-cyan, #00f2fe) !important;
  box-shadow: 0 0 0 2px rgba(0,242,254,0.15);
}
.note-modal-box .form-input::placeholder { color: rgba(255,255,255,0.45) !important; }
#note-input-title { font-size: 15px !important; font-weight: 700 !important; }
#note-input-content { min-height: 110px; }

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

.note-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.note-modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary, #aaa);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s;
}
.note-modal-close:hover { color: #fff; }

/* Color Picker */
.note-color-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.note-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.note-color-swatch:hover { transform: scale(1.15); }
.note-color-swatch.selected { border-color: #fff; transform: scale(1.15); box-shadow: 0 0 8px rgba(255,255,255,0.8); }
.note-color-swatch.sw-amber   { background: #f59e0b; }
.note-color-swatch.sw-orange  { background: #f97316; }
.note-color-swatch.sw-rose    { background: #f43f5e; }
.note-color-swatch.sw-emerald { background: #10b981; }
.note-color-swatch.sw-cyan    { background: #00f2fe; }
.note-color-swatch.sw-purple  { background: #bd5cff; }
.note-color-swatch.sw-dark    { background: #374151; }
.note-color-swatch.sw-pastel-pink     { background: #f472b6; }
.note-color-swatch.sw-pastel-peach    { background: #fb923c; }
.note-color-swatch.sw-pastel-yellow   { background: #facc15; }
.note-color-swatch.sw-pastel-mint     { background: #4ade80; }
.note-color-swatch.sw-pastel-sky      { background: #38bdf8; }
.note-color-swatch.sw-pastel-lavender { background: #a78bfa; }
.note-color-swatch.sw-pastel-sage     { background: #86efac; }
.note-color-swatch.sw-pastel-cream    { background: #fde68a; }

/* Checklist editor */
.note-checklist-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.note-checklist-editor-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.note-checklist-editor-item input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff;
  padding: 6px 10px;
  font-family: 'Prompt', sans-serif;
  font-size: 12px;
  outline: none;
}
.note-checklist-editor-item input[type="text"]:focus { border-color: var(--accent-cyan, #00f2fe); }
.note-checklist-remove-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  transition: color 0.15s;
}
.note-checklist-remove-btn:hover { color: var(--accent-rose, #f43f5e); }

/* Toggle switch for show-on-calendar and reminder */
.note-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
}
.note-toggle-label { font-size: 13px; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 6px; }

.note-toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.note-toggle-switch input { opacity: 0; width: 0; height: 0; }
.note-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.25s;
}
.note-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
}
.note-toggle-switch input:checked + .note-toggle-slider { background: var(--accent-cyan, #00f2fe); }
.note-toggle-switch input:checked + .note-toggle-slider::before { transform: translateX(18px); }

.note-reminder-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---- Floating Action Button (FAB) ---- */
.note-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 3000;
  background: linear-gradient(135deg, #00f2fe, #bd5cff);
  color: #000;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Prompt', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,242,254,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}
.note-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 30px rgba(0,242,254,0.4); }

/* ---- Quick Note Drawer ---- */
.note-quick-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: #111827;
  border-left: 1px solid rgba(255,255,255,0.1);
  z-index: 4000;
  transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 14px;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
}
.note-quick-drawer.open { right: 0; }
.note-quick-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3999;
  display: none;
}
.note-quick-drawer-backdrop.open { display: block; }

.note-quick-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.note-quick-drawer-title { font-size: 15px; font-weight: 700; color: #fff; }

/* ---- Empty State ---- */
.notes-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary, #aaa);
}
.notes-empty-state .empty-icon { font-size: 48px; opacity: 0.4; }
.notes-empty-state p { font-size: 14px; margin: 0; }

/* Responsive */
/* Mobile Responsive Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    z-index: 2500;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
  }

  .mobile-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: 'Prompt', sans-serif;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    flex: 1;
    transition: color 0.15s;
  }
  .mobile-nav-btn.active {
    color: var(--accent-cyan);
    font-weight: 600;
  }
  .mobile-nav-btn .m-icon {
    font-size: 18px;
    margin-bottom: 2px;
  }
  .mobile-nav-btn .m-badge {
    position: absolute;
    top: 3px;
    right: 18%;
    background: var(--accent-rose);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 4px;
    min-width: 14px;
    line-height: 1.2;
    text-align: center;
  }

  /* Make room for bottom nav so content is not obscured */
  .view-container {
    padding-bottom: 74px !important;
  }
  .note-fab {
    bottom: 72px !important;
  }

  /* Notes View Mobile Enhancements */
  #view-notes {
    min-height: calc(100vh - 160px);
    overflow: visible;
  }
  .notes-view-container {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }
  .notes-board {
    overflow: visible !important;
    height: auto !important;
    padding-right: 0 !important;
  }
  .notes-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .notes-filter-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding-bottom: 6px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .notes-filter-tab {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .notes-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
}

/* ============================================================
   TOPBAR REFRESH BUTTON (F5 REFRESH ICON)
   ============================================================ */
.topbar-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-family: 'Prompt', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.topbar-refresh-btn:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: #fff;
}
.topbar-refresh-btn.spinning .refresh-icon,
.btn-secondary.spinning .refresh-icon {
  display: inline-block;
  animation: refreshSpin 0.75s linear infinite;
}
@keyframes refreshSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
  .topbar-refresh-btn {
    padding: 6px 9px;
  }
  .topbar-refresh-btn .refresh-text {
    display: none;
  }
}

/* Topbar Logout Button */
.topbar-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose, #f43f5e);
  font-family: 'Prompt', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.topbar-logout-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose, #f43f5e);
  color: #fff;
  transform: translateY(-1px);
}
@media (max-width: 600px) {
  .topbar-logout-btn {
    padding: 6px 8px;
  }
  .topbar-logout-btn .logout-text {
    display: none;
  }
}

/* ============================================================
   GOOGLE SHEETS MODULE & TABS
   ============================================================ */
.tasks-module-tabs {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tasks-module-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: 'Prompt', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.tasks-module-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}
.tasks-module-tab.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(189, 92, 255, 0.15));
  border-color: rgba(0, 242, 254, 0.4);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.1);
}
.tasks-module-tab .tab-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
}
.tasks-module-tab.active .tab-badge {
  background: var(--accent-cyan, #00f2fe);
  color: #0b0f19;
}

/* Sheet KPI Strip */
.sheet-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.sheet-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg, rgba(255,255,255,0.03));
  border: 1px solid var(--glass-border);
  padding: 12px 16px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
}
.sheet-kpi-icon {
  font-size: 24px;
}
.sheet-kpi-content {
  display: flex;
  flex-direction: column;
}
.sheet-kpi-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.sheet-kpi-val {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.sheet-kpi-card.step-1 { border-left: 3px solid #38bdf8; }
.sheet-kpi-card.step-2 { border-left: 3px solid #f59e0b; }
.sheet-kpi-card.step-3 { border-left: 3px solid #a855f7; }
.sheet-kpi-card.step-4 { border-left: 3px solid #6366f1; }
.sheet-kpi-card.step-5 { border-left: 3px solid #10b981; }
.sheet-kpi-card.step-6 { border-left: 3px solid #14b8a6; }
.sheet-kpi-card.step-cancelled { border-left: 3px solid #ef4444; }
.sheet-kpi-card.step-cancelled .sheet-kpi-val { color: #f87171; }

/* Filter Bar for Sheets */
.sheets-filter-bar {
  flex-wrap: wrap;
  gap: 10px;
}
.sheet-scope-btn.active {
  background: rgba(0, 242, 254, 0.15);
  border-color: rgba(0, 242, 254, 0.4);
  color: var(--accent-cyan);
}

/* Step Pills */
.step-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.step-badge-1 { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.step-badge-2 { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.step-badge-3 { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.step-badge-4 { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
.step-badge-5 { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.step-badge-5.pending { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.step-badge-5.approved { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.45); font-weight: 700; }
.step-badge-6 { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.35); }
.step-badge-6.certified { background: rgba(16, 185, 129, 0.22); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.5); font-weight: 700; }
.step-badge-cancelled { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); font-weight: 700; }

/* Degree Pill */
.degree-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

/* Examiner Avatar & Chip */
.examiner-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 12px;
  color: var(--text-primary);
}
.examiner-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2fe, #bd5cff);
  color: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ============================================================
   TABLE & STICKY HEADER (ตึงหัวตารางไว้เวลาเลื่อนขึ้นลง)
   ============================================================ */
.tasks-table-container {
  max-height: calc(100vh - 275px);
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.45);
}

.tasks-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 13px;
}

.tasks-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.tasks-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #111622; /* Solid high-contrast dark color so scrolled rows never bleed through */
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.tasks-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #111622;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Table Row Hover */
.sheet-data-row {
  cursor: pointer;
  transition: background 0.15s ease;
}
.sheet-data-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* Action Buttons */
.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
}
.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.action-btn.pdf-btn:hover { background: rgba(244, 63, 94, 0.2); border-color: rgba(244, 63, 94, 0.4); }
.action-btn.doc-btn:hover { background: rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.4); }
.action-btn.view-btn:hover { background: rgba(0, 242, 254, 0.2); border-color: rgba(0, 242, 254, 0.4); }

/* Sheet Detail Modal */
.sheet-detail-modal {
  width: 760px;
  max-width: 95vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #111827;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}
.sheet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 16px;
}
.sheet-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 4px;
}
.sheet-detail-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px 16px;
}
.sheet-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  margin: 0 0 10px 0;
}
.sheet-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 20px;
  font-size: 13px;
}
.sheet-grid-2 label {
  color: var(--text-secondary);
  margin-right: 6px;
}
.sheet-grid-2 span {
  color: #fff;
  font-weight: 500;
}
.highlight-examiner {
  color: #38bdf8 !important;
  font-weight: 600 !important;
}
.resolution-text {
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid #10b981;
  margin: 4px 0 0 0;
}

/* Document & Action Buttons in Sheet Table */
.sheet-doc-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 7px;
  font-family: 'Prompt', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.sheet-doc-btn.pdf {
  background: rgba(244, 63, 94, 0.12);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.3);
}
.sheet-doc-btn.pdf:hover {
  background: #f43f5e;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}
.sheet-doc-btn.doc {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}
.sheet-doc-btn.doc:hover {
  background: #3b82f6;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.sheet-doc-btn.view {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.3);
}
.sheet-doc-btn.view:hover {
  background: var(--accent-cyan);
  color: #0b0f19;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
}

/* ============================================================
   PERSONAL NOTES: CHECKLIST DATE & LINK ATTACHMENT STYLES
   ============================================================ */

/* Checklist Editor Date Input */
.note-checklist-date-input {
  width: 125px;
  max-width: 32%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.07) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 7px;
  color: #fff !important;
  font-family: 'Prompt', sans-serif;
  font-size: 11px;
  padding: 5px 6px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.note-checklist-date-input:focus {
  border-color: var(--accent-cyan, #00f2fe) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0 0 2px rgba(0, 242, 254, 0.15);
}
.note-checklist-date-input::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  cursor: pointer;
  opacity: 0.7;
}
.note-checklist-date-input:hover::-webkit-calendar-picker-indicator {
  opacity: 1;
}

/* Checklist Item Text & Date Tag on Card */
.note-checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.note-checklist-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.checklist-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan, #00f2fe);
  border: 1px solid rgba(0, 242, 254, 0.28);
  line-height: 1.3;
}
.checklist-date-tag.today {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}
.checklist-date-tag.overdue {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose, #f43f5e);
  border-color: rgba(244, 63, 94, 0.35);
}
.checklist-date-tag.done {
  opacity: 0.85;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
  text-decoration: none !important;
}

.chk-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 242, 254, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px dashed rgba(0, 242, 254, 0.3);
}

/* Pastel Card Overrides for Checklist Date Tags */
.note-card[class*="color-pastel-"] .checklist-date-tag {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #1e293b !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}
.note-card[class*="color-pastel-"] .checklist-date-tag.done {
  opacity: 0.9;
  background: rgba(16, 185, 129, 0.16) !important;
  color: #065f46 !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
}
.note-card[class*="color-pastel-"] .checklist-date-tag.today {
  background: rgba(180, 83, 9, 0.12) !important;
  color: #b45309 !important;
  border-color: rgba(180, 83, 9, 0.25) !important;
}
.note-card[class*="color-pastel-"] .checklist-date-tag.overdue {
  background: rgba(190, 24, 93, 0.12) !important;
  color: #be185d !important;
  border-color: rgba(190, 24, 93, 0.25) !important;
}
.note-card[class*="color-pastel-"] .checklist-date-tag.done {
  opacity: 0.45;
  color: rgba(0, 0, 0, 0.4) !important;
}

/* Note Card Link Button */
.note-card-link-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
}
.note-card-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 7px;
  font-family: 'Prompt', sans-serif;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  background: rgba(0, 242, 254, 0.09);
  color: var(--accent-cyan, #00f2fe);
  border: 1px solid rgba(0, 242, 254, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  user-select: none;
}
.note-card-link-btn:hover {
  background: rgba(0, 242, 254, 0.18);
  border-color: rgba(0, 242, 254, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 242, 254, 0.2);
  color: #fff;
}
.note-card-link-btn .link-icon {
  font-size: 12px;
  flex-shrink: 0;
}
.note-card-link-btn .link-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-card-link-btn .link-arrow {
  font-size: 11px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Pastel Card Overrides for Note Card Link Button */
.note-card[class*="color-pastel-"] .note-card-link-btn {
  background: rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
  font-weight: 600;
}
.note-card[class*="color-pastel-"] .note-card-link-btn:hover {
  background: rgba(15, 23, 42, 0.16) !important;
  border-color: rgba(15, 23, 42, 0.35) !important;
  color: #000 !important;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Inline links inside note content */
.note-inline-link {
  color: var(--accent-cyan, #00f2fe);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color 0.15s;
}
.note-inline-link:hover {
  color: #fff;
}
.note-card[class*="color-pastel-"] .note-inline-link {
  color: #0369a1 !important;
}
.note-card[class*="color-pastel-"] .note-inline-link:hover {
  color: #0c4a6e !important;
}

/* ============================================================
   MAINTENANCE MODE STYLES
   ============================================================ */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.94);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: maintFadeIn 0.35s ease;
}

@keyframes maintFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.maintenance-box {
  width: 100%;
  max-width: 520px;
  background: rgba(22, 27, 46, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(245, 158, 11, 0.15);
  border-radius: 24px;
  padding: 36px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.maintenance-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #f59e0b);
  background-size: 200% 100%;
  animation: maintGradientMove 3s linear infinite;
}

@keyframes maintGradientMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.maintenance-icon-wrap {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 20px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.maintenance-big-icon {
  font-size: 38px;
  filter: drop-shadow(0 4px 10px rgba(245, 158, 11, 0.4));
  animation: maintWrench 2.4s ease-in-out infinite;
}

@keyframes maintWrench {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(0deg); }
}

.maintenance-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseDotAnim 1.4s ease infinite;
}

@keyframes pulseDotAnim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

.maintenance-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.35;
}

.maintenance-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 22px;
  padding: 0 10px;
}

.maintenance-schedule-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 24px;
  text-align: left;
}

.schedule-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.schedule-info {
  flex: 1;
  min-width: 0;
}

.schedule-label {
  font-size: 11px;
  color: #fbbf24;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.schedule-time {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  word-break: break-word;
}

.maintenance-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.maintenance-contact-hint {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  margin-top: 20px;
  line-height: 1.5;
}

/* Admin Warning Banner inside Main Workspace */
.admin-maintenance-bar {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(239, 68, 68, 0.18));
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  z-index: 90;
  backdrop-filter: blur(8px);
}

.admin-maint-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #fde68a;
}

.admin-maint-icon {
  font-size: 18px;
}

.admin-maint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-admin-maint-edit {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-admin-maint-edit:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-admin-maint-off {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-admin-maint-off:hover {
  background: rgba(34, 197, 94, 0.3);
  color: #fff;
}

/* Settings Toggle & Cards */
.maint-settings-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
}

.maint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.maint-status-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s;
}

.maint-status-icon-box.active {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

/* Toggle Switch */
.maint-switch-wrap {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}
.maint-switch-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
}
.maint-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.maint-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.maint-switch-wrap input:checked + .maint-slider {
  background-color: #ef4444;
  border-color: #ef4444;
}
.maint-switch-wrap input:checked + .maint-slider:before {
  transform: translateX(24px);
}




