@import "tailwindcss";

:root {
  color-scheme: light;
  --bg: #f7f8ff;
  --ink: #17211d;
  --muted: #5e6b85;
  --line: #dfe4f3;
  --panel: #ffffff;
  --accent: #1828e8;
  --accent-strong: #1119a8;
  --brand-purple: #5d20ff;
  --brand-solar: #ffbf1f;
  --brand-pink: #ff2d78;
  --apple-blueberry: #007aff;
  --apple-strawberry: #ff2d55;
  --amber: #ffb020;
  --danger: var(--apple-strawberry);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 191, 31, 0.22), transparent 28rem),
    radial-gradient(circle at 95% 8%, rgba(93, 32, 255, 0.12), transparent 26rem),
    linear-gradient(135deg, #f7f8ff 0%, #eef3ff 45%, #fffdf6 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.main {
  padding: 28px;
  padding-bottom: 96px;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(223, 228, 243, 0.95);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(24, 40, 232, 0.08);
}

.field {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px 13px;
  min-height: 46px;
  outline: none;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(24, 40, 232, 0.14);
}

.btn {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--brand-purple));
  color: white;
}

.btn-secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.login-panel {
  border-top: 5px solid var(--brand-solar);
}

.login-logo {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-logo {
  display: block;
  width: min(100%, 220px);
  height: auto;
  max-height: 72px;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.passkey-button {
  border-color: rgba(24, 40, 232, 0.28);
  color: var(--accent-strong);
}

.brand-link {
  color: var(--accent-strong);
}

.brand-link:hover {
  color: var(--brand-purple);
}

.brand-text {
  color: var(--accent);
}

.success-text {
  color: var(--apple-blueberry);
}

.danger-text {
  color: var(--apple-strawberry);
}

.warning-text {
  color: #b46a00;
}

.nav-active {
  background: linear-gradient(135deg, var(--accent), var(--brand-purple));
  color: #fff;
}

.notice-success {
  border-color: rgba(0, 122, 255, 0.24);
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent-strong);
}

.notice-error {
  border-color: rgba(255, 45, 85, 0.25);
  background: rgba(255, 45, 85, 0.08);
  color: var(--apple-strawberry);
}

.notice-warning {
  border-color: rgba(255, 176, 32, 0.32);
  background: rgba(255, 176, 32, 0.12);
  color: #8a5300;
}

.action-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.action-menu-trigger {
  width: 46px;
  padding: 0;
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 13rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 18px 48px rgba(23, 33, 29, 0.16);
}

.report-card {
  overflow: hidden;
}

.report-card-value {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.money-positive {
  color: var(--apple-blueberry);
}

.money-negative {
  color: var(--apple-strawberry);
}

.bottom-nav {
  display: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px 1fr;
  }

  .sidebar {
    padding: 18px;
  }

  .main {
    padding: 24px;
    padding-bottom: 96px;
  }

  .btn {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
    padding-bottom: 150px;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(23, 33, 29, 0.16);
    backdrop-filter: blur(18px);
    overflow: hidden;
  }
}
