/* ==========================================================================
   MDV3 HYBRID WORKSPACE: NATIVE MOBILE APP & DESKTOP WORKSTATION
   ========================================================================== */

:root {
  --bg-main: #060912;
  --bg-surface: #0a0f1d;
  --bg-card: rgba(16, 24, 40, 0.85);
  --bg-card-hover: rgba(23, 34, 56, 0.95);
  --bg-glass: rgba(15, 23, 42, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: #6366f1;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-stack);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.1) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   VIEW MODE SWITCHER BAR
   ========================================================================== */
.view-mode-bar {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 999;
  display: flex;
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 3px;
  gap: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.view-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.view-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.view-mode-btn.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ==========================================================================
   RESPONSIVE SHELL DISPLAY RULES
   ========================================================================== */
.mobile-app-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.desktop-app-shell {
  display: none;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

@media (min-width: 960px) {
  body:not(.force-mobile) .mobile-app-shell {
    display: none;
  }
  body:not(.force-mobile) .desktop-app-shell {
    display: flex;
  }
}

body.force-mobile .mobile-app-shell {
  display: flex !important;
}
body.force-mobile .desktop-app-shell {
  display: none !important;
}

body.force-desktop .mobile-app-shell {
  display: none !important;
}
body.force-desktop .desktop-app-shell {
  display: flex !important;
}

/* ==========================================================================
   1. MOBILE APP STYLES (EXACT ORIGINAL NATIVE DESIGN)
   ========================================================================== */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: rgba(10, 15, 26, 0.96);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  padding-bottom: calc(75px + var(--safe-bottom));
}

@media (min-width: 481px) {
  .mobile-app-shell {
    padding: 20px 0;
  }
  .app-container {
    min-height: calc(100vh - 40px);
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 20px 20px 14px;
  background: rgba(10, 15, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

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

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

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}

.greeting-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.username-text {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.header-progress {
  display: flex;
  align-items: center;
}

.progress-info {
  text-align: right;
}

.progress-percentage {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-green);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.progress-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.search-container {
  position: relative;
  margin-bottom: 14px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 14px 11px 40px;
  color: #fff;
  font-size: 14px;
  transition: all 0.2s ease;
  outline: none;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--primary-glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

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

.sub-filter-tabs {
  display: flex;
  padding: 12px 20px;
  gap: 6px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 15, 26, 0.4);
}

.sub-tab {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 700;
}

.todo-list-section {
  padding: 14px 18px;
  flex: 1;
}

.todo-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Task Item Card */
.todo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.todo-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.todo-card.completed {
  opacity: 0.55;
  background: rgba(10, 15, 26, 0.6);
}

.todo-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s ease;
}

.todo-card.completed .todo-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.todo-checkbox svg {
  display: none;
  stroke: #fff;
  stroke-width: 3;
}

.todo-card.completed .todo-checkbox svg {
  display: block;
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  word-break: break-word;
  line-height: 1.35;
}

.todo-card.completed .todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.priority-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.priority-urgent { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.priority-high { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-medium { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.3); }
.priority-low { background: rgba(255, 255, 255, 0.08); color: var(--text-secondary); }

.date-tag {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.date-tag.overdue {
  color: #fca5a5;
  font-weight: 600;
}

.date-tag.today {
  color: var(--accent-amber);
  font-weight: 600;
}

.category-tag {
  font-size: 10.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.fab-btn {
  position: fixed;
  bottom: calc(85px + var(--safe-bottom));
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4338ca);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--primary-glow);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fab-btn:active {
  transform: scale(0.92);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 15, 26, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  transition: color 0.15s ease;
}

.nav-item.active {
  color: var(--primary);
}

.nav-icon {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   2. DESKTOP WORKSTATION STYLES (3-COLUMNS)
   ========================================================================== */
.desktop-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-main);
}

.desktop-sidebar {
  width: 265px;
  background: rgba(10, 15, 28, 0.98);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  flex-shrink: 0;
  height: 100%;
}

.sidebar-brand-block {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.brand-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.btn-sidebar-add {
  width: 100%;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}

.btn-sidebar-add .btn-add-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

.sidebar-nav-group {
  flex: 1;
  overflow-y: auto;
}

.sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-icon-tiny {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon-tiny:hover {
  background: var(--primary);
  color: #fff;
}

.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 3px;
  transition: all 0.15s ease;
}

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

.sidebar-nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #fff;
  border-left: 3px solid var(--primary);
}

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

.badge-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 999px;
}

.count-urgent {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.15);
}

.sidebar-category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-cat-item:hover, .sidebar-cat-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

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

.user-fullname {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.user-subemail {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout-sidebar {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s;
}

.btn-logout-sidebar:hover {
  color: var(--accent-red);
}

/* Center Workspace */
.main-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-surface);
}

.workspace-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(10, 15, 28, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.workspace-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.desktop-view-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.3px;
}

.desktop-view-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.workspace-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar-wrap {
  position: relative;
  width: 250px;
}

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

.search-bar-input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  width: 300px;
  box-shadow: 0 0 14px var(--primary-glow);
}

.search-shortcut {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.control-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-select:hover, .control-select:focus {
  border-color: var(--border-medium);
  color: #fff;
}

.control-select option {
  background: #0d1424;
  color: #fff;
}

.btn-header-add {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tasks-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.todo-items-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Right Desktop Panel */
.desktop-right-panel {
  width: 290px;
  background: rgba(10, 15, 28, 0.98);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
}

.analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.panel-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-bottom: 14px;
}

.progress-ring-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}

.progress-ring-svg {
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: var(--accent-green);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 314.159;
  stroke-dashoffset: 314.159;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-percentage {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.ring-label {
  font-size: 11px;
  color: var(--text-muted);
}

.stat-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-mini-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}

.stat-mini-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.stat-mini-lbl {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stat-val-done { color: var(--accent-green); }
.stat-val-pending { color: var(--accent-cyan); }
.stat-val-today { color: var(--accent-amber); }

.category-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-breakdown-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cat-breakdown-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cat-breakdown-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

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

.shortcut-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.kbd-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: monospace;
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   3. SHARED MODALS & FORMS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.show {
  display: flex;
}

.modal-sheet {
  background: #0d1424;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-width: 520px;
  padding: 20px 24px 30px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.7);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 auto 16px;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn-close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}

.btn-close-x:hover {
  color: #fff;
}

@media (min-width: 768px) {
  .modal-backdrop {
    align-items: center;
  }
  .modal-sheet {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .sheet-handle {
    display: none;
  }
}

.modal-sheet-compact {
  max-width: 420px;
}

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

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

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

.form-input, .form-textarea, .form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 10px var(--primary-glow);
}

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

.form-select option {
  background: #0d1424;
  color: #fff;
}

.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.color-label {
  font-family: monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 20px;
  text-align: center;
}

.empty-state-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty-state-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.4;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-medium);
  backdrop-filter: blur(16px);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Auth Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 18, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: #0d1424;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.auth-logo-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 14px;
  display: none;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
