:root {
  color-scheme: dark;
  --bg: #0f141b;
  --surface: rgba(27, 34, 44, 0.88);
  --surface-2: rgba(42, 51, 64, 0.78);
  --surface-3: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f9fc;
  --muted: #a9b4c4;
  --brand: #37d67a;
  --brand-2: #58a6ff;
  --danger: #ff5c7a;
  --warning: #ffcc4d;
  --violet: #b48cff;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --soft-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(88, 166, 255, 0.13), transparent 34rem),
    linear-gradient(180deg, #101722 0%, var(--bg) 46%, #0c1118 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: rgba(16, 21, 29, 0.82);
  backdrop-filter: blur(22px);
  padding: 26px 20px;
}

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

.brand-mark,
.avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #091017;
  font-weight: 800;
}

.small-avatar {
  width: 36px;
  height: 36px;
  color: #071017;
}

.brand small,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.bottom-nav a {
  border-radius: 14px;
  color: var(--muted);
  padding: 12px 14px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item.active,
.nav-item:hover,
.bottom-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.nav-item:hover {
  transform: translateX(2px);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.92rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 24px 96px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-menu {
  position: relative;
}

.account-menu summary,
.user-editor summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  cursor: pointer;
  list-style: none;
  padding: 6px 10px;
}

.account-menu summary::-webkit-details-marker,
.user-editor summary::-webkit-details-marker {
  display: none;
}

.account-menu small,
.user-editor small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 30;
}

.account-dropdown a {
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
}

.account-dropdown a:hover {
  background: var(--surface-2);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.6rem);
}

h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.primary-action,
.success-button,
.ghost-button,
.danger-button,
.filter-chip,
.icon-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand), #8ff0b7);
  box-shadow: 0 10px 24px rgba(55, 214, 122, 0.22);
  color: #07110c;
  padding: 12px 18px;
}

.primary-action:hover,
.success-button:hover,
.ghost-button:hover,
.danger-button:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.success-button {
  background: rgba(55, 214, 122, 0.14);
  border: 1px solid rgba(55, 214, 122, 0.24);
  color: var(--brand);
  padding: 10px 14px;
}

.success-button:disabled,
.primary-action:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.danger-button {
  background: rgba(255, 92, 122, 0.14);
  border: 1px solid rgba(255, 92, 122, 0.28);
  color: #ff9aae;
  padding: 10px 14px;
}

.ghost-button,
.filter-chip {
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
}

.filter-row {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 4px;
}

.filter-chip {
  min-height: 38px;
  border-radius: 14px;
  color: var(--muted);
  padding: 8px 13px;
}

.filter-chip.active {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
  color: #101722;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  padding: 18px;
}

.dashboard-hero h2 {
  font-size: 1.8rem;
}

.metric-card,
.panel,
.task-card,
.user-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2.2rem;
}

.metric-card.alert strong {
  color: var(--danger);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.panel {
  padding: 18px;
  backdrop-filter: blur(18px);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading a {
  color: var(--brand);
  font-weight: 700;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list.cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-card {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.task-card::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.1), transparent 36%);
  content: "";
  pointer-events: none;
}

.task-card > * {
  position: relative;
}

.dashboard-task-card {
  border-left: 5px solid var(--brand-2);
}

.dashboard-task-card.overdue-card {
  border-left-color: var(--danger);
}

.dashboard-general-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-task-section {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.task-section-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.035);
  padding: 16px;
}

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.dashboard-section-heading h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.month-filter {
  width: min(190px, 100%);
  gap: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.month-filter select {
  min-height: 40px;
  border-radius: 12px;
  padding: 8px 10px;
  text-transform: none;
}

.type-dot {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  color: #071017;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 5px 12px;
}

.general-dot {
  background: #58a6ff;
}

.personal-dot {
  background: #37d67a;
}

.dashboard-task-list {
  display: grid;
  gap: 10px;
}

.dashboard-task-row {
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: var(--soft-shadow);
}

.dashboard-task-row.general-task .dashboard-task-accent {
  background: #58a6ff;
}

.dashboard-task-row.personal-task .dashboard-task-accent {
  background: #37d67a;
}

.dashboard-task-row.is-overdue {
  border-color: rgba(255, 92, 122, 0.42);
}

.dashboard-task-content {
  display: grid;
  gap: 10px;
  padding: 13px 14px;
}

.dashboard-task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-task-head h2 {
  margin: 2px 0 0;
  font-size: 1rem;
}

.dashboard-task-compact .dashboard-task-head {
  align-items: flex-start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.dashboard-task-compact .status-pill {
  min-height: 26px;
  padding: 3px 9px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.task-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-task-description {
  margin: 0;
  color: var(--text);
}

.dashboard-task-date {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.dashboard-task-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.dashboard-task-meta.compact-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-task-meta div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 10px;
}

.dashboard-task-meta dd {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-color-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  border: 1px solid color-mix(in srgb, var(--user-color) 62%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--user-color) 20%, transparent);
  color: var(--text);
  font-weight: 850;
  padding: 3px 9px;
}

.user-color-chip::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--user-color);
  content: "";
  margin-right: 7px;
}

.date-overdue {
  color: var(--danger);
}

.date-soon {
  color: var(--warning);
}

.dashboard-complete-form,
.task-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-action-form {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.task-delete-form {
  border-top: 1px solid rgba(255, 92, 122, 0.18);
  margin-top: 10px;
  padding-top: 10px;
}

.task-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-comments {
  display: grid;
  gap: 8px;
}

.task-comment {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(88, 166, 255, 0.18);
  border-radius: 14px;
  background: rgba(88, 166, 255, 0.06);
  padding: 10px;
}

.task-comment p {
  margin: 0;
  color: var(--text);
}

.dashboard-complete-form input,
.task-action-form input {
  min-height: 40px;
  padding: 9px 11px;
}

.small-button {
  min-height: 40px;
  padding: 8px 12px;
}

.history-card {
  border-left: 5px solid var(--brand);
}

.task-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-meta,
.card-actions,
.toolbar,
.filter-row,
.time-row,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pill.open {
  background: rgba(88, 166, 255, 0.16);
  color: #8fc2ff;
}

.status-pill.completed {
  background: rgba(55, 214, 122, 0.16);
  color: var(--brand);
}

.status-pill.cancelled {
  background: rgba(255, 92, 122, 0.16);
  color: var(--danger);
}

.task-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0;
}

.task-details div {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

dt {
  color: var(--muted);
  font-size: 0.78rem;
}

dd {
  margin: 4px 0 0;
  font-weight: 700;
}

.quote-panel {
  display: grid;
  place-items: center;
  text-align: center;
}

.quote-ring {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--value) * 1%), var(--surface-2) 0);
}

.quote-ring span {
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 2rem;
  font-weight: 800;
}

.settings-grid,
.user-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-panel {
  display: grid;
  gap: 12px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  padding: 12px;
}

select {
  color-scheme: dark;
}

select option {
  background: #18212c;
  color: #f7f9fc;
}

select option:checked,
select option:hover {
  background: #58a6ff;
  color: #071017;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(88, 166, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.14);
  outline: none;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.responsive-table {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  padding: 18px;
  z-index: 20;
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(620px, 100%);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.icon-button {
  width: 44px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.task-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  flex: 1 1 100%;
}

.inline-form select {
  max-width: 180px;
}

.inline-form input {
  min-width: 220px;
  flex: 1;
}

.edit-details {
  width: 100%;
}

.edit-details summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
}

.edit-details summary::-webkit-details-marker {
  display: none;
}

.edit-form,
.settings-form {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.settings-form + .settings-form {
  margin-top: 16px;
}

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

.form-actions button {
  min-width: 132px;
}

.reminder-schedule {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.notification-note {
  margin: 0;
  border: 1px solid rgba(255, 204, 77, 0.24);
  border-radius: 12px;
  background: rgba(255, 204, 77, 0.08);
  color: #ffe3a1;
  font-size: 0.9rem;
  padding: 10px 12px;
}

.session-secret-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  padding: 10px 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-editor {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.user-editor + .user-editor {
  margin-top: 12px;
}

.checkbox-label {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: flex-start;
}

.checkbox-label input {
  width: auto;
}

.setting-key,
.completion-comment {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.completion-note {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(55, 214, 122, 0.2);
  border-radius: 14px;
  background: rgba(55, 214, 122, 0.07);
  padding: 10px;
}

.completion-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.muted-comment {
  font-style: italic;
}

.stat-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stats-overview {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(180px, 0.8fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stats-summary-card h2 {
  font-size: 1.45rem;
}

.stats-summary-card p:last-child {
  margin-bottom: 0;
}

.quote-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.quote-bar span {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.general-bar span {
  background: #58a6ff;
}

.personal-bar span {
  background: #37d67a;
}

.combined-bar span {
  background: linear-gradient(90deg, #58a6ff, #37d67a);
}

.stats-panel {
  display: grid;
  gap: 12px;
}

.stats-table {
  display: grid;
  gap: 8px;
}

.stats-table-head,
.stats-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(170px, 1fr)) minmax(110px, 0.7fr) minmax(90px, 0.5fr);
  gap: 12px;
  align-items: center;
}

.stats-table-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  padding: 0 12px;
}

.stats-user-row {
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.stats-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stats-user-cell strong,
.stats-user-cell small {
  display: block;
}

.stats-user-cell small,
.stats-quote-top span,
.stats-open-cell span {
  color: var(--muted);
  font-size: 0.8rem;
}

.stats-quote-cell {
  display: grid;
  gap: 8px;
}

.stats-quote-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stats-open-cell,
.stats-total-cell {
  display: grid;
  gap: 2px;
}

.stats-open-cell strong,
.stats-total-cell strong {
  font-size: 1.35rem;
}

.stats-open-cell.has-overdue strong {
  color: var(--danger);
}

.stats-open-cell.has-overdue span {
  color: #ffd0d9;
}

.stat-split article {
  border-radius: 16px;
  background: var(--surface-2);
  padding: 14px;
}

.stat-table {
  display: grid;
  gap: 10px;
}

.stat-user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(90px, 1fr));
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
}

.stat-user-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-user-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-user-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.profile-panel {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-edit-panel {
  display: grid;
  gap: 18px;
  max-width: 680px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  color: #071017;
  font-size: 1.6rem;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.login-brand h1 {
  font-size: 2rem;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form .primary-action {
  width: 100%;
}

.form-error {
  border: 1px solid rgba(255, 107, 122, 0.5);
  border-radius: 14px;
  background: rgba(255, 107, 122, 0.12);
  color: var(--text);
  padding: 12px;
}

.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(16, 21, 29, 0.86);
  backdrop-filter: blur(20px);
  padding: 8px;
  z-index: 10;
}

.bottom-nav-user {
  grid-template-columns: repeat(3, 1fr);
}

.bottom-nav a {
  display: grid;
  min-height: 44px;
  place-items: center;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
}

.settings-layout {
  display: grid;
  gap: 18px;
}

.settings-tabs {
  display: inline-grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(960px, 100%);
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px;
}

.settings-tab {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.settings-tab.active {
  background: rgba(255, 255, 255, 0.92);
  color: #101722;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: grid;
  gap: 18px;
}

.settings-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.settings-hero h2 {
  margin-bottom: 6px;
  font-size: 1.55rem;
}

.settings-hero p {
  margin-bottom: 0;
}

.settings-count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 800;
  padding: 8px 12px;
}

.waha-status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 850;
  padding: 8px 12px;
}

.waha-status-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(169, 180, 196, 0.12);
}

.waha-status-pill.connected {
  border-color: rgba(55, 214, 122, 0.34);
  background: rgba(55, 214, 122, 0.13);
  color: var(--brand);
}

.waha-status-pill.connected span {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.16);
}

.waha-status-pill.disconnected {
  border-color: rgba(255, 92, 122, 0.32);
  background: rgba(255, 92, 122, 0.12);
  color: #ff9aae;
}

.waha-status-pill.disconnected span {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 92, 122, 0.14);
}

.waha-status-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.waha-status-card.connected {
  border-color: rgba(55, 214, 122, 0.24);
  background: rgba(55, 214, 122, 0.08);
}

.waha-status-card.disconnected {
  border-color: rgba(255, 92, 122, 0.22);
  background: rgba(255, 92, 122, 0.075);
}

.waha-feedback {
  margin: 0;
  border: 1px solid rgba(55, 214, 122, 0.24);
  border-radius: 14px;
  background: rgba(55, 214, 122, 0.08);
  color: var(--text);
  padding: 12px 14px;
}

.waha-feedback.error {
  border-color: rgba(255, 92, 122, 0.32);
  background: rgba(255, 92, 122, 0.1);
}

.waha-test-button {
  width: 100%;
}

.waha-log-panel {
  display: grid;
  gap: 12px;
}

.waha-log-list {
  display: grid;
  gap: 10px;
}

.waha-log-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) minmax(150px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.waha-log-row p {
  margin: 2px 0 0;
  color: var(--muted);
}

.waha-log-direction {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  background: rgba(88, 166, 255, 0.14);
  color: #8fc2ff;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 5px 9px;
}

.waha-log-row.incoming .waha-log-direction {
  background: rgba(55, 214, 122, 0.14);
  color: var(--brand);
}

.waha-log-meta {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-align: right;
}

.settings-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.user-settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}

.create-user-panel,
.user-list-panel {
  border-radius: 22px;
}

.panel-heading.compact {
  margin-bottom: 4px;
}

.panel-heading.compact h3,
.form-title-row h3 {
  margin: 0;
  font-size: 1.05rem;
}

.ios-form {
  display: grid;
  gap: 12px;
}

.panel > .ios-form,
.ios-user-editor .ios-form {
  border-top: 0;
}

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

.color-row {
  grid-template-columns: minmax(0, 1fr) 96px;
}

input[type="color"] {
  min-height: 46px;
  padding: 6px;
}

.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.switch-label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
}

.switch-label input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 30px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  transition: background 160ms ease;
}

.switch-label input[type="checkbox"]::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  content: "";
  transition: transform 160ms ease;
}

.switch-label input[type="checkbox"]:checked {
  background: var(--brand);
}

.switch-label input[type="checkbox"]:checked::after {
  transform: translateX(22px);
}

.compact-switch {
  min-width: 126px;
}

.ios-user-list {
  display: grid;
  gap: 10px;
}

.notification-editor-list {
  max-width: 960px;
}

.notification-tags-panel {
  display: grid;
  gap: 12px;
  max-width: 960px;
}

.notification-tags-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-tags-grid div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
}

.notification-tags-grid code {
  color: var(--brand);
  font-weight: 850;
}

.notification-tags-grid span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.ios-user-editor {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
  padding: 0;
}

.ios-user-editor + .ios-user-editor {
  margin-top: 0;
}

.ios-user-editor summary {
  min-height: 62px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 12px 14px;
}

.ios-user-editor[open] summary {
  border-bottom: 1px solid var(--line);
}

.user-summary-text {
  min-width: 0;
  flex: 1;
}

.user-summary-text strong,
.user-summary-text small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron {
  color: var(--muted);
  font-size: 1.6rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.ios-user-editor[open] .chevron {
  transform: rotate(90deg);
}

.ios-user-editor .ios-form {
  margin: 0;
  padding: 14px;
}

.notification-editor .form-title-row {
  align-items: center;
}

.notification-status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(169, 180, 196, 0.1);
}

.notification-status-dot.active {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(55, 214, 122, 0.14);
}

.notification-textarea {
  min-height: 220px;
  font-size: 1.05rem;
  line-height: 1.55;
}

.settings-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notification-schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.notification-time-card {
  display: grid;
  gap: 12px;
}

.notification-time-card h3 {
  margin: 0 0 6px;
}

.notification-time-card p:last-child {
  margin-bottom: 0;
}

.schedule-pill {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  margin: 4px 0 0;
  padding: 4px 10px;
}

.timed-pill {
  border: 1px solid rgba(55, 214, 122, 0.24);
  background: rgba(55, 214, 122, 0.13);
  color: var(--brand);
}

.push-pill {
  border: 1px solid rgba(88, 166, 255, 0.24);
  background: rgba(88, 166, 255, 0.13);
  color: #8fc2ff;
}

.settings-card-list > .settings-form {
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.client-permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-option {
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 8px 10px;
}

.permission-option input {
  width: auto;
}

.api-key-reveal {
  display: grid;
  gap: 12px;
  border-color: rgba(255, 204, 77, 0.28);
  background: rgba(255, 204, 77, 0.08);
}

.api-key-reveal code {
  overflow-x: auto;
  border: 1px solid rgba(255, 204, 77, 0.24);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--warning);
  padding: 12px;
}

.inline-client-action {
  padding: 0 14px 14px;
}

.inline-client-action .ghost-button {
  width: 100%;
  border: 1px solid var(--line);
}

.form-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding: 20px 14px 100px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar .primary-action {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .metric-grid,
  .dashboard-grid,
  .task-list.cards,
  .dashboard-general-list,
  .history-filters,
  .stats-overview,
  .settings-grid,
  .user-grid,
  .user-settings-grid,
  .notification-schedule-grid,
  .reminder-schedule,
  .notification-tags-grid,
  .settings-card-list {
    grid-template-columns: 1fr;
  }

  .stat-user-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-table-head {
    display: none;
  }

  .stats-user-row {
    grid-template-columns: 1fr;
  }

  .dashboard-task-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-user-name {
    grid-column: 1 / -1;
  }

  .task-details {
    grid-template-columns: 1fr;
  }

  .stat-split {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: grid;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .account-menu summary {
    width: auto;
  }

  .account-menu summary span:not(.avatar) {
    display: none;
  }

  .account-dropdown {
    right: 0;
  }

  .toolbar {
    display: grid;
  }

  .toolbar .primary-action {
    width: 100%;
  }

  .filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-chip {
    width: 100%;
  }

  .settings-tabs,
  .form-row,
  .color-row,
  .client-permission-grid {
    grid-template-columns: 1fr;
  }

  .settings-hero,
  .form-title-row,
  .dashboard-section-heading,
  .dashboard-task-head,
  .task-action-form,
  .dashboard-complete-form {
    align-items: flex-start;
    display: grid;
  }

  .task-action-buttons {
    display: grid;
    width: 100%;
  }

  .settings-count {
    width: max-content;
  }

  .waha-status-pill {
    width: max-content;
  }

  .waha-log-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .waha-log-direction {
    width: max-content;
  }

  .waha-log-meta {
    text-align: left;
  }

  .settings-hero-actions {
    justify-content: flex-start;
  }

  .month-filter {
    width: 100%;
  }

  .task-main {
    display: grid;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 8px;
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 0;
    padding: 8px;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 700;
  }
}
