* { box-sizing: border-box; }

:root {
  /* Modern Zinc/Slate Palette */
  --bg: #09090b;
  --bg-gradient: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.15), transparent);
  --panel: rgba(24, 24, 27, 0.8);
  --panel-solid: #18181b;
  --panel-2: #27272a;
  --panel-border: #3f3f46;
  --text: #fafafa;
  --text-secondary: #d4d4d8;
  --muted: #a1a1aa;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --grid-line: #3f3f46;
  --grid-line-subtle: #27272a;
  
  /* Dimensions */
  --hour-height: 56px;
  --week-hour-height: 40px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px var(--accent-glow);
  
  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
}

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

html, body { 
  margin: 0; 
  padding: 0; 
  height: 100%; 
  background: var(--bg); 
  color: var(--text); 
  font: 14px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100vh;
  background: var(--bg-gradient);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1 { 
  font-size: 20px; 
  font-weight: 700; 
  margin: 0; 
  background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h3 { 
  margin: 0 0 12px 0; 
  font-size: 11px; 
  font-weight: 600;
  color: var(--muted); 
  text-transform: uppercase; 
  letter-spacing: 0.08em; 
}

/* ============================================
   HEADER
   ============================================ */
.app-header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 12px 16px; 
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 2000;
}

.app-header .left { display: flex; align-items: center; gap: 20px; }
.app-header .right { display: flex; align-items: center; gap: 20px; }

/* Date Navigation */
.date-nav { 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  background: var(--panel-solid);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
}

.date-nav input[type=date] { 
  background: transparent; 
  color: var(--text); 
  border: none;
  border-radius: var(--radius-xs); 
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 13px;
}

.date-nav input[type=date]:focus {
  outline: none;
  background: var(--panel-2);
}

/* Buttons */
button { 
  background: var(--panel-2); 
  color: var(--text); 
  border: 1px solid var(--panel-border); 
  border-radius: var(--radius-xs); 
  padding: 8px 14px; 
  cursor: pointer;
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
}

button:hover { 
  background: #3f3f46;
  border-color: #52525b;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled { 
  opacity: 0.4; 
  cursor: not-allowed;
  transform: none;
}

/* Tabs */
.tabs { 
  display: flex; 
  gap: 4px;
  background: var(--panel-solid);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
}

.tab { 
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-xs);
  font-weight: 500;
  color: var(--muted);
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: var(--panel-2);
  transform: none;
}

.tab.active { 
  background: var(--accent); 
  color: white;
  box-shadow: var(--shadow-glow);
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
main { 
  display: flex; 
  flex-direction: column; 
  height: calc(100vh - 60px); 
  min-height: 0; 
}

.tab-panel { 
  display: none; 
  height: 100%; 
  min-height: 0; 
}

.tab-panel.active { 
  display: flex; 
  flex: 1 1 auto; 
  min-height: 0; 
}

/* ============================================
   DAY TAB
   ============================================ */
#dayTab { 
  gap: 16px; 
  padding: 16px; 
}

/* Sidebar */
.sidebar { 
  width: 300px; 
  background: var(--panel-solid);
  border: 1px solid var(--panel-border); 
  border-radius: var(--radius); 
  padding: 16px; 
  display: flex; 
  flex-direction: column; 
  gap: 16px;
  box-shadow: var(--shadow-md);
}

.section { 
  background: var(--panel-2); 
  border: 1px solid var(--panel-border); 
  border-radius: var(--radius-sm); 
  padding: 14px;
}

/* Badge */
.badge { 
  padding: 4px 10px; 
  border-radius: 999px; 
  display: inline-block; 
  background: var(--panel-2);
  color: var(--text-secondary);
  border: 1px solid var(--panel-border);
  font-size: 12px;
  font-weight: 500;
}

/* Form Elements */
.row { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  margin: 8px 0; 
}

.row label { 
  color: var(--muted);
  font-size: 13px;
}

input, select { 
  background: var(--panel-solid);
  color: var(--text); 
  border: 1px solid var(--panel-border); 
  border-radius: var(--radius-xs); 
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type=color] { 
  padding: 2px; 
  width: 40px; 
  height: 36px; 
  border-radius: var(--radius-xs);
  cursor: pointer;
}

input[type=number] {
  font-family: var(--font-mono);
}

/* Category List */
.category-list { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
}

.category-item {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.category-btn {
  display: flex; 
  align-items: center; 
  gap: 6px; 
  padding: 6px 12px; 
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--text-secondary);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
  flex: 1;
}

.category-btn:hover {
  background: var(--panel-2);
  border-color: #52525b;
}

.category-btn.active { 
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  color: var(--text);
}

.category-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: all 0.15s ease;
  opacity: 0;
}

.category-item:hover .category-edit-btn {
  opacity: 1;
}

.category-edit-btn:hover {
  background: var(--panel-2);
  border-color: var(--panel-border);
  color: var(--text);
}

.cat-dot { 
  width: 10px; 
  height: 10px; 
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

/* Shortcuts */
.shortcuts {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.shortcuts li {
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcuts li::before {
  content: '→';
  color: var(--accent);
  font-size: 10px;
}

/* Budget */
.budget { 
  display: flex; 
  align-items: center; 
  gap: 10px;
  background: var(--panel-solid);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
}

.budget span {
  font-size: 12px;
  color: var(--muted);
}

.budget input[type=number] {
  width: 50px;
  padding: 4px 6px;
  text-align: center;
}

.budget-bar { 
  width: 180px; 
  height: 8px; 
  background: var(--panel-2);
  border: none;
  border-radius: 999px; 
  position: relative; 
  overflow: hidden;
}

.budget-text { 
  min-width: 140px; 
  text-align: right; 
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted); 
}

/* ============================================
   TIMELINE
   ============================================ */
.day-view { 
  flex: 1; 
  display: flex; 
  gap: 0;
  position: relative;
}

/* Zoom Controls */
.zoom-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 6px 10px;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

.zoom-controls button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-xs);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-controls button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.zoom-controls span {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
  min-width: 40px;
  text-align: center;
}

.time-ruler { 
  width: 0; 
  position: relative; 
  display: none; 
}

.timeline {
  position: relative; 
  flex: 1; 
  border: 1px solid var(--panel-border); 
  border-radius: var(--radius); 
  background: var(--panel-solid);
  overflow: auto; 
  height: 100%;
  box-shadow: var(--shadow-md);
}

.timeline-inner { position: relative; }
.visible-days-container { position: relative; }

/* Day Marker */
.day-marker {
  position: sticky;
  top: 0;
  z-index: 100;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  background: var(--panel-2);
  border-bottom: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
}

/* Current Time Line */
.current-time-line {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  background: var(--danger);
  height: 2px;
  box-shadow: 0 0 8px var(--danger), 0 0 16px rgba(239, 68, 68, 0.3);
}

.current-time-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  background: var(--danger);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--danger);
}

/* Hour Rows */
.hour-row { 
  position: absolute;
  height: var(--hour-height); 
  border-top: 1px solid var(--grid-line-subtle); 
  left: 0;
  right: 0;
}

.hour-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.quarter { 
  height: calc(var(--hour-height) / 2); 
  border-top: 1px dashed var(--grid-line-subtle);
  opacity: 0.5;
}

/* Selection */
.selection { 
  position: absolute; 
  left: 90px; 
  right: 8px; 
  background: rgba(99, 102, 241, 0.2);
  border: 2px solid var(--accent);
  pointer-events: none; 
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-glow);
}

/* ============================================
   ENTRIES
   ============================================ */
.entry {
  position: absolute; 
  left: 90px; 
  right: 8px; 
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  padding-bottom: 14px; /* Space for resize handle */
  color: #0c121a;
  border: none;
  border-left: 3px solid rgba(255,255,255,0.3);
  cursor: grab; 
  overflow: hidden;
  min-height: 24px;
  user-select: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: var(--shadow-sm);
}

.entry:hover {
  transform: translateY(-1px) scale(1.002);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.entry.dragging {
  display: none !important;
}

/* Entry Title Row - prioritizes category + client */
.entry .title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  white-space: nowrap;
}

.entry .cat-name {
  flex-shrink: 0;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry .entry-title-text {
  font-weight: 400;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}

.entry .entry-title-text::before {
  content: '·';
  margin-right: 6px;
}

.entry .meta { 
  font-size: 11px; 
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.entry .badge { 
  background: rgba(0,0,0,0.15);
  color: inherit;
  border: none;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  flex-shrink: 0;
}

.entry .duration-text {
  opacity: 0.75;
  flex-shrink: 0;
  font-size: 10px;
}

.entry .duration-text::before {
  content: '·';
  margin: 0 4px;
}

/* ============================================
   ENTRY SIZE VARIANTS - Adaptive layouts
   ============================================ */

/* INLINE: < 35px (15min & 30min) - Everything on single line */
.entry.entry-inline {
  padding: 2px 6px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 0;
}

.entry.entry-inline .title-row {
  margin-bottom: 0;
  font-size: 10px;
  gap: 4px;
  flex-shrink: 0;
}

.entry.entry-inline .cat-name {
  max-width: none;
}

.entry.entry-inline .client-badge-timeline {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-inline .entry-title-text {
  display: none;
}

.entry.entry-inline .meta {
  margin: 0;
  font-size: 9px;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
}

.entry.entry-inline .project-badge {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-inline .employee-badge-timeline {
  display: none;
}

.entry.entry-inline .time-badge {
  font-size: 8px;
  padding: 1px 4px;
}

.entry.entry-inline .duration-text {
  font-size: 9px;
}

.entry.entry-inline .duration-text::before {
  margin: 0 2px;
}

.entry.entry-inline .resize-handle {
  display: none;
}

/* COMPACT: 35-50px (45min) - All elements, smaller font */
.entry.entry-compact {
  padding: 3px 8px;
  padding-bottom: 10px;
}

.entry.entry-compact .title-row {
  font-size: 11px;
  margin-bottom: 1px;
  gap: 5px;
}

.entry.entry-compact .cat-name {
  max-width: none;
}

.entry.entry-compact .client-badge-timeline {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-compact .entry-title-text {
  font-size: 10px;
}

.entry.entry-compact .meta {
  font-size: 9px;
  gap: 4px;
}

.entry.entry-compact .project-badge {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-compact .employee-badge-timeline {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-compact .time-badge {
  font-size: 8px;
  padding: 1px 5px;
}

.entry.entry-compact .duration-text {
  font-size: 9px;
}

/* Resize Handle */
.entry .resize-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10px;
  cursor: ns-resize;
  background: transparent;
  transition: background 0.15s ease;
}

.entry:hover .resize-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: rgba(255,255,255,0.4);
  border-radius: 999px;
}

.entry.resizing {
  cursor: ns-resize !important;
}

/* Drag Preview */
.entry-drag-preview {
  color: #0c121a;
  border-radius: var(--radius-xs);
  cursor: grabbing;
  box-shadow: var(--shadow-lg);
}

.entry-drag-preview .title { font-weight: 600; }
.entry-drag-preview .meta { font-size: 12px; opacity: 0.9; }

/* ============================================
   WEEK TAB
   ============================================ */
#weekTab { 
  flex-direction: column; 
  gap: 16px; 
  padding: 16px; 
  flex: 1 1 auto; 
  min-height: 0; 
}

.week-controls { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
}

.week-grid-container {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: none;
  box-shadow: var(--shadow-md);
}

.week-grid-header {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel-2);
}

.week-time-header {
  padding: 12px;
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  border-right: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.week-day-headers { 
  display: grid; 
  grid-template-columns: repeat(7, 1fr);
  flex: 1;
}

.week-day-header {
  padding: 12px;
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 600;
  font-size: 13px;
}

.week-day-header:last-child { border-right: none; }
.week-day-header .date { 
  font-size: 11px; 
  color: var(--muted); 
  font-weight: 400;
  font-family: var(--font-mono);
}

.week-day-header.weekend { background: rgba(39, 39, 42, 0.5); }
.week-day-header.today { 
  background: rgba(99, 102, 241, 0.1);
  border-bottom: 2px solid var(--accent);
}

.week-grid {
  display: flex;
  position: relative;
  flex: none;
  height: calc(var(--week-hour-height) * 24);
  overflow: hidden;
}

.week-time-gutter {
  width: 70px;
  border-right: 1px solid var(--panel-border);
  position: relative;
  background: var(--panel-2);
}

.week-time-label {
  position: absolute;
  right: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  transform: translateY(-50%);
}

.week-columns {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
}

.week-column {
  position: relative;
  border-right: 1px solid var(--panel-border);
  background: linear-gradient(
    to bottom, 
    var(--grid-line-subtle) 0, 
    var(--grid-line-subtle) 1px, 
    transparent 1px
  );
  background-size: 100% var(--week-hour-height);
}

.week-column:last-child { border-right: none; }
.week-column.weekend { background-color: rgba(39, 39, 42, 0.3); }
.week-column.today { background-color: rgba(99, 102, 241, 0.05); }

.week-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--grid-line-subtle);
}

.week-entry,
.week-drag-preview {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  color: #0c121a;
  font-size: 11px;
  border: none;
  border-left: 2px solid rgba(255,255,255,0.3);
  cursor: grab;
  overflow: hidden;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.week-entry:hover { 
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.week-entry.dragging { display: none; }

/* Week Entry Title Row */
.week-entry .title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
}

.week-entry .cat-name {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-entry .title { font-weight: 600; font-size: 11px; }
.week-entry .meta { 
  font-size: 9px; 
  opacity: 0.85; 
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.week-entry .time-badge {
  background: rgba(0,0,0,0.15);
  padding: 1px 4px;
  border-radius: 999px;
  font-size: 8px;
}

.week-entry .duration-text {
  font-size: 8px;
  opacity: 0.75;
}

.week-entry .duration-text::before {
  content: '·';
  margin: 0 2px;
}

/* Client Badge for Week View */
.client-badge-week {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ============================================
   WEEK ENTRY SIZE VARIANTS
   ============================================ */

/* INLINE: < 18px (15min entries) - Single line */
.week-entry.week-entry-inline {
  padding: 1px 4px;
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 4px;
  min-height: 0;
}

.week-entry.week-entry-inline .title-row {
  font-size: 8px;
  gap: 3px;
  flex-shrink: 0;
}

.week-entry.week-entry-inline .client-badge-week {
  font-size: 6px;
  padding: 0 3px;
}

.week-entry.week-entry-inline .meta {
  display: none;
}

/* COMPACT: 18-28px (30min entries) - Two lines, small */
.week-entry.week-entry-compact {
  padding: 2px 5px;
  min-height: 0;
}

.week-entry.week-entry-compact .title-row {
  font-size: 9px;
  gap: 3px;
  margin-bottom: 0;
}

.week-entry.week-entry-compact .client-badge-week {
  font-size: 6px;
  padding: 0 3px;
}

.week-entry.week-entry-compact .meta {
  font-size: 8px;
  margin-top: 0;
}

.week-entry.week-entry-compact .duration-text {
  display: none;
}

.week-drag-preview {
  pointer-events: none;
  opacity: 0.85;
  border: 2px dashed var(--accent);
  background: var(--panel-solid);
  backdrop-filter: blur(4px);
}

.week-selection {
  position: absolute;
  left: 4px;
  right: 4px;
  border-radius: var(--radius-xs);
  background: rgba(99, 102, 241, 0.2);
  border: 2px solid var(--accent);
  pointer-events: none;
  box-shadow: var(--shadow-glow);
}

.week-current-time-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  pointer-events: none;
}

.week-current-time-line::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

#weekSummary { 
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-md);
}

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

.summary-table th, 
.summary-table td { 
  border-bottom: 1px solid var(--panel-border);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
}

.summary-table th { 
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summary-table td {
  font-family: var(--font-mono);
}

/* ============================================
   DATA TAB
   ============================================ */
#dataTab { 
  padding: 24px; 
  overflow-y: auto;
}

.data-page {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.data-section {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 24px;
}

.data-section-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.data-section-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  flex-shrink: 0;
}

.data-section-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text);
}

.data-section-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

/* Data Stats Grid */
.data-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.data-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  text-align: center;
}

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

.data-stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Data Cards Grid */
.data-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.data-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.data-card:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.data-card:active {
  transform: translateY(0);
}

.data-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  flex-shrink: 0;
}

.data-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.data-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.data-card-desc {
  font-size: 12px;
  color: var(--muted);
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--panel-border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--panel-2);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.1);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-zone-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: 50%;
  color: var(--accent-light);
}

.drop-zone-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.drop-zone-hint {
  font-size: 13px;
  color: var(--muted);
}

/* File Preview */
.file-preview {
  margin-top: 16px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.file-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(99, 102, 241, 0.05);
}

.file-preview-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius-xs);
  color: var(--accent-light);
}

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

.file-preview-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 12px;
  color: var(--muted);
}

.file-preview-clear {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-preview-clear:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.file-preview-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}

.file-preview-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: var(--panel-2);
  text-align: center;
}

.file-preview-stat-value {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent-light);
}

.file-preview-stat-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.file-preview-actions {
  padding: 14px 16px;
  display: flex;
  justify-content: flex-end;
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, #4f46e5 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* Danger Section & Button */
.data-section-danger {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.03);
}

.data-section-danger .danger-icon {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.05) 100%);
  color: #f87171;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

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

/* Keep old .danger class for backwards compatibility */
.danger { 
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.danger:hover { 
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* Data Tab Responsive */
@media (max-width: 600px) {
  .data-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .data-cards {
    grid-template-columns: 1fr;
  }
  
  .file-preview-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   DIALOGS
   ============================================ */
dialog::backdrop { 
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

dialog { 
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--panel-solid);
  color: var(--text);
  width: 380px;
  box-shadow: var(--shadow-lg);
}

dialog h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

dialog .row { margin: 12px 0; }

dialog menu {
  margin: 20px 0 0 0;
  padding: 0;
}

/* ============================================
   FOCUS CHART
   ============================================ */
.focus-chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.focus-chart {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--panel-solid);
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.focus-chart::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: var(--panel-2);
  border-radius: 50%;
}

.focus-chart-label {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.focus-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.focus-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.focus-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toast-in 0.3s ease;
  max-width: 320px;
}

.toast.toast-out {
  animation: toast-out 0.2s ease forwards;
}

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

.toast.success .toast-icon { background: var(--success); }
.toast.error .toast-icon { background: var(--danger); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.info .toast-icon { background: var(--accent); }

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

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

/* ============================================
   QUICK ADD
   ============================================ */
.quick-add {
  display: flex;
  gap: 6px;
}

.quick-add input {
  flex: 1;
  font-size: 12px;
  padding: 8px 10px;
}

.quick-add button {
  padding: 8px 12px;
  font-size: 12px;
}

.quick-add-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}

/* ============================================
   SCROLLBARS
   ============================================ */
* { 
  scrollbar-width: thin; 
  scrollbar-color: var(--panel-border) var(--panel-solid); 
}

::-webkit-scrollbar { 
  height: 8px; 
  width: 8px; 
}

::-webkit-scrollbar-track {
  background: var(--panel-solid);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb { 
  background: var(--panel-border);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

/* ============================================
   ANIMATIONS
   ============================================ */
/* ============================================
   AUTH DIALOG & USER MENU
   ============================================ */
.auth-dialog {
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--panel-solid);
  color: var(--text);
  min-width: 360px;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.15);
  animation: dialogIn 0.2s ease-out;
}

@keyframes dialogIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.auth-dialog form {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-dialog h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-field input {
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  transition: all 0.2s ease;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-field input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.auth-toggle {
  background: none;
  border: none;
  color: var(--accent-light);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.auth-toggle:hover {
  color: var(--accent);
  text-decoration: underline;
}

.auth-submit {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.auth-error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 20px;
}

/* User Menu */
.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--panel-border);
}

.current-user {
  font-size: 12px;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

/* ============================================
   PROJECTS TAB (Workspace)
   ============================================ */
#projectsTab {
  padding: 0;
  overflow-y: auto;
}

.projects-container {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}

.projects-add-form {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.projects-add-form .row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.projects-add-form input[type="text"],
.projects-add-form input[type="url"],
.projects-add-form select {
  flex: 1;
  min-width: 150px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

.projects-add-form input[type="text"]:focus,
.projects-add-form input[type="url"]:focus,
.projects-add-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.projects-add-form input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
}

.projects-add-form button {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.projects-add-form button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Projects Page Layout */
.projects-page {
  display: grid;
  grid-template-columns: 300px 300px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .projects-page {
    grid-template-columns: 1fr 1fr;
  }
}

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

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

.section-header h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

/* Clients Container */
.clients-container {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
}

.clients-add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.clients-add-form input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

.clients-add-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.clients-add-form input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
}

.clients-add-form button {
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clients-add-form button:hover {
  background: var(--accent-light);
}

/* Client List */
.client-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.no-clients {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
}

.client-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.client-item:hover {
  border-color: var(--accent);
}

.client-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.client-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.client-project-count {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  background: var(--panel);
  border-radius: 999px;
}

.client-edit-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  opacity: 0;
  transition: all 0.2s ease;
}

.client-item:hover .client-edit-btn {
  opacity: 1;
}

.client-edit-btn:hover {
  background: var(--panel);
  color: var(--text);
}

/* Client Edit Dialog */
#clientEditDialog {
  max-width: 360px;
}

#clientEditDialog .row {
  margin-bottom: 16px;
}

#clientEditDialog label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#clientEditDialog input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

#clientEditDialog input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#clientEditDialog input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
}

/* Employees Container */
.employees-container {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
}

.employees-add-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.employees-add-form input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
}

.employees-add-form input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.employees-add-form button {
  padding: 8px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.employees-add-form button:hover {
  background: var(--accent-light);
}

/* Employee List */
.employee-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.no-employees {
  text-align: center;
  padding: 24px 12px;
  color: var(--muted);
  font-size: 13px;
}

.employee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.employee-item:hover {
  border-color: var(--accent);
}

.employee-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.employee-project-count {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  background: var(--panel);
  border-radius: 999px;
}

.employee-edit-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  opacity: 0;
  transition: all 0.2s ease;
}

.employee-item:hover .employee-edit-btn {
  opacity: 1;
}

.employee-edit-btn:hover {
  background: var(--panel);
  color: var(--text);
}

/* Employee Edit Dialog */
#employeeEditDialog {
  max-width: 360px;
}

#employeeEditDialog .row {
  margin-bottom: 16px;
}

#employeeEditDialog label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#employeeEditDialog input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

#employeeEditDialog input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Tags (Client + Employees) in Projects */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.client-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.employee-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

/* Employee Multi-Select in Project Forms */
select[multiple] {
  padding: 8px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  min-height: 80px;
}

select[multiple]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

select[multiple] option {
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  margin: 2px 0;
}

select[multiple] option:checked {
  background: var(--accent);
  color: white;
}

#newProjectEmployees,
#projectEditEmployees {
  flex: 1;
  min-width: 180px;
}

/* Project Group Headers */
.project-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 12px;
}

.project-group-header:first-child {
  margin-top: 0;
}

.project-group-header.no-client {
  color: var(--muted);
}

/* Project List */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.no-projects {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.project-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.project-item:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.05);
}

.project-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.project-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.project-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-link {
  color: var(--accent-light);
  text-decoration: none;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.project-link:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

.nexus-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nexus-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.nexus-icon {
  font-size: 10px;
}

.nexus-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nexus-label:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.nexus-label input[type="checkbox"] {
  accent-color: #10b981;
}

.project-entry-count {
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  background: var(--panel);
  border-radius: 999px;
  white-space: nowrap;
}

.project-edit-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.project-edit-btn:hover {
  background: var(--panel);
  color: var(--text);
}

/* Project Badge on Timeline Entries */
.project-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: white;
  margin-right: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

/* Client Badge on Timeline Entries */
.client-badge-timeline {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-right: 4px;
  border: 1px solid;
  letter-spacing: 0.02em;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Employee Badge on Timeline Entries */
.employee-badge-timeline {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  margin-right: 4px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

/* Project Edit Dialog */
#projectEditDialog {
  max-width: 400px;
}

#projectEditDialog .row {
  margin-bottom: 16px;
}

#projectEditDialog label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#projectEditDialog input[type="text"],
#projectEditDialog input[type="url"] {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}

#projectEditDialog input[type="text"]:focus,
#projectEditDialog input[type="url"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#projectEditDialog input[type="color"] {
  width: 60px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  cursor: pointer;
}

/* Edit Entry Dialog - Project Select */
#editProject {
  width: 100%;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

#editProject:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ============================================
   DASHBOARD TAB
   ============================================ */
#dashboardTab {
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

/* Dashboard Header & Range Selector */
.dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.range-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-nav-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.range-presets {
  display: flex;
  gap: 4px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
}

.range-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.range-btn:hover {
  color: var(--text);
  background: var(--panel-solid);
}

.range-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-glow);
}

.custom-range {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
}

.custom-range input[type="date"] {
  padding: 8px 12px;
  background: var(--panel-2);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}

.custom-range input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.custom-range span {
  color: var(--muted);
  font-size: 13px;
}

.custom-range button {
  padding: 8px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-range button:hover {
  background: var(--accent-light);
}

.range-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  padding-left: 4px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

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

@media (max-width: 600px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

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

.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
}

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

.card-value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1.2;
}

.card-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}

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

.chart-panel {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.chart-panel h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

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

.chart-container-pie {
  height: 240px;
}

.chart-categories {
  grid-row: span 1;
}

.chart-distribution {
  grid-row: span 1;
}

.chart-trend {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .chart-trend {
    grid-column: span 1;
  }
}


/* Breakdown Panel */
.breakdown-panel {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}

.breakdown-panel h3 {
  margin: 0 0 16px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.breakdown-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--panel-2);
  padding: 4px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.breakdown-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.breakdown-tab.active {
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

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

.breakdown-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--panel-border);
}

.breakdown-table td {
  padding: 12px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--panel-border);
}

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

.breakdown-table tr:hover td {
  background: rgba(99, 102, 241, 0.05);
}

.breakdown-table .numeric {
  font-family: var(--font-mono);
  text-align: right;
}

.breakdown-table .no-data {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.breakdown-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
}

.breakdown-bar {
  width: 100%;
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.breakdown-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ============================================
   DASHBOARD ENHANCED COMPONENTS
   ============================================ */

/* Extended Summary Cards Grid */
.summary-cards {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
  .summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 600px) {
  .summary-cards {
    grid-template-columns: 1fr;
  }
}

/* Card Icon Variants */
.card-icon-focus {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: #f59e0b;
}

.card-icon-productivity {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(16, 185, 129, 0.05) 100%);
  color: #10b981;
}

.card-icon-entries {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(139, 92, 246, 0.05) 100%);
  color: #8b5cf6;
}


/* Time Consumers Panel */
.time-consumers-panel {
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px;
}

.time-consumers-panel h3 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.panel-desc {
  margin: 0 0 16px 0;
  font-size: 12px;
  color: var(--muted);
}

.consumer-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 8px;
}

.consumer-type-client {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.consumer-type-project {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}
