:root {
  --bg: #eef4ef;
  --bg-deep: radial-gradient(circle at 12% 8%, #dbe8db 0, transparent 35%), radial-gradient(circle at 85% 10%, #bfd5bf 0, transparent 30%), linear-gradient(145deg, #eff6ef 0%, #e5efe6 80%);
  --card: rgba(255, 255, 255, 0.72);
  --ink: #132e1d;
  --green: #1f6d43;
  --green-soft: #3e8f63;
  --accent: #c6a162;
  --danger: #9b2c2c;
  --radius: 20px;
  --shadow: 0 20px 45px rgba(11, 39, 24, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: var(--bg-deep);
  min-height: 100vh;
}

h1, h2 {
  font-family: "Fraunces", serif;
  margin: 0;
}

.glass {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

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

.login-card {
  width: min(430px, 100%);
  padding: 28px;
}
.brand-hero {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: 0 14px 30px rgba(18, 56, 37, 0.18);
}
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 10px 26px rgba(24, 67, 43, 0.22);
}
.brand-logo-login {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin-bottom: 10px;
}

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

input, select, textarea, button {
  font: inherit;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(26, 78, 52, 0.2);
}

button {
  background: linear-gradient(135deg, var(--green), var(--green-soft));
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.error { color: var(--danger); font-weight: 700; }
.remember { display: flex; align-items: center; gap: 8px; }

.app-shell { padding: 12px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost { background: transparent; border: 1px solid rgba(26, 78, 52, 0.3); color: var(--ink); }
.desktop-nav {
  display: none;
  align-items: center;
  gap: 8px;
}
.desktop-nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
}
.desktop-nav a:hover { background: rgba(31, 109, 67, 0.11); }
.menu-toggle {
  background: linear-gradient(135deg, #2a7f53, #1d5c3b);
}
.mobile-menu {
  position: fixed;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 30;
  padding: 14px;
  display: none;
}
.mobile-menu.open { display: grid; gap: 8px; }
.mobile-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 10px;
  border-radius: 10px;
  background: rgba(31, 109, 67, 0.08);
  border: 0;
}
.menu-link.as-button { width: 100%; text-align: left; cursor: pointer; }
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 33, 22, 0.45);
  z-index: 20;
}

.layout-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "chat"
    "calendar"
    "tasks";
}

.chat-area, .calendar-area, .tasks-area { padding: 16px; }
.chat-area { grid-area: chat; min-height: 48vh; display: flex; flex-direction: column; }
.calendar-area { grid-area: calendar; min-height: 24vh; }
.tasks-area { grid-area: tasks; min-height: 24vh; }

.chat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mic { background: linear-gradient(135deg, #2a7f53, #1d5c3b); }
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(244, 248, 244, 0.92);
}
.msg {
  max-width: 90%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 12px;
}
.msg.user { margin-left: auto; background: #1f6d43; color: white; }
.msg.assistant { background: #dbeadf; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.hint { opacity: 0.8; margin-top: 6px; }

.task-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: 290px; overflow: auto; }
.task {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: #f5fbf6;
}
.task.high { border-left: 5px solid var(--danger); }
.task.medium { border-left: 5px solid var(--accent); }
.task.low { border-left: 5px solid #2f855a; }

#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 12px;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 6px;
}
.calendar-toolbar strong {
  text-align: center;
  min-width: 140px;
}
.calendar-today {
  margin-bottom: 8px;
}
.day {
  background: #f8fcf8;
  border-radius: 10px;
  min-height: 56px;
  padding: 6px;
  border: 1px solid rgba(26, 78, 52, 0.12);
}
.day.marked { border-color: var(--green); box-shadow: inset 0 0 0 2px rgba(31, 109, 67, 0.28); }

.new-task summary { cursor: pointer; margin: 10px 0; font-weight: 700; }
.new-task form p { display: grid; gap: 6px; }
.settings-panel {
  margin-top: 12px;
  padding: 16px;
}
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.settings-form {
  display: grid;
  gap: 8px;
  max-width: 480px;
}
.team-list {
  margin: 10px 0 0;
  padding-left: 18px;
}
.team-list li {
  margin-bottom: 6px;
}

@media (min-width: 950px) {
  .app-shell { padding: 18px 22px; }
  .menu-toggle, .mobile-menu, .menu-backdrop { display: none !important; }
  .desktop-nav { display: flex; }
  .layout-grid {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      "chat calendar"
      "chat tasks";
  }
  .chat-area { min-height: 72vh; }
  .calendar-area, .tasks-area { min-height: 35vh; }
}

.mic.active {
  box-shadow: 0 0 0 4px rgba(31, 109, 67, 0.25);
}
