:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --panel: #ffffff;
  --ink: #1c1b1a;
  --muted: #6f6b66;
  --accent: #d36f4c;
  --accent-dark: #b35738;
  --line: #e3dfd6;
  --shadow: 0 18px 40px rgba(32, 28, 24, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff8ef 0%, #f4f1eb 45%, #ede7dd 100%);
  min-height: 100vh;
}

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

.app {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #fef7ec 0%, #f7efe2 100%);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100vh;
  overflow: hidden;
  padding: 24px 20px 80px;
  gap: 18px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: var(--accent);
  border: 1px solid var(--accent-dark);
  border-radius: 12px;
  padding: 8px 12px;
  color: #fff;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.menu-toggle-bar {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.menu-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand-logout {
  display: none;
}

.logo {
  width: 120px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.08));
}

.session-timer {
  font-size: 14px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  padding: 8px 12px;
  border-radius: 8px;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.menu-meta {
  margin-top: 12px;
}

.menu-meta .session-timer {
  width: 100%;
}

.menu-item {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.2s ease, color 0.2s ease;
}

.menu-item:hover {
  background: rgba(211, 111, 76, 0.12);
  color: var(--ink);
}

.menu-item.active {
  background: rgba(211, 111, 76, 0.2);
  color: var(--ink);
}

.menu-section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 14px 8px 2px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  margin-top: auto;
}

.content {
  flex: 1;
  padding: 32px 40px 120px;
}

@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 12px 14px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .logo {
    width: 80px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .brand-logout {
    display: inline-block;
    margin-left: auto;
  }

  .brand-logout .button {
    padding: 8px 12px;
  }

  .session-timer {
    flex: 1 1 160px;
    font-size: 12px;
    padding: 6px 10px;
  }

  .menu {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    padding-top: 8px;
  }

  .menu-item {
    text-align: center;
  }

  .sidebar-footer {
    display: none;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sidebar-footer .button {
    width: 100%;
  }

  .user-info {
    width: 100%;
  }

  .content {
    padding: 20px 16px 80px;
  }

  .card {
    padding: 18px;
    border-radius: 14px;
  }

  .page-title {
    font-size: 24px;
  }

  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.open .menu {
    display: grid;
  }

  .sidebar.open .sidebar-footer {
    display: flex;
  }
}

.page-title {
  font-size: 28px;
  margin: 0 0 18px;
}

.subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.subnav .button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.prompt-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 16px 0 18px;
}

.prompt-tabs .button {
  width: 100%;
}

.prompt-tabs .button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.prompt-filter label {
  margin-bottom: 4px;
}

.prompt-grid {
  display: grid;
  gap: 18px;
}

.prompt-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf3;
}

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

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 15px;
  background: #fff;
}

button, .button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.icon-button {
  padding: 8px 10px;
  line-height: 1;
  min-width: 38px;
  text-align: center;
}

button:hover, .button:hover {
  background: var(--accent-dark);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff5e8;
  border: 1px solid #f2d9c5;
  color: #7a4d34;
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table.compact th,
.table.compact td {
  padding: 6px 8px;
}

.icon-actions {
  display: inline-block;
  margin-right: 6px;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(211, 111, 76, 0.15);
  color: #7a3f28;
}

.login-wrap {
  max-width: 420px;
  margin: 10vh auto;
  margin-bottom: calc(10vh + 56px);
  padding: 24px;
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.login-title {
  font-size: 24px;
  margin-top: 0;
}

.env-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1c1b1a;
  color: #fff;
  padding: 12px 16px;
  font-size: 16px;
  text-align: center;
  letter-spacing: 0.02em;
}
