* { box-sizing: border-box; }
:root {
  --bg: #0a0e27;
  --bg-2: #0e1330;
  --card: #131933;
  --card-2: #171e3f;
  --border: #262f57;
  --text: #e9ebf5;
  --muted: #8b91b3;
  --accent-1: #2b4ad1;
  --accent-2: #7b3fe4;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --danger: #f38ba8;
  --danger-bg: #2c1830;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(43,74,209,0.38), transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(123,63,228,0.30), transparent 40%),
    radial-gradient(circle at top, var(--bg-2), var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}
h1, h2, .brand-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
}
.wrap {
  width: 70%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 16px 60px;
}
@media (max-width: 900px) {
  .wrap { width: 94%; }
}
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.header-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 8% 30%, rgba(43,74,209,0.32), transparent 55%),
    radial-gradient(circle at 96% 100%, rgba(123,63,228,0.28), transparent 55%);
  pointer-events: none;
}
.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sub { position: relative; z-index: 1; font-size: 0.8rem; color: var(--muted); border-left: 1px solid var(--border); padding-left: 14px; }
.logout { position: relative; z-index: 1; }
h1 { font-size: 1.3rem; margin: 0 0 20px; font-weight: 600; }
h2 { font-size: 1rem; margin: 0 0 16px; font-weight: 600; color: var(--text); }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -15px rgba(0,0,0,0.5);
}
.login-wrap {
  max-width: 360px;
  margin: 12vh auto 0;
}
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo img { height: 40px; width: auto; }
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
}
input[type="time"], input[type="date"] {
  font-size: 1.15rem;
  padding: 14px;
}
textarea { min-height: 70px; resize: vertical; font-size: 0.95rem; }
input::placeholder { color: #565f85; }
.field { margin-bottom: 14px; }
.row-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.05s;
}
button:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-grad); color: #fff; }
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-danger { background: var(--danger-bg); color: var(--danger); padding: 6px 12px; font-size: 0.8rem; }
.btn-danger:hover { opacity: 0.85; }
.btn-secondary { background: var(--card-2); color: var(--text); padding: 6px 12px; font-size: 0.8rem; border: 1px solid var(--border); }
.btn-secondary:hover { opacity: 0.85; }
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; min-height: 1em; }

.today-status { font-size: 0.95rem; color: var(--muted); margin-bottom: 16px; }
.today-status strong { color: var(--text); }
.today-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.today-actions button { flex: 1; min-width: 160px; padding: 16px; font-size: 1rem; }
.task-add { display: flex; gap: 10px; }
.task-add input { flex: 1; }
.task-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 6px; }
.task-list li { background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; }
td.task { white-space: normal; min-width: 160px; }
td.task ul { margin: 0; padding-left: 16px; }
td.actions-col { vertical-align: middle; }
.table-scroll { overflow-x: auto; }
.summary {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.summary strong { color: var(--text); font-size: 1.05rem; }
.filter-bar { display: flex; gap: 10px; align-items: end; margin-bottom: 18px; }
.filter-bar .field { margin-bottom: 0; flex: 1; max-width: 200px; }
.actions-cell { display: flex; gap: 6px; }
a.logout { color: var(--muted); font-size: 0.85rem; text-decoration: none; cursor: pointer; }
a.logout:hover { color: var(--text); }
details.manual-form summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }
details.manual-form[open] summary { color: var(--text); margin-bottom: 16px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 20, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 25px 60px -20px rgba(0,0,0,0.7);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.15s ease;
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }
.modal-title { margin: 0 0 10px; font-size: 1.05rem; font-weight: 600; }
.modal-message { color: var(--muted); font-size: 0.92rem; margin: 0 0 22px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
