:root {
  --bg: #070b1d;
  --card: #121a36;
  --card-soft: #182043;
  --text: #eaf1ff;
  --muted: #98a8ce;
  --primary: #7a4dff;
  --primary-2: #2fd1ff;
  --primary-soft: #1c2550;
  --line: #2c3764;
  --line-strong: #3b4b86;
  --danger: #e9517c;
  --success: #22bc84;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(122, 77, 255, 0.24) 0%, transparent 38%),
    radial-gradient(circle at 92% 0%, rgba(47, 209, 255, 0.2) 0%, transparent 34%),
    linear-gradient(180deg, #080d23, #070b1d 56%, #070b1d);
  overflow-x: hidden;
}

.container {
  width: min(1260px, calc(100% - 24px));
  max-width: 1260px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid #222e57;
  background: linear-gradient(160deg, #0f1634, #0a112b 40%, #0d1330);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
  margin-top: 16px;
  margin-bottom: 0;
}

.hero {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: stretch;
}

.hero-title {
  flex: 1;
  background: linear-gradient(140deg, #1a2250, #1d2e62 55%, #2c3e80);
  border-radius: 20px;
  padding: 20px 22px;
  color: #fff;
  border: 1px solid #2f3f79;
  box-shadow: 0 14px 30px rgba(18, 27, 68, 0.55);
}

.hero-title h1 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: 0.2px;
}

.hero-title p {
  margin: 0;
  color: #b8c8f0;
  max-width: 560px;
}

.date-chip {
  min-width: 260px;
  background: linear-gradient(180deg, #131d43, #11183a);
  border: 1px solid #30427e;
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 16px 34px rgba(8, 13, 34, 0.5);
}

.date-chip span {
  display: block;
  color: #9ec6ff;
  font-weight: 700;
  font-size: 13px;
}

.date-chip strong {
  display: block;
  margin-top: 2px;
  color: #f1f5ff;
  font-size: 17px;
}

.date-chip small {
  display: block;
  margin-top: 3px;
  color: #9fb0d7;
}

.date-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.date-actions input {
  min-width: 150px;
}

.date-actions button {
  padding-inline: 12px;
}

.tabs {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px;
  background: #10193d;
  border: 1px solid #2b3a6d;
  border-radius: 14px;
}

.tab-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #a9bcf0;
  font-weight: 700;
  padding: 9px 15px;
  cursor: pointer;
  box-shadow: none;
}

.tab-btn.active {
  background: linear-gradient(120deg, #864cff, #2fd1ff);
  border-color: transparent;
  color: #fff;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.notice {
  display: none;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 13px;
  font-weight: 600;
}

.notice.show {
  display: block;
}

.notice.error {
  background: rgba(233, 81, 124, 0.15);
  border-color: rgba(233, 81, 124, 0.5);
  color: #ffbfd0;
}

.notice.success {
  background: rgba(34, 188, 132, 0.15);
  border-color: rgba(34, 188, 132, 0.5);
  color: #9ff2cf;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-soft));
  border: 1px solid #263363;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 16px 30px rgba(5, 9, 28, 0.4);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card {
  border: 1px solid #2a396f;
  border-radius: 14px;
  background: linear-gradient(180deg, #141d44, #10183a);
  padding: 12px;
}

.metric-label {
  margin: 0 0 8px;
  color: #9ab0e2;
  font-size: 12px;
}

.metric-card strong {
  font-size: 24px;
  line-height: 1;
  color: #f2f6ff;
}

.metric-trend strong {
  font-size: 18px;
}

.metric-reports {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.trend-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 74px;
}

.trend-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.trend-col small {
  color: #8fa6dc;
  font-size: 10px;
}

.trend-bar-bg {
  width: 100%;
  height: 52px;
  border-radius: 8px;
  border: 1px solid #32477f;
  background: #111a3e;
  display: flex;
  align-items: flex-end;
  padding: 2px;
}

.trend-bar-fill {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, #2fd1ff, #8c4dff);
  min-height: 4px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.section-head h2 {
  margin: 0;
  color: #e7efff;
  font-size: 20px;
}

.section-head .muted {
  margin-top: 5px;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
  align-items: center;
}

.row-tight {
  margin-top: 10px;
}

input,
textarea,
select,
button {
  border-radius: 12px;
  border: 1px solid #2f3c72;
  background: #0e1739;
  color: #ecf2ff;
  padding: 10px 12px;
  transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

input,
textarea,
select {
  flex: 1;
  min-width: 170px;
}

input::placeholder,
textarea::placeholder {
  color: #90a2cf;
}

input[type="date"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(64%) sepia(92%) saturate(2210%) hue-rotate(192deg) brightness(102%) contrast(103%);
  opacity: 1;
  cursor: pointer;
}

input[type="date"]::-webkit-clear-button,
input[type="date"]::-webkit-inner-spin-button {
  filter: invert(64%) sepia(92%) saturate(2210%) hue-rotate(192deg) brightness(102%) contrast(103%);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #6f97ff;
  box-shadow: 0 0 0 4px rgba(90, 123, 220, 0.25);
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.4;
}

button {
  cursor: pointer;
  background: linear-gradient(120deg, #8c4dff, #2fd1ff);
  border-color: transparent;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 10px 24px rgba(86, 82, 255, 0.4);
}

button.secondary {
  background: #121c45;
  color: #c6d7ff;
  border-color: #324681;
  box-shadow: none;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button.danger {
  background: rgba(233, 81, 124, 0.12);
  border-color: rgba(233, 81, 124, 0.45);
  color: #ffc0d1;
  font-weight: 600;
  box-shadow: none;
}

.muted {
  color: var(--muted);
  margin: 4px 0;
}

.status {
  color: #d1e2ff;
  background: #152252;
  border: 1px solid #3b4f8f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.today-label {
  margin: 8px 0 2px;
  font-weight: 700;
  color: #bed3ff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid #2a386d;
  border-radius: 14px;
  background: #0e1638;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px;
  text-align: left;
}

th {
  color: #9fb3e8;
  font-size: 13px;
  background: #151f49;
  position: sticky;
  top: 0;
  z-index: 1;
}

td input {
  width: 100%;
  min-width: 90px;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid #32447e;
}

.todo-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.todo-list li {
  border: 1px solid #2b3a70;
  border-radius: 14px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  background: #111a3f;
}

.check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.todo-check {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-custom {
  width: 21px;
  height: 21px;
  border-radius: 999px;
  border: 2px solid #7f98d8;
  background: #121b40;
  transition: all 0.2s ease;
}

.todo-check:checked + .check-custom {
  background: linear-gradient(120deg, #8c4dff, #2fd1ff);
  border-color: transparent;
  box-shadow: inset 0 0 0 4px #0f1739;
}

.todo-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.attach-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.attach-link {
  font-size: 11px;
  color: #9fd2ff;
  text-decoration: none;
  border: 1px solid #36538a;
  border-radius: 999px;
  padding: 3px 8px;
  background: #13224f;
}

.attach-link:hover {
  text-decoration: underline;
}

.attach-remove {
  border: 1px solid rgba(233, 81, 124, 0.55);
  background: rgba(233, 81, 124, 0.12);
  color: #ffc0d1;
  border-radius: 999px;
  font-size: 11px;
  padding: 3px 6px;
  box-shadow: none;
}

.todo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.todo-actions .secondary,
.todo-actions .danger {
  padding: 7px 10px;
}

.priority-pill {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.priority-high {
  background: rgba(233, 81, 124, 0.18);
  color: #ffbfd0;
  border: 1px solid rgba(233, 81, 124, 0.5);
}

.priority-medium {
  background: rgba(255, 195, 80, 0.14);
  color: #ffd48f;
  border: 1px solid rgba(255, 195, 80, 0.45);
}

.priority-low {
  background: rgba(34, 188, 132, 0.16);
  color: #aef1d4;
  border: 1px solid rgba(34, 188, 132, 0.45);
}

.todo-list li.done .todo-text {
  text-decoration: line-through;
  color: var(--muted);
}

.todo-text {
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}

.notepad-card textarea {
  border: 1px solid #2d3f78;
  border-radius: 14px;
  background:
    repeating-linear-gradient(
      to bottom,
      #10183d 0,
      #10183d 31px,
      #26356f 32px
    );
  line-height: 32px;
  padding-top: 12px;
}

#vaultHeadRow th .col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

#vaultHeadRow th .col-remove {
  border: 1px solid #3a4d88;
  background: #16214c;
  color: #aec7ff;
  border-radius: 8px;
  padding: 3px 7px;
  cursor: pointer;
  box-shadow: none;
}

.calendar-card {
  margin-top: 16px;
}

#vaultSearchInput {
  min-width: 230px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.toggle-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: #c8d8ff;
  font-size: 13px;
  border: 1px solid #324681;
  background: #121c45;
  border-radius: 12px;
  padding: 10px 12px;
}

.toggle-label input[type="checkbox"] {
  accent-color: #2fd1ff;
}

/* Login */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 20%, #cdb6ff 0%, #b796ff 28%, transparent 52%),
    radial-gradient(circle at 84% 84%, #7f52f4 0%, #5b2fce 30%, transparent 50%),
    linear-gradient(180deg, #efe6ff, #d9cbff);
}

.login-shell {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  background: #0c0f18;
  border: 1px solid #242a3d;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 26px 62px rgba(20, 13, 44, 0.45);
}

.login-brand {
  padding: 22px;
  background: #0c0f18;
  display: grid;
  place-items: center;
}

.login-visual-card {
  width: 100%;
  min-height: 400px;
  border-radius: 24px;
  border: 1px solid #2e3550;
  background:
    radial-gradient(circle at 80% 18%, #f7ab6f 0 10%, transparent 10.2%),
    radial-gradient(circle at 12% 28%, #ecdbff 0 2%, transparent 2.2%),
    radial-gradient(circle at 25% 34%, #dbc3ff 0 1.8%, transparent 2%),
    linear-gradient(160deg, #f7a66d 0%, #9345d0 42%, #4925ab 100%);
  position: relative;
  overflow: hidden;
}

.login-visual-card::before,
.login-visual-card::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 8%;
  border-radius: 26px;
  border: 2px solid rgba(210, 222, 255, 0.7);
  background: rgba(198, 215, 255, 0.35);
}

.login-visual-card::before {
  bottom: 16%;
  height: 32%;
}

.login-visual-card::after {
  bottom: -4%;
  height: 30%;
}

.login-form-wrap {
  padding: 44px 42px;
  background: #0c0f18;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-wrap h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 42px);
  color: #f8fbff;
}

.login-form-wrap .muted {
  color: #9ca8c8;
  margin-bottom: 16px;
}

.login-form-wrap .row {
  gap: 12px;
}

.login-form-wrap input {
  background: #101726;
  border: 1px solid #2e3750;
  color: #f8fbff;
}

.login-form-wrap input::placeholder {
  color: #8b97b7;
}

.login-form-wrap button {
  width: 100%;
  background: linear-gradient(180deg, #7f4cff, #5f31d8);
  border-color: #7f4cff;
  box-shadow: 0 10px 24px rgba(109, 60, 249, 0.4);
}

/* Responsive */
@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 14px;
    width: calc(100% - 12px);
    border-radius: 16px;
  }

  .hero {
    flex-direction: column;
  }

  .hero-title,
  .date-chip {
    width: 100%;
  }

  .date-actions {
    flex-direction: column;
  }

  .tabs {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
  }

  .row > input,
  .row > select,
  .row > button {
    width: 100%;
  }

  .row > .toggle-label {
    width: 100%;
  }

  .todo-list li {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .todo-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .date-actions button {
    width: 100%;
  }
}
