:root {
  --background: oklch(0.98 0.01 264);
  --foreground: oklch(0.15 0.02 264);
  --card: oklch(1 0 0);
  --primary: oklch(0.6 0.25 264);
  --border: oklch(0.92 0.01 264);
  --muted: oklch(0.95 0.01 264);
  --muted-foreground: oklch(0.45 0.02 264);
  --radius: 1rem;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  
  --blue: #3b82f6;
  --green: #10b981;
  --amber: #f59e0b;
  --purple: #8b5cf6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: var(--background); color: var(--foreground); min-height: 100vh; }

.hidden { display: none !important; }

/* Login Styles */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, oklch(0.95 0.05 264), oklch(0.9 0.1 280));
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  padding: 3rem 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border);
}

.login-header { text-align: center; margin-bottom: 2.5rem; }
.logo-icon.large { width: 56px; height: 56px; margin: 0 auto 1rem; font-size: 1.5rem; }
.logo-text.large { font-size: 1.8rem; margin-bottom: 0.5rem; background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.login-subtitle { color: var(--muted-foreground); font-size: 0.9rem; }

.input-with-icon { position: relative; }
.input-with-icon i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted-foreground); }
.input-with-icon .input-field { padding-left: 2.75rem; }

.login-footer { text-align: center; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.login-footer p { font-size: 0.8rem; color: var(--muted-foreground); }

/* Dashboard Common */
.dashboard-wrapper { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.logo-area { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon { background: linear-gradient(135deg, var(--primary), #a855f7); color: white; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.logo-text { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.05em; }
.badge { background: var(--primary); color: white; padding: 0.2rem 0.6rem; border-radius: 99px; font-size: 0.7rem; font-weight: 700; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--muted); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Dashboard Views */
.status-board { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; margin-bottom: 2.5rem; }
.status-card { background: var(--card); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; transition: transform 0.2s; }
.status-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.status-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.status-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.status-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status-icon.amber { background: rgba(245, 158, 11, 0.1); color: var(--amber); }
.status-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--purple); }
.status-label { font-size: 0.85rem; color: var(--muted-foreground); font-weight: 500; }
.status-value { font-size: 1.4rem; font-weight: 700; }

.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.action-item { background: var(--card); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; cursor: pointer; text-align: left; transition: all 0.2s; }
.action-item:hover { border-color: var(--primary); background: oklch(0.99 0.01 264); }
.action-icon { background: var(--muted); width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); transition: 0.2s; }
.action-item:hover .action-icon { background: var(--primary); color: white; }
.action-text h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.15rem; }
.action-text p { font-size: 0.8rem; color: var(--muted-foreground); }
.arrow { margin-left: auto; opacity: 0.3; width: 16px; transition: 0.2s; }
.action-item:hover .arrow { opacity: 1; transform: translateX(3px); color: var(--primary); }

/* Table Styles */
.management-container { padding: 1.5rem; }
.table-controls { margin-bottom: 1.5rem; }
.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table th { padding: 1rem; text-align: left; font-size: 0.8rem; font-weight: 700; color: var(--muted-foreground); border-bottom: 2px solid var(--border); }
.data-table td { padding: 1rem; font-size: 0.85rem; border-bottom: 1px solid var(--border); color: var(--foreground); }
.font-bold { font-weight: 700; }
.badge-sub { background: var(--muted); padding: 0.25rem 0.5rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); }
.badge-sub-success { background: oklch(0.9 0.1 150); color: oklch(0.3 0.1 150); }
.badge-sub-warning { background: oklch(0.95 0.05 80); color: oklch(0.4 0.1 80); }
.badge-sub-error { background: oklch(0.9 0.1 20); color: oklch(0.3 0.1 20); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-text { color: var(--primary); text-decoration: none; font-weight: 500; }
.text-center { text-align: center; }
.action-btns { display: flex; gap: 0.5rem; justify-content: center; }
.btn-table { background: none; border: 1px solid var(--border); padding: 0.4rem; border-radius: 8px; cursor: pointer; color: var(--muted-foreground); display: flex; align-items: center; justify-content: center; }
.btn-table:hover { background: var(--muted); color: var(--foreground); border-color: var(--muted-foreground); }
.btn-table.delete:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; border-color: #ef4444; }
.btn-primary-small { background: var(--primary); color: white; border: none; padding: 0.5rem 1rem; border-radius: 10px; font-size: 0.85rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }

/* Enhanced Search & Select UI */
.search-select-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.premium-search-group {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 0.85rem;
  height: 44px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.premium-search-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.premium-search-group i {
  width: 18px;
  color: var(--muted-foreground);
  margin-right: 0.75rem;
}

.premium-search-group .search-input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--foreground);
  outline: none;
}

.select-modern {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--background);
  font-family: inherit;
  font-size: 0.9rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
  transition: all 0.2s;
  cursor: pointer;
}

.select-modern:focus {
  border-color: var(--primary);
  background-color: var(--card);
  outline: none;
}

/* Premium Search Bar & Selects (Existing Task List styles updated) */
.premium-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 0.75rem;
  height: 42px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.premium-search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

.search-icon {
  width: 18px;
  color: var(--muted-foreground);
  margin-right: 0.75rem;
}

.search-input {
  border: none;
  background: transparent;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--foreground);
  outline: none;
}

.search-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.7;
}

.search-badge {
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  pointer-events: none;
}

/* Editor Form Styles */
.view-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.btn-icon { background: none; border: 1px solid var(--border); padding: 0.5rem; border-radius: 50%; cursor: pointer; color: var(--muted-foreground); display: flex; align-items: center; }
.btn-icon:hover { background: var(--muted); color: var(--foreground); }

.editor-form { padding: 2rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.6rem; }
.form-group.full-width { grid-column: span 2; }
.form-group label { font-size: 0.85rem; font-weight: 700; }

.segmented-control { display: flex; background: var(--muted); padding: 0.25rem; border-radius: 10px; gap: 0.25rem; }
.segment-item { flex: 1; position: relative; cursor: pointer; }
.segment-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.segment-item span { display: block; padding: 0.5rem; text-align: center; font-size: 0.85rem; font-weight: 600; border-radius: 8px; transition: all 0.2s; color: var(--muted-foreground); }
.segment-item input:checked + span { background: var(--card); color: var(--primary); box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.input-field { width: 100%; padding: 0.8rem; border: 1px solid var(--border); border-radius: 10px; background: var(--background); font-family: inherit; font-size: 0.9rem; }
.input-field:focus { outline: none; border-color: var(--primary); }
.textarea { min-height: 120px; }
.textarea-small { min-height: 80px; }
.radio-group { display: flex; flex-direction: column; gap: 0.75rem; padding: 0.25rem 0; }
.radio-item { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; cursor: pointer; }

.upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 2.5rem; text-align: center; color: var(--muted-foreground); cursor: pointer; }
.upload-area:hover { border-color: var(--primary); background: rgba(139, 92, 246, 0.03); }
.btn-generate { width: 100%; padding: 1rem; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 0.75rem; cursor: pointer; box-shadow: 0 8px 15px -3px rgba(139, 92, 246, 0.3); }

@media (max-width: 640px) {
  .status-board, .action-grid, .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
}
