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

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: rgba(17, 24, 39, 0.7);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #6366f1; /* Indigo */
  --accent-secondary: #a855f7; /* Purple */
  --accent-glow: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --error: #ef4444;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Layout Wrapper */
.app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 96px 24px 24px 24px; /* Space for fixed navbar */
}

/* Glassmorphism utility card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

/* NAVBAR DESIGN */
.navbar-fixed {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1392px;
  height: 64px;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
  font-size: 1.1rem;
}

.brand-text {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 15px var(--accent-glow);
}

/* User controls in nav */
.nav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
}

.user-tag::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.4);
}

/* BUTTONS */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn-primary:active {
  filter: brightness(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-block;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
  filter: brightness(0.98);
}

.btn-dark-glass {
  background: rgba(26, 26, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  text-decoration: none;
}

.btn-dark-glass:hover {
  background: rgba(36, 36, 42, 0.85);
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(168, 85, 247, 0.15);
}

.btn-dark-glass:active {
  filter: brightness(0.98);
}

/* AUTHENTICATION PAGES STYLE */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: 586px;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(360px, 1fr);
  align-items: stretch;
  gap: 24px;
}

.auth-info-panel {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
}

.auth-info-brand {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}

.auth-brand-text {
  display: inline-block;
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 4px;
}

.auth-app-name {
  color: var(--accent-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.auth-app-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 520px;
}

.auth-info-title {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.14;
  margin-bottom: 18px;
  color: var(--text-primary);
}

.auth-info-copy {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 620px;
  margin-bottom: 28px;
}

.auth-info-list {
  display: grid;
  gap: 16px;
}

.auth-info-list div {
  padding-left: 16px;
  border-left: 2px solid var(--glass-border-focus);
}

.auth-info-list strong,
.auth-info-list span {
  display: block;
}

.auth-info-list strong {
  color: var(--text-primary);
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.auth-info-list span {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.auth-card {
  width: 100%;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-container {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-primary);
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.28) inset;
  transition: background-color 9999s ease-in-out 0s;
}

.password-mask-input {
  -webkit-text-security: disc;
  user-select: none;
  -webkit-user-select: none;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.auth-button {
  width: 100%;
  margin-top: 12px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
}

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

.alert-message {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  display: block;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
  display: block;
}

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

/* DASHBOARD / GENERAL LAYOUT */
.welcome-section {
  padding: 40px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
}

.welcome-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}
#app-search-input:focus {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2) !important;
  background: rgba(36, 36, 42, 0.8) !important;
}

.dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 24px;
}

.module-card {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 200px;
  height: 200px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(26, 26, 31, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  user-select: none;
  text-decoration: none;
  color: inherit;
}

.module-card:hover {
  background: rgba(36, 36, 42, 0.8);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.15);
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.card-icon-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 15, 18, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.28);
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.05);
  color: var(--accent-primary);
}

.card-icon-container svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

/* RESPONSIVE STYLING */
@media (max-width: 900px) {
  .navbar-fixed {
    height: auto;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    top: 8px;
    width: calc(100% - 16px);
  }
  .app-container {
    padding-top: 180px; /* More space for multi-line navbar */
    padding-left: 12px;
    padding-right: 12px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ==========================================================================
   TASKS MODULE SPECIFIC STYLES
   ========================================================================== */

.tasks-layout {
  display: flex;
  gap: 34px;
  align-items: flex-start;
  margin-top: 0;
  width: 100%;
}

/* Sidebar Styling */
.tasks-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.btn-sidebar-add {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-sidebar-add:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-input-form {
  display: none;
  gap: 8px;
  margin-top: 4px;
}

.sidebar-input-form.active {
  display: flex;
}

.sidebar-input {
  flex: 1;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.sidebar-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.btn-sidebar-save {
  padding: 6px 10px;
  background: var(--accent-primary);
  border: none;
  border-radius: 6px;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  user-select: none;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-primary);
}

.btn-sidebar-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-item:hover .btn-sidebar-delete {
  opacity: 1;
}

.btn-sidebar-delete:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.trash-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
  margin-top: auto;
}

.trash-sidebar-item:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.trash-sidebar-item.active {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fff;
}

/* Tasks Content Workspace */
.tasks-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
}

.task-context-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.task-context-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 700;
}

.task-context-crumb {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1;
  padding: 4px 0;
  cursor: pointer;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}

.task-context-crumb:hover {
  color: var(--text-primary);
}

.task-context-crumb.active {
  color: var(--text-primary);
}

.task-context-separator {
  color: var(--text-muted);
  flex: 0 0 auto;
}

.task-context-back-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.42);
  background: rgba(168, 85, 247, 0.16);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.task-context-back-btn:hover {
  border-color: rgba(196, 181, 253, 0.7);
  background: rgba(168, 85, 247, 0.24);
}

.task-context-default-btn {
  padding: 8px 12px !important;
  font-size: 0.84rem !important;
}

.editor-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.editor-breadcrumbs {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-task-focus-cancel,
.btn-task-focus-save {
  width: auto;
  min-height: 30px;
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-task-focus-cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-task-focus-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn-task-focus-save {
  border-color: rgba(129, 140, 248, 0.5);
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.22);
}

.btn-task-focus-save:hover {
  border-color: rgba(196, 181, 253, 0.7);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}

.task-focus-panel {
  padding: 28px 32px 32px;
}

.task-focus-panel .modal-body-grid {
  margin-top: 0;
}

/* Search and Sort Row */
.workspace-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}

.search-input-container {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.sort-select {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  cursor: pointer;
}

.sort-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Quick Add Panel */
.quick-add-panel {
  padding: 16px 24px;
}

.quick-add-form {
  display: flex;
  gap: 12px;
}

.quick-add-input {
  flex: 1;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.quick-add-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.btn-quick-add {
  padding: 12px 24px;
  white-space: nowrap;
}

/* Task List */
.task-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
  padding-bottom: 50px;
}

.task-list-empty {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: default;
  transition: var(--transition-smooth);
}

.task-item:active {
  cursor: default;
}

.task-item.dragging {
  opacity: 0.4;
  border: 1px dashed var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
}

.task-item.drag-over {
  border-color: rgba(99, 102, 241, 0.35);
}

.task-item.drag-over-before {
  box-shadow: inset 0 1px 0 var(--accent-primary);
}

.task-item.drag-over-inside {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.45);
}

.task-item.drag-over-after {
  box-shadow: inset 0 -1px 0 var(--accent-primary);
}

.task-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.task-drag-handle {
  color: var(--text-muted);
  font-size: 1.2rem;
  user-select: none;
  padding: 0 4px;
  cursor: grab;
}

.task-checkbox {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.7);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  user-select: none;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.04), 0 2px 8px rgba(0, 0, 0, 0.18);
}

.task-checkbox:hover {
  border-color: rgba(129, 140, 248, 0.85);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.task-checkbox.checked {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.98), rgba(34, 197, 94, 0.88));
  border-color: rgba(110, 231, 183, 0.9);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), 0 6px 14px rgba(16, 185, 129, 0.16);
}

.task-checkbox.checked::after {
  content: '✓';
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
}

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

.task-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  word-break: break-word;
}

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

.task-meta-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
}

.tag-category {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.tag-project {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.tag-date {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--glass-border);
  color: var(--text-secondary);
}

.tag-overdue {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.task-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-task-action {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-task-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-task-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Touch Fallback Action Menus */
.touch-move-select {
  padding: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 12, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

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

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

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

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

.modal-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: none;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

/* File Upload Drag zone */
.attachment-dropzone {
  border: 2px dashed var(--glass-border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.attachment-dropzone:hover, .attachment-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.02);
  color: var(--text-primary);
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin-top: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.attachment-name {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.attachment-name:hover {
  text-decoration: underline;
}

.btn-attachment-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-attachment-delete:hover {
  color: var(--error);
}

/* Audit Log Table */
.audit-logs-container {
  max-height: 180px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.8rem;
  padding: 8px;
}

.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.audit-log-table th {
  padding: 8px;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}

.audit-log-table td {
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
}

.audit-log-action {
  font-weight: 600;
}

.audit-log-action.CREATE { color: var(--success); }
.audit-log-action.UPDATE { color: #f59e0b; }
.audit-log-action.DELETE { color: var(--error); }
.audit-log-action.LINK { color: #3b82f6; }
.audit-log-action.MOVE { color: #8b5cf6; }

/* Responsive adjustments for tasks page */
@media (max-width: 900px) {
  .tasks-layout {
    flex-direction: column;
    align-items: stretch;
  }
  .tasks-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
}

@media (min-width: 901px) {
  .touch-move-select {
    display: none;
  }
}

/* User Dropdown Menu */
.user-menu-trigger {
  background: none;
  border: none;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.05);
}

.user-icon {
  stroke: var(--text-secondary);
  transition: var(--transition-smooth);
}

.user-menu-trigger:hover .user-icon {
  stroke: var(--text-primary);
}

.user-name-text {
  display: inline-block;
  max-width: 120px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.user-dropdown-menu {
  position: absolute;
  top: 50px;
  right: 0;
  width: 220px;
  padding: 16px;
  z-index: 1010;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: var(--transition-smooth);
}

.user-dropdown-menu.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

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

.user-info-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-info-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 12px 0;
}

/* Breadcrumbs path navigation */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 10px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow-x: auto;
  white-space: nowrap;
  user-select: none;
  min-width: 0;
}

.breadcrumb-item {
  cursor: pointer;
  transition: var(--transition-smooth);
  min-width: 0;
  max-width: min(320px, 34vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
}

.breadcrumb-item:hover {
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--accent-primary);
  font-weight: 600;
  cursor: default;
}

.breadcrumb-separator {
  color: var(--text-muted);
  font-weight: 400;
}

.editor-top-bar .editor-breadcrumbs {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin-bottom: 0 !important;
}

/* Focused popup width customization */
.modal-container {
  width: calc(100% - 48px) !important;
  max-width: 1392px !important;
  max-height: 95vh;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Scrollable Daily Notes lists */
.daily-notes-scroll-list {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 10px;
}

.daily-note-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: 0.9rem;
}

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

.daily-note-date {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.daily-note-content {
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.4;
}

.btn-daily-note-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.btn-daily-note-delete:hover {
  color: var(--error);
}

/* Category counts & editing rename state */
.category-count-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.sidebar-item.active .category-count-badge {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--text-primary);
}

.category-rename-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--accent-primary);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 2px 6px;
  width: 80%;
  outline: none;
}

/* Subtasks inside Edit Modal */
.subtasks-scroll-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px;
}

.subtask-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.subtask-item-title {
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
}

.subtask-item-title:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

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

.btn-blue {
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-blue:hover {
  background-color: #2563eb;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.empty-placeholder-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  color: var(--text-muted);
  font-size: 0.9rem;
  width: 100%;
}

.btn-task-delete:hover svg {
  stroke: #ef4444;
}

.btn-sidebar-rename {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-item:hover .btn-sidebar-rename {
  opacity: 1;
}

.btn-sidebar-rename:hover {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.1);
}

.btn-sidebar-rename-header {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-sidebar-rename-header:hover {
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.1);
}

.sidebar-item.drag-over-top {
  border-top: 2px solid var(--accent-primary) !important;
}

.sidebar-item.drag-over-bottom {
  border-bottom: 2px solid var(--accent-primary) !important;
}

/* Custom Context Menu */
.context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.context-menu-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  opacity: 0.88;
}

.context-menu-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: default;
  font-weight: 500;
}

.context-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}

#btn-delete-completed {
  margin: 0;
  padding: 0 4px;
  font-size: 0.85rem;
  border: none;
  background: none;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
  transition: var(--transition-smooth);
}

#btn-delete-completed:hover {
  color: #f87171 !important;
  text-decoration: none;
}
.task-item.selected {
  background: rgba(168, 85, 247, 0.12) !important;
  border-color: rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

/* --- PROJECTS MODULE STYLE SYSTEM --- */
.projects-main {
  width: 100%;
  max-width: 1392px;
  margin: 0 auto;
  padding: 24px 0 56px;
  overflow: visible;
}

body.project-editor-active .projects-main {
  padding-top: 4px;
}

body.project-editor-active .app-container {
  padding-top: 84px;
}

.projects-layout {
  display: flex;
  gap: 24px;
  min-height: calc(100vh - 120px);
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

#projects-header-row {
  display: grid !important;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center !important;
  gap: 16px !important;
}

body.project-editor-active #projects-header-row {
  display: none !important;
}

.projects-toolbar-actions,
.projects-toolbar-tools,
.projects-toolbar-nav,
.projects-toolbar-breadcrumb {
  min-width: 0;
}

.projects-toolbar-actions {
  grid-column: 1;
}

.projects-toolbar-nav {
  grid-column: 2;
  justify-self: center;
  max-width: 100%;
}

.projects-toolbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.35);
}

.projects-toolbar-breadcrumb span:first-child {
  color: var(--text-secondary);
  font-size: 1rem;
}

.projects-toolbar-breadcrumb .breadcrumb-separator {
  color: var(--text-muted);
  font-size: 1rem;
}

.projects-toolbar-breadcrumb h2 {
  margin: 0;
  min-width: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.projects-toolbar-tools {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
}

.projects-toolbar-search {
  flex: 0 0 260px;
}

.tags-sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  background: rgba(15, 15, 18, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
}

.tags-sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.tag-filter-list {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  overflow-y: auto;
  max-height: 400px;
}

.tag-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1;
  color: #e9d5ff;
  cursor: pointer;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.28);
  transition: var(--transition-smooth);
  user-select: none;
}

.tag-filter-item:hover {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(168, 85, 247, 0.42);
  color: #f5e8ff;
}

.tag-filter-item.selected {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.68);
  color: #dbeafe;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.18);
}

.tag-filter-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.project-sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 600;
}

.project-sort-control select {
  min-width: 136px;
  padding: 9px 32px 9px 12px;
  border-radius: 8px;
  background: rgba(26, 26, 31, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.projects-grid {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  min-height: 80vh;
}

.project-directory-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.project-directory-section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.project-directory-section-heading small {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}

.project-directory-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, 310px);
  grid-auto-rows: min-content;
  gap: 18px;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
}

.project-directory-items-compact {
  grid-template-columns: repeat(auto-fill, 156px);
  gap: 14px;
}

.project-directory-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 18px;
  width: min(310px, 100%);
}

.project-group-container {
  width: 310px;
  min-height: 250px;
  padding: 20px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.projects-toolbar-separator {
  width: 1px;
  height: 30px;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.project-directory-group-container {
  border-style: dashed !important;
  border-width: 2px !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  background: rgba(99, 102, 241, 0.03) !important;
}

.project-directory-group-container.active {
  border-color: rgba(168, 85, 247, 0.38) !important;
  background: rgba(36, 36, 42, 0.72) !important;
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.12) !important;
}

.project-directory-group-card {
  border-style: solid !important;
  border-width: 1px !important;
  border-color: rgba(99, 102, 241, 0.24) !important;
  background: rgba(99, 102, 241, 0.04) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 156px;
  min-height: 0;
  height: 142px;
  padding: 0;
}

.project-group-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
}

.project-group-card-icon svg {
  width: 24px;
  height: 24px;
}

.project-group-card-text {
  min-width: 0;
  width: 100%;
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.project-group-card-name {
  display: block;
  line-height: 1.15;
  width: 100%;
}

.project-group-card-meta {
  min-height: 1.2em;
  line-height: 1.2;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-directory-group-card:hover {
  border-color: rgba(99, 102, 241, 0.55) !important;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.08) !important;
  background: rgba(99, 102, 241, 0.07) !important;
}

.project-directory-group-card.active {
  border-color: rgba(168, 85, 247, 0.38) !important;
  background: rgba(36, 36, 42, 0.72) !important;
}

.project-group-container.active {
  background: rgba(36, 36, 42, 0.72);
  border-color: rgba(168, 85, 247, 0.38);
  box-shadow: 0 12px 32px rgba(168, 85, 247, 0.12);
}

.project-group-container.active .btn-group-add-project {
  background: rgba(99, 102, 241, 0.62) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.22) !important;
}

.project-group-container.dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

.project-group-container.drag-over {
  border-color: var(--accent-primary);
  background: rgba(168, 85, 247, 0.08);
  transform: scale(1.01);
}

.project-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-group-title-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 700;
  outline: none;
  border-bottom: 1.5px solid transparent;
  padding: 2px 4px;
  transition: var(--transition-smooth);
}

.project-group-title-input:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.03);
}

.btn-group-add-project {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-group-add-project:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.project-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 80px;
  max-height: none;
  overflow-y: visible;
  padding: 12px 4px 2px 0;
  transition: all 0.25s ease;
}

.project-items-list-scrollable {
  max-height: var(--project-list-scroll-height, 900px);
  overflow-y: auto;
  padding-right: 8px;
}

.project-items-list::-webkit-scrollbar {
  width: 4px;
}
.project-items-list::-webkit-scrollbar-track {
  background: transparent;
}
.project-items-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
.project-items-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.project-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  min-height: 48px;
}

.project-item + .project-item {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.project-item.selected {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(129, 140, 248, 0.46);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 8px 22px rgba(99, 102, 241, 0.1);
}

.project-item:active {
  cursor: grabbing;
}

.project-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.project-item.drag-over-item {
  border-color: var(--accent-primary);
  background: rgba(168, 85, 247, 0.08);
}

.project-item.drag-insert-before,
.project-item.drag-insert-after {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
}

.project-item.drag-insert-before::before,
.project-item.drag-insert-after::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.75);
  z-index: 2;
  pointer-events: none;
}

.project-item.drag-insert-before::before {
  top: -8px;
}

.project-item.drag-insert-after::after {
  bottom: -8px;
}

.project-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.btn-project-action {
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-project-action:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Fullscreen Project Editor Modal overlay */
.project-fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  background: rgba(10, 10, 12, 0.98);
  backdrop-filter: blur(15px);
  padding: 40px;
  box-sizing: border-box;
  overflow-y: auto;
}

.project-modal-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#project-modal {
  max-width: none;
  width: 100%;
}

#project-modal .project-modal-container {
  max-width: none;
  width: 100%;
  margin: 0;
}

#project-modal #project-form,
#project-modal .modal-body-grid {
  width: 100%;
}

#project-modal #project-form {
  gap: 0 !important;
}

#project-modal .form-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-weight: 700;
}

.project-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(400px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.project-editor-main,
.project-editor-controls {
  min-width: 0;
}

.project-editor-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

#project-modal .form-input {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.1);
  color-scheme: dark;
}

#project-modal .form-input:focus {
  background: rgba(255, 255, 255, 0.05);
}

.project-description-field {
  min-width: 0;
}

.project-text-tabs-header {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 0;
  min-width: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.project-text-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.project-primary-tabs {
  flex: 0 0 auto;
}

.project-sections-tab-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.project-sections-tab-group-label {
  flex: 0 0 auto;
  padding: 0 2px 9px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-section-tabs {
  flex: 1 1 auto;
}

.project-text-tab {
  flex: 0 0 auto;
  min-height: 36px;
  max-width: 190px;
  padding: 9px 14px 10px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.project-text-tab:hover {
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.32);
  background: rgba(99, 102, 241, 0.1);
}

.project-text-tab.active {
  color: #ffffff;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.22);
  box-shadow: inset 0 2px 0 rgba(129, 140, 248, 0.8);
}

.project-section-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.project-section-tab-label,
.project-section-add-btn {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.project-section-tab-label {
  min-width: 0;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-section-add-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 36px;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-bottom: none;
  background: rgba(99, 102, 241, 0.14);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.project-section-add-btn:hover {
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(129, 140, 248, 0.68);
}

.project-text-editor-shell,
.project-section-panes {
  min-width: 0;
}

.project-text-editor-shell {
  padding-top: 0;
}

.project-text-editor {
  min-height: 368px;
  resize: vertical;
  font-size: 0.95rem;
}

.project-editor-controls {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.project-control-top-row {
  display: grid;
  grid-template-columns: minmax(126px, 0.58fr) minmax(230px, 1fr);
  gap: 24px;
  align-items: end;
}

.project-status-select {
  min-height: 46px;
  background: rgba(20, 20, 24, 0.95) !important;
  cursor: pointer;
}

.project-completion-control {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 54px auto;
  gap: 10px;
  align-items: center;
}

.project-completion-control input[type="range"] {
  width: 100%;
  accent-color: #1d8cff;
}

.project-completion-control input[type="number"] {
  min-height: 42px;
  padding: 8px 10px;
  text-align: center;
}

.project-completion-control span {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.project-control-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.project-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.project-tags-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
  align-self: center;
}

.project-tag-chip {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.project-tag-chip.selected {
  border-color: rgba(99, 102, 241, 0.58);
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.08);
}

.project-tag-toggle,
.project-tag-remove {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  cursor: pointer;
}

.project-tag-toggle {
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.project-tag-chip.selected .project-tag-toggle,
.project-tag-toggle:hover {
  color: var(--text-primary);
}

.project-tag-remove {
  align-self: stretch;
  width: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 1rem;
}

.project-tag-remove:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

.project-tag-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.project-tag-add-row .btn-blue {
  min-width: 70px;
}

.project-compact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 170px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.1);
}

.project-compact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.project-compact-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-compact-row-main strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 750;
}

.project-compact-row-main span,
.project-compact-row-main a {
  color: var(--text-secondary);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-contact-inline-note {
  min-height: 32px;
  padding: 6px 8px !important;
  font-size: 0.82rem !important;
}

.project-tasks-control {
  gap: 10px;
}

.project-task-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

#btn-open-project-tasks {
  min-width: 154px;
  height: 40px;
  padding: 8px 18px;
}

.project-shortcut-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.project-shortcut-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

#project-task-summary {
  display: none;
}

.project-date-row,
.project-extra-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.7fr);
  gap: 8px;
}

.project-daily-logs-section,
.project-attachments-section,
.project-reminders-section,
.project-related-contacts-section,
.project-links-section {
  min-width: 0;
}

.project-editor-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.project-extra-section {
  min-width: 0;
}

.project-extra-section .form-input + .form-input,
.project-extra-section .project-extra-input-row + .form-input {
  margin-top: 8px;
}

.project-expected-outcome {
  grid-column: 1 / -1;
}

.project-delete-link {
  display: none;
  align-self: flex-start;
  margin-top: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(248, 113, 113, 0.62);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.project-delete-link:hover {
  color: #fca5a5;
  text-decoration: underline;
}

.project-bottom-actions {
  justify-content: flex-end;
  padding-top: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--glass-border);
}

/* --- NOTES MODULE --- */
.notes-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 120px);
}

.notes-empty-state[hidden],
.notes-editor-surface[hidden],
.notes-context-menu[hidden],
.notes-modal-backdrop[hidden] {
  display: none !important;
}

.notes-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 8px;
}

.notes-category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.notes-category-tabs::-webkit-scrollbar {
  display: none;
}

.notes-category-tab {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notes-category-tab span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-category-tab:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.notes-category-tab.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.35);
  color: var(--text-primary);
}

.notes-category-add {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notes-category-add:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.notes-tab-color {
  width: 4px;
  height: 20px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.notes-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.notes-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.notes-icon-btn:hover,
.notes-icon-btn.active {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(129, 140, 248, 0.32);
  color: #c7d2fe;
}

.notes-icon-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.notes-ai-icon {
  width: 17px;
  height: 17px;
  position: relative;
  display: inline-block;
}

.notes-ai-icon::before,
.notes-ai-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.notes-ai-icon::before {
  width: 15px;
  height: 15px;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.notes-ai-icon::after {
  width: 5px;
  height: 5px;
  left: 82%;
  top: 18%;
  opacity: 0.72;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.notes-workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.notes-sidebar,
.notes-editor {
  border-radius: 8px;
  min-height: 0;
}

.notes-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.notes-sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.notes-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}

.notes-tree-section + .notes-tree-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.notes-tree-book {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.notes-tree-row {
  width: 100%;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 720;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.notes-tree-row:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.notes-tree-row.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.25);
  color: #c7d2fe;
}

.notes-book-row {
  color: var(--text-primary);
  font-weight: 800;
}

.notes-book-row.book-selected {
  background: rgba(99, 102, 241, 0.11);
  border-color: rgba(129, 140, 248, 0.22);
}

.notes-book-row.drag-over {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.34);
  color: #a7f3d0;
}

.notes-page-row.dragging {
  opacity: 0.55;
}

.notes-book-pages {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 18px;
}

.notes-row-chevron {
  width: 12px;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  flex: 0 0 auto;
}

.notes-page-icon {
  width: 11px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 2px;
  opacity: 0.65;
  flex: 0 0 auto;
}

.notes-book-icon {
  width: 14px;
  height: 13px;
  position: relative;
  border: 1px solid currentColor;
  border-radius: 2px 4px 4px 2px;
  opacity: 0.72;
  flex: 0 0 auto;
}

.notes-book-icon::before {
  content: "";
  position: absolute;
  inset: 1px auto 1px 3px;
  width: 1px;
  background: currentColor;
  opacity: 0.75;
}

.notes-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notes-tree-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  padding: 7px 8px;
}

.notes-editor {
  overflow: hidden;
  display: flex;
  min-width: 0;
}

.notes-empty-state {
  width: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
}

.notes-empty-state h1 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 800;
}

.notes-editor-surface {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.notes-editor-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.notes-title-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 850;
}

.notes-title-input::placeholder,
.notes-content-input::placeholder {
  color: rgba(148, 163, 184, 0.52);
}

.notes-content-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1.03rem;
  font-weight: 450;
  line-height: 1.65;
  padding: 24px;
}

.notes-context-menu {
  position: fixed;
  z-index: 5000;
  width: 220px;
  padding: 5px;
  border-radius: 8px;
}

.notes-context-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 720;
  text-align: left;
  cursor: pointer;
}

.notes-context-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.notes-context-item.danger:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.notes-menu-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.notes-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.notes-modal {
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 8px;
}

.notes-modal h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 850;
}

.notes-confirm-message {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.notes-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- AI CHAT MODULE --- */
.ai-main {
  width: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  min-height: calc(100vh - 120px);
}

.ai-history,
.ai-chat-shell {
  border-radius: 8px;
  min-height: 0;
}

.ai-history {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-history-top {
  padding: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.ai-history-top .btn-task-focus-save {
  width: 100%;
}

.ai-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-history-empty {
  padding: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.ai-agent-card {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ai-agent-card:hover {
  background: rgba(255, 255, 255, 0.035);
}

.ai-agent-card.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.28);
}

.ai-agent-card.pinned {
  order: -1;
}

.ai-agent-history-btn,
.ai-agent-edit-btn {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ai-agent-history-btn:hover,
.ai-agent-edit-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.ai-agent-history-btn::before {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-left-color: transparent;
}

.ai-agent-history-btn::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 2px;
  background: currentColor;
  transform: translate(-1px, 1px) rotate(35deg);
}

.ai-agent-select {
  width: 100%;
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
}

.ai-agent-card.active .ai-agent-select,
.ai-agent-select:hover {
  color: var(--text-primary);
}

.ai-agent-name {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-chat-history-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ai-chat-history-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.ai-chat-history-item.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.28);
  color: var(--text-primary);
}

.ai-history-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 780;
}

.ai-history-date {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.ai-chat-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.ai-chat-title {
  padding: 16px 22px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ai-welcome {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.ai-welcome h1 {
  color: var(--text-primary);
  font-size: 1.6rem;
  font-weight: 850;
}

.ai-message {
  display: flex;
  width: 100%;
}

.ai-message-user {
  justify-content: flex-end;
}

.ai-message-assistant {
  justify-content: flex-start;
}

.ai-message-bubble {
  max-width: min(760px, 88%);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text-primary);
  line-height: 1.58;
}

.ai-message-user .ai-message-bubble {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(129, 140, 248, 0.35);
}

.ai-message-assistant .ai-message-bubble {
  background: rgba(255, 255, 255, 0.035);
}

.ai-plain-text,
.ai-typing-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-formatted {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-wrap: anywhere;
}

.ai-formatted p {
  margin: 0;
}

.ai-formatted h2,
.ai-formatted h3 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-weight: 850;
  line-height: 1.25;
}

.ai-formatted h2 {
  font-size: 1.08rem;
}

.ai-formatted h3 {
  font-size: 1rem;
}

.ai-formatted ul,
.ai-formatted ol {
  margin: 0;
  padding-left: 20px;
}

.ai-formatted li + li {
  margin-top: 4px;
}

.ai-code-block {
  max-width: 100%;
  overflow-x: auto;
  margin: 0;
  padding: 12px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(0, 0, 0, 0.28);
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
}

.ai-inline-code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.24);
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

.ai-error {
  color: #fca5a5;
  white-space: pre-wrap;
}

.ai-waiting-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 40px;
  min-height: 24px;
}

.ai-waiting-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7d2fe;
  opacity: 0.35;
  animation: aiWaitingDots 1.1s ease-in-out infinite;
}

.ai-waiting-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.ai-waiting-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes aiWaitingDots {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid var(--glass-border);
}

.ai-input {
  width: 100%;
  max-height: 180px;
  resize: none;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.96rem;
  line-height: 1.45;
  outline: none;
  padding: 11px 13px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.ai-input:focus {
  border-color: rgba(129, 140, 248, 0.55);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.ai-input::placeholder {
  color: rgba(148, 163, 184, 0.58);
}

.ai-send-btn {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(129, 140, 248, 0.5);
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.22);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.ai-send-btn:hover {
  border-color: rgba(196, 181, 253, 0.7);
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}

.ai-send-btn:disabled,
.ai-input:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ai-context-menu {
  position: fixed;
  z-index: 5200;
  width: 180px;
  padding: 5px;
  border-radius: 8px;
}

.ai-context-menu[hidden] {
  display: none !important;
}

.ai-context-item {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 740;
  text-align: left;
  cursor: pointer;
}

.ai-context-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.ai-context-item.danger:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ai-modal-backdrop[hidden] {
  display: none !important;
}

.ai-modal {
  width: min(620px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  overflow: hidden;
}

.ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 850;
}

.ai-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
}

.ai-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.agent-history-list {
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-history-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.agent-history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.agent-history-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-history-item small {
  color: var(--text-muted);
  flex: 0 0 auto;
}

.ai-field-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.ai-agent-prompt-input {
  min-height: 180px;
  resize: vertical;
}

.ai-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ai-delete-agent-btn {
  margin-right: auto;
  border: none;
  background: transparent;
  color: rgba(252, 165, 165, 0.72);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.ai-delete-agent-btn:hover {
  color: #fca5a5;
}

/* --- FILES MODULE --- */
.files-main {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
}

.files-shell {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
}

.files-toolbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
}

.files-icon-btn,
.files-tool-btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.files-icon-btn {
  width: 34px;
  padding: 0;
  flex: 0 0 auto;
}

.files-tool-btn {
  padding: 0 12px;
  white-space: nowrap;
}

.files-icon-btn svg,
.files-tool-btn svg,
.files-item-icon svg,
.files-empty svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.files-icon-btn:hover:not(:disabled),
.files-tool-btn:hover:not(:disabled),
.files-tool-btn.has-clip {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(129, 140, 248, 0.32);
  color: var(--text-primary);
}

.files-icon-btn:disabled,
.files-tool-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.files-tool-btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), #4f46e5);
  border-color: rgba(129, 140, 248, 0.5);
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.24);
}

.files-tool-btn.primary:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.34);
}

.files-breadcrumbs {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.files-breadcrumbs::-webkit-scrollbar {
  display: none;
}

.files-crumb {
  height: 30px;
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 780;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.files-crumb:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.files-crumb.active {
  color: var(--text-primary);
  cursor: default;
}

.files-crumb.active:hover {
  background: transparent;
}

.files-crumb-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  user-select: none;
}

.files-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.files-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  background: rgba(5, 8, 14, 0.2);
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.files-item {
  min-width: 0;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  padding: 12px 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.files-item:hover,
.files-item.selected {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.files-item.dragging {
  opacity: 0.48;
}

.files-item.drag-over {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(129, 140, 248, 0.42);
}

.files-item-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.files-item-icon svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.55;
}

.files-item-icon.folder,
.files-item-icon.archive {
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

.files-item-icon.image,
.files-item-icon.sheet {
  color: #34d399;
  background: rgba(16, 185, 129, 0.1);
}

.files-item-icon.pdf {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.1);
}

.files-item-icon.doc {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.1);
}

.files-item-icon.video {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.1);
}

.files-item-icon.audio {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.1);
}

.files-item-name {
  width: 100%;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.24;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.files-item-detail {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.files-empty {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}

.files-empty[hidden] {
  display: none !important;
}

.files-empty svg {
  width: 58px;
  height: 58px;
  stroke-width: 1.35;
  opacity: 0.65;
}

.files-empty p {
  color: var(--text-secondary);
  font-weight: 780;
}

.files-empty small {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.files-dropzone {
  position: absolute;
  inset: 14px;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(129, 140, 248, 0.58);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  pointer-events: none;
}

.files-dropzone.visible {
  display: flex;
}

.files-dropzone span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.92);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 840;
}

.files-statusbar {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 14px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 740;
}

.files-context-menu {
  position: fixed;
  z-index: 5400;
  min-width: 174px;
  padding: 5px;
  border-radius: 8px;
}

.files-context-menu[hidden] {
  display: none !important;
}

.files-context-item {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.files-context-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.files-context-item.danger:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.files-context-separator {
  height: 1px;
  margin: 4px 2px;
  background: var(--glass-border);
}

.files-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.files-modal-backdrop[hidden] {
  display: none !important;
}

.files-modal {
  width: min(460px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
}

.files-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.files-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.06rem;
  font-weight: 850;
}

.files-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  cursor: pointer;
}

.files-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.files-field-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.files-modal-copy {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.files-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.files-danger-btn {
  min-width: 72px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.files-danger-btn:hover {
  background: rgba(239, 68, 68, 0.18);
}

.files-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 5500;
  min-width: 160px;
  max-width: min(360px, calc(100vw - 48px));
  padding: 10px 14px;
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.94);
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.36);
  font-size: 0.88rem;
  font-weight: 760;
}

.files-toast[hidden] {
  display: none !important;
}

.files-toast.error {
  border-color: rgba(248, 113, 113, 0.38);
  color: #fca5a5;
}

/* --- CONTACTS MODULE --- */
.contacts-main {
  width: 100%;
  min-height: calc(100vh - 120px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}

.contacts-side,
.contacts-workspace {
  min-height: 0;
}

.contacts-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  overflow-y: auto;
}

.contacts-side-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contacts-side-section + .contacts-side-section {
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.contacts-side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contacts-mini-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 1rem;
  cursor: pointer;
}

.contacts-mini-btn:hover {
  color: var(--text-primary);
  border-color: rgba(129, 140, 248, 0.32);
}

.contacts-filter-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.contacts-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 5px;
}

.contacts-filter-btn {
  min-width: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.contacts-filter-btn:hover,
.contacts-filter-btn.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.contacts-filter-btn span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-filter-btn small {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.contacts-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.contacts-tag-remove {
  width: 26px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(252, 165, 165, 0.65);
  font-family: var(--font-sans);
  font-weight: 850;
  cursor: pointer;
}

.contacts-tag-remove:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.contacts-side-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 6px 4px;
}

.contacts-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contacts-toolbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}

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

.contacts-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.contacts-search input {
  width: 100%;
  height: 36px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
}

.contacts-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.16);
}

.contacts-view-toggle {
  height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.contacts-view-toggle button {
  height: 28px;
  padding: 0 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.contacts-view-toggle button.active {
  background: rgba(99, 102, 241, 0.18);
  color: var(--text-primary);
}

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

.contacts-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.contacts-row:hover,
.contacts-person-card:hover {
  border-color: rgba(129, 140, 248, 0.28);
}

.contact-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(129, 140, 248, 0.32);
  border-radius: 50%;
  background-color: rgba(99, 102, 241, 0.16);
  background-position: center;
  background-size: cover;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 900;
}

.contact-avatar.lg {
  width: 72px;
  height: 72px;
  font-size: 1.08rem;
}

.contact-avatar.xl {
  width: 96px;
  height: 96px;
  font-size: 1.3rem;
}

.contacts-row-main {
  min-width: 0;
}

.contacts-row-title,
.contacts-person-name {
  color: var(--text-primary);
  font-weight: 850;
}

.contacts-row-sub,
.contacts-person-sub {
  min-height: 18px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.contacts-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 760;
}

.contacts-chip.date {
  border-color: rgba(251, 191, 36, 0.32);
  color: #fde68a;
}

.contacts-chip.call {
  border-color: rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
}

.contacts-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.contacts-row-meta span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-visual-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 12px;
}

.contacts-visual-view[hidden],
.contacts-list-view[hidden] {
  display: none !important;
}

.contacts-person-card {
  min-height: 176px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px 14px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
}

.contacts-person-name,
.contacts-person-sub {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-card-task-btn {
  margin-top: auto;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.contacts-card-task-btn:hover {
  color: var(--text-primary);
  border-color: rgba(129, 140, 248, 0.32);
}

.contacts-empty {
  padding: 36px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-align: center;
}

.contacts-empty[hidden] {
  display: none !important;
}

.contacts-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 7, 12, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.contacts-modal-backdrop[hidden] {
  display: none !important;
}

.contacts-editor {
  width: min(1040px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 8px;
  overflow: hidden;
}

.contacts-taxonomy-modal {
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 8px;
}

.contacts-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}

.contacts-editor-header h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 880;
}

.contacts-editor-header p {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
}

.contacts-modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  cursor: pointer;
}

.contacts-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.contacts-editor-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  overflow-y: auto;
}

.contacts-avatar-editor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contacts-form {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contacts-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contacts-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 820;
}

.contacts-field.wide {
  grid-column: 1 / -1;
}

.contacts-field textarea {
  resize: vertical;
}

.contacts-color-input {
  height: 42px;
  padding: 5px;
}

.contacts-picker-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contacts-picker-title {
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 820;
}

.contacts-chip-picker {
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.contacts-picker-chip {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--chip-color);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.contacts-picker-chip.selected {
  background: rgba(99, 102, 241, 0.18);
  color: var(--text-primary);
}

.contacts-picker-empty {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.contact-projects-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-projects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 150px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.contact-project-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  text-decoration: none;
}

.contact-project-row:hover {
  border-color: rgba(99, 102, 241, 0.42);
  background: rgba(99, 102, 241, 0.08);
}

.contact-project-row small {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contacts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 780;
}

.contacts-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.contacts-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.contacts-delete-link {
  margin-right: auto;
  border: none;
  background: transparent;
  color: rgba(252, 165, 165, 0.7);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 820;
  cursor: pointer;
}

.contacts-delete-link:hover {
  color: #fca5a5;
  text-decoration: underline;
}

@media (max-width: 980px) {
  .contacts-main {
    grid-template-columns: 1fr;
  }

  .contacts-side {
    max-height: none;
  }

  .contacts-toolbar {
    flex-wrap: wrap;
  }

  .contacts-search {
    flex-basis: 100%;
  }

  .contacts-editor-body {
    grid-template-columns: 1fr;
  }

  .contacts-form-grid,
  .contacts-picker-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .files-toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .files-breadcrumbs {
    order: 3;
    flex-basis: 100%;
  }

  .files-toolbar-actions {
    margin-left: auto;
  }

  .files-tool-btn span {
    display: none;
  }

  .files-tool-btn {
    width: 34px;
    padding: 0;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  }
}

/* --- CALENDAR MODULE --- */
.calendar-main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 0 80px;
}

.calendar-year-toolbar {
  position: sticky;
  top: 88px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: 8px;
}

.calendar-year-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.calendar-year-control span {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.calendar-year-control input {
  width: 96px;
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 800;
  text-align: center;
  outline: none;
}

.calendar-year-control input::-webkit-outer-spin-button,
.calendar-year-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calendar-days-panel {
  overflow: hidden;
  border-radius: 8px;
}

.calendar-days-list {
  display: flex;
  flex-direction: column;
}

.calendar-row {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 44px;
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.calendar-row:last-child {
  border-bottom: none;
}

.calendar-row:hover {
  background: rgba(99, 102, 241, 0.04);
}

.calendar-row.weekend,
.calendar-row.holiday {
  background: rgba(59, 130, 246, 0.055);
  border-bottom-color: rgba(147, 197, 253, 0.14);
}

.calendar-row.weekend .calendar-date-label,
.calendar-row.holiday .calendar-date-label {
  background: rgba(59, 130, 246, 0.06);
}

.calendar-row.weekend .calendar-date-day,
.calendar-row.holiday .calendar-date-day {
  color: #b7d2f8;
}

.calendar-row.today {
  position: relative;
  background: rgba(99, 102, 241, 0.08);
}

.calendar-row.today::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent-primary);
}

.calendar-date-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-right: 1px solid var(--glass-border);
  color: var(--text-secondary);
  min-width: 0;
}

.calendar-date-main {
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.88rem;
  min-width: 58px;
}

.calendar-date-day {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 6px 12px;
}

.calendar-cell.has-chips {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.calendar-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.calendar-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  transition: var(--transition-smooth);
}

.calendar-chip:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
}

.calendar-chip-custom-event {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(129, 140, 248, 0.42);
  color: #c7d2fe;
}

.calendar-chip-remove {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
  transition: var(--transition-smooth);
}

.calendar-chip-remove:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.16);
}

.calendar-chip-remove:disabled {
  cursor: wait;
  opacity: 0.45;
}

.calendar-event-input {
  width: 100%;
  min-height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 650;
  outline: none;
  padding: 3px 6px;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.calendar-event-input::placeholder {
  color: transparent;
}

.calendar-event-input:hover {
  background: transparent;
}

.calendar-event-input:focus {
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(129, 140, 248, 0.55);
}

.calendar-event-input:disabled {
  opacity: 0.65;
  cursor: wait;
}

.calendar-chip-prefix {
  flex: 0 0 auto;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.calendar-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-chip-task-start {
  background: rgba(59, 130, 246, 0.13);
  border-color: rgba(59, 130, 246, 0.36);
  color: #93c5fd;
}

.calendar-chip-task-end {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.34);
  color: #fca5a5;
}

.calendar-chip-project-start {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.34);
  color: #6ee7b7;
}

.calendar-chip-project-end {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.38);
  color: #d8b4fe;
}

.calendar-chip-project-reminder {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.38);
  color: #c7d2fe;
}

.calendar-chip-contact-birthday {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.36);
  color: #fde68a;
}

.calendar-chip-contact-call {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.36);
  color: #bae6fd;
}

.calendar-empty-state {
  padding: 40px;
  color: var(--text-secondary);
  text-align: center;
}

.project-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.project-modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.project-form-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.project-tags-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.project-tag-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.folder-indicator {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--accent-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.project-action-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-smooth);
  padding: 0;
}

.project-action-icon-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--accent-primary);
  color: white;
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-info-panel,
  .auth-card {
    padding: 28px;
  }

  .auth-info-title {
    font-size: 1.35rem;
  }

  .auth-brand-text {
    font-size: 2.4rem;
  }
}

@media (max-width: 900px) {
  #projects-header-row {
    grid-template-columns: 1fr;
  }

  .projects-toolbar-actions,
  .projects-toolbar-nav,
  .projects-toolbar-tools {
    grid-column: 1;
    justify-self: stretch;
  }

  .projects-toolbar-tools {
    justify-content: space-between;
    gap: 14px;
  }

  .projects-toolbar-search {
    flex: 1 1 220px;
  }

  .projects-layout {
    flex-direction: column;
  }

  .tags-sidebar {
    width: 100% !important;
    order: 2;
  }

  .projects-grid {
    width: 100%;
  }

  .project-directory-items {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .project-group-container,
  .project-directory-group-card {
    width: 100%;
  }

  .project-editor-grid,
  .project-control-top-row,
  .project-editor-secondary {
    grid-template-columns: 1fr;
  }

  .project-task-actions-row,
  .project-date-row,
  .project-extra-input-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .project-shortcut-toggle {
    white-space: normal;
  }

  .project-text-tabs-header,
  .project-sections-tab-group {
    flex-wrap: wrap;
    align-items: flex-end;
  }

  .project-sections-tab-group {
    flex-basis: 100%;
    padding-left: 0;
    border-left: none;
  }

  .notes-workspace {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    min-height: 240px;
  }

  .notes-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .notes-toolbar-actions {
    justify-content: flex-end;
  }

  .ai-main {
    grid-template-columns: 1fr;
  }

  .ai-history {
    min-height: 220px;
  }

  .ai-message-bubble {
    max-width: 94%;
  }

  .calendar-main {
    max-width: 100%;
  }

  .calendar-year-toolbar {
    top: 82px;
    justify-content: space-between;
  }

  .calendar-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
  }

  .calendar-days-panel {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .calendar-days-list {
    gap: 10px;
  }

  .calendar-date-label {
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.025);
  }

  .calendar-cell {
    min-height: 46px;
  }
}

@media (max-width: 600px) {
  #projects-header-row {
    align-items: stretch !important;
  }

  .projects-toolbar-actions,
  .projects-toolbar-tools,
  .projects-toolbar-nav,
  .search-bar-container,
  .project-sort-control {
    width: 100% !important;
  }

  .projects-toolbar-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .projects-toolbar-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .projects-toolbar-nav {
    flex-wrap: wrap;
  }

  .projects-toolbar-breadcrumb {
    max-width: 100%;
  }

  .project-sort-control {
    justify-content: space-between;
  }

  .project-sort-control select {
    flex: 1;
  }
}
