:root {
  --bg: #111621;
  --bg-elevated: #171e2c;
  --bg-card: #1d2536;
  --bg-tile: rgba(255, 255, 255, 0.035);
  --bg-input: #141a26;
  --bg-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f6fc;
  --text-muted: #8a95ab;
  --accent: #2589ff;
  --accent-hover: #3c97ff;
  --life: #30d158;
  --college: #6366f1;
  --work: #ff9f0a;
  --danger: #ff453a;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  --radius: 16px;
  --sidebar-w: 84px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", sans-serif;
  background: radial-gradient(circle at 15% 10%, #1c263b 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

.ui-icon {
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
}

.icon-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: rgba(23, 30, 44, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 10px;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

.rail-brand {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.rail-dock {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.rail-dock-bottom {
  margin-top: auto;
}

.rail-item-wrap {
  position: relative;
}

.rail-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.11);
  color: var(--text);
}

.rail-btn.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(37, 137, 255, 0.45);
}

.rail-tooltip,
.rail-flyout {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  background: rgba(24, 31, 46, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 50;
}

.rail-tooltip {
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}

.rail-flyout {
  top: 0;
  transform: translateX(-4px);
  min-width: 170px;
  padding: 8px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-flyout-bottom {
  top: auto;
  bottom: 0;
  min-width: 260px;
  max-width: 280px;
}

/* Invisible hover bridge so cursor can move from icon to flyout */
.rail-item-wrap.has-flyout::after {
  content: "";
  position: absolute;
  top: 0;
  left: 100%;
  width: 14px;
  height: 100%;
}

.rail-item-wrap:hover > .rail-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.rail-item-wrap:hover > .rail-flyout {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.flyout-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 10px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.rail-flyout a {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: 0.15s ease;
}

.rail-flyout a:hover,
.rail-flyout a.active {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.brand {
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(37, 137, 255, 0.6);
}

.quick-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.15s ease;
}

.icon-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.unread-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px var(--bg-card);
}

.nav-section { margin-bottom: 18px; }

.nav-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: 0.15s ease;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 137, 255, 0.35);
}

.nav-sub {
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.nav-sub a {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 5px 10px;
  border-radius: 8px;
  transition: 0.15s ease;
}

.nav-sub a:hover, .nav-sub a.active {
  color: var(--text);
  background: var(--bg-hover);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 22px 28px;
  max-width: 1400px;
  width: 100%;
}

.mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

/* Cards & Grids */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.page-title {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.page-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

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

.stat-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.stat-value { font-size: 1.85rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.card-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-life { background: rgba(48, 209, 88, 0.16); color: var(--life); }
.badge-college { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.badge-work { background: rgba(255, 159, 10, 0.16); color: var(--work); }
.badge-high { background: rgba(255, 69, 58, 0.16); color: var(--danger); }
.badge-medium { background: rgba(255, 159, 10, 0.16); color: var(--work); }
.badge-low { background: rgba(138, 149, 171, 0.16); color: var(--text-muted); }

/* Buttons & Forms */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 137, 255, 0.3);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--bg-tile); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: rgba(255, 69, 58, 0.14); color: var(--danger); border-color: rgba(255, 69, 58, 0.25); }
.btn-sm { padding: 5px 11px; font-size: 0.78rem; border-radius: 8px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
}

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

.form-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Lists */
.list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }
.item-title { font-weight: 600; font-size: 0.92rem; }
.item-meta { font-size: 0.79rem; color: var(--text-muted); margin-top: 2px; }

.alert {
  padding: 12px 15px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 0.88rem;
  font-weight: 500;
}
.alert-success { background: rgba(48, 209, 88, 0.14); border: 1px solid rgba(48, 209, 88, 0.3); color: var(--life); }
.alert-error { background: rgba(255, 69, 58, 0.14); border: 1px solid rgba(255, 69, 58, 0.3); color: var(--danger); }

/* Segmented Tabs */
.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 6px 13px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Reference Calendar Layout (2-Column: Tile Grid + Scheduled Panel) */
.cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.cal-head {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 6px;
}

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

.cal-cell {
  min-height: 98px;
  padding: 9px;
  border-radius: 12px;
  background: var(--bg-tile);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: 0.15s ease;
}

.cal-cell:hover {
  background: var(--bg-hover);
}

.cal-cell.other-month {
  opacity: 0.38;
}

.cal-cell.selected {
  border: 1.5px dashed var(--accent);
  background: rgba(37, 137, 255, 0.11);
}

.cal-cell.today {
  background: linear-gradient(155deg, #2b8eff 0%, #1562d4 100%);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 22px rgba(37, 137, 255, 0.35);
}

.cal-cell.today .cal-day-num,
.cal-cell.today .cal-pill {
  color: #ffffff;
}

.cal-day-num {
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.cal-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-dot.life { background: var(--life); }
.cal-dot.college { background: var(--college); }
.cal-dot.work { background: var(--work); }

/* Right "Scheduled" Panel Cards */
.sched-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 8px;
}

.sched-slot::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.sched-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  margin-bottom: 10px;
}

.sched-bar {
  height: 5px;
  border-radius: 999px;
  margin-bottom: 11px;
}

.sched-bar.life { background: var(--life); }
.sched-bar.college { background: var(--college); }
.sched-bar.work { background: var(--work); }

.sched-divider {
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  margin: 9px 0;
}

.sched-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.81rem;
  color: var(--text-muted);
}

/* Contact Cards (Work -> Clients) */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.contact-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.025) 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px 18px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-actions-top {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 5px;
}

.contact-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1b4d89 0%, #2589ff 100%);
  color: #ffffff;
  font-size: 1.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(37, 137, 255, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.14);
}

.contact-name {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.contact-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
  margin-bottom: 14px;
}

.contact-icons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.contact-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(37, 137, 255, 0.16);
  border: 1px solid rgba(37, 137, 255, 0.35);
  color: #70b5ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
  cursor: pointer;
}

.contact-circle-btn:hover {
  background: var(--accent);
  color: #ffffff;
}

.contact-pill-btn {
  margin-top: auto;
  width: 100%;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(90deg, #143f73 0%, #2589ff 100%);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(37, 137, 255, 0.28);
  transition: 0.15s ease;
}

.contact-pill-btn:hover {
  filter: brightness(1.1);
}

/* Bento Dashboard & Interactive Micro-interactions */
.bento-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.stat-card {
  display: block;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 137, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.stat-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Mini Calendar on Dashboard */
.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.mini-cal-head {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 6px;
}

.mini-cal-day {
  position: relative;
  padding: 6px 2px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: background 0.15s ease;
}

.mini-cal-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: 210px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(24, 31, 46, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}

.mini-cal-day:hover .mini-cal-popover {
  opacity: 1;
  transform: translateY(0);
}

.mini-pop-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.mini-pop-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-cal-day:hover {
  background: var(--bg-hover);
}

.mini-cal-day.empty {
  pointer-events: none;
}

.mini-cal-day.today {
  background: linear-gradient(155deg, #2b8eff 0%, #1562d4 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 137, 255, 0.35);
}

.mini-dots {
  display: flex;
  gap: 2px;
  height: 5px;
}

.mini-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1b4d89 0%, #2589ff 100%);
  transition: width 0.3s ease;
}

/* Hover-reveal & Interactive Check */
.check-btn {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: 0.15s ease;
}

.check-btn:hover {
  border-color: var(--accent);
  background: rgba(37, 137, 255, 0.16);
}

.check-btn.checked {
  background: var(--life);
  border-color: var(--life);
}

.cal-cell {
  position: relative;
}

.cal-quick-add {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.cal-cell:hover .cal-quick-add {
  opacity: 1;
}

/* Floating Toast */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(24, 31, 46, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  animation: toastIn 0.2s ease;
}

.toast.success { border-left: 3px solid var(--life); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hover-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.list-item:hover .hover-actions,
.card:hover .hover-actions {
  opacity: 1;
}

@media (max-width: 1080px) {
  .bento-grid { grid-template-columns: 1fr; }
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

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

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.hover-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.list-item:hover .hover-actions,
.card:hover .hover-actions {
  opacity: 1;
}

@media (max-width: 1080px) {
  .cal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: 220px; align-items: stretch; overflow-y: auto; }
  .sidebar.open { transform: translateX(0); }
  .rail-dock { border-radius: 16px; align-items: stretch; padding: 8px; gap: 6px; }
  .rail-item-wrap { display: flex; flex-direction: column; gap: 4px; }
  .rail-item-wrap.has-flyout::after, .rail-tooltip { display: none; }
  .rail-flyout, .rail-flyout-bottom {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    background: transparent;
    border: none;
    padding: 0 0 4px 12px;
    min-width: 0;
  }
  .rail-flyout-bottom { display: none; }
  .main-content { margin-left: 0; padding: 18px 16px; }
  .mobile-bar { display: flex; }
  .grid-2 { grid-template-columns: 1fr; }
  .cal-cell { min-height: 70px; padding: 6px; }
}
