/* Urban Cloud — approved final design tokens */
/*
 * Responsive scale (reference for all @media rules across styles.css / app.css).
 * CSS has no custom-media-query support without a build step, so these are documented
 * pixel values to keep new breakpoints consistent — existing rules are not renumbered.
 *   small mobile     <= 380px
 *   mobile           <= 640px
 *   large mobile      641–767px
 *   tablet portrait   768–860px   (sidebar becomes an overlay drawer below this line)
 *   tablet landscape  861–1099px  (persistent icon-rail sidebar begins)
 *   laptop           1100–1279px
 *   desktop          1280–1599px
 *   large desktop    >= 1600px
 */
:root {
  --bg-0: #07090f;
  --bg-1: #0a0d14;
  --bg-2: #0e1420;
  --bg-3: #121a28;
  --bg-glow-violet: rgba(124, 92, 255, 0.18);
  --bg-glow-cyan: rgba(56, 189, 248, 0.12);

  --glass: rgba(18, 26, 40, 0.55);
  --glass-2: rgba(22, 32, 50, 0.65);
  --glass-3: rgba(28, 40, 62, 0.72);
  --glass-strong: rgba(16, 24, 38, 0.82);

  --text: #f3f6fb;
  --text-secondary: #9aa8bd;
  --text-tertiary: #6b7a90;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(180, 210, 255, 0.16);
  --highlight: rgba(255, 255, 255, 0.06);
  --highlight-strong: rgba(255, 255, 255, 0.12);

  --accent-violet: #8b5cf6;
  --accent-violet-2: #a78bfa;
  --accent-cyan: #38bdf8;
  --accent-blue: #3b82f6;
  --accent-grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #38bdf8 100%);
  --personal-grad: linear-gradient(145deg, rgba(139, 92, 246, 0.35), rgba(76, 29, 149, 0.15) 55%, rgba(15, 20, 35, 0.4));
  --work-grad: linear-gradient(145deg, rgba(56, 189, 248, 0.28), rgba(37, 99, 235, 0.12) 55%, rgba(15, 20, 35, 0.4));

  --folder-blue: #3b82f6;
  --folder-cyan: #22d3ee;
  --folder-green: #34d399;
  --folder-violet: #a78bfa;
  --folder-amber: #fbbf24;
  --folder-orange: #fb923c;
  --folder-rose: #f472b6;
  --folder-red: #f87171;

  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.28);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.5);
  --glow-violet: 0 0 28px rgba(139, 92, 246, 0.35);
  --glow-cyan: 0 0 28px rgba(56, 189, 248, 0.3);

  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-xl: 28px;

  --font: "Outfit", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 88px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tap: 44px;
  --motion: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
}
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}
body {
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg-0);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.page-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
}
.section-sub {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.secondary { color: var(--text-secondary); }
.caption { color: var(--text-tertiary); font-size: 0.72rem; }
.muted { color: var(--text-secondary); }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  min-height: 42px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--glass);
  color: var(--text);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 var(--highlight), var(--shadow-sm);
  transition: transform var(--motion), box-shadow var(--motion), border-color var(--motion), filter var(--motion);
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  border: 0;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--glow-violet), inset 0 1px 0 rgba(255,255,255,0.25);
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  box-shadow: none;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-light {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 var(--highlight);
  transition: transform var(--motion), background var(--motion), box-shadow var(--motion);
}
.icon-btn:hover { background: rgba(255,255,255,0.08); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn.is-accent {
  border: 0;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: var(--glow-cyan), inset 0 1px 0 rgba(255,255,255,0.28);
}

.input, .search-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.045);
  font-size: 16px;
  outline: none;
  color: var(--text);
  backdrop-filter: blur(12px);
}
.input::placeholder, .search-input::placeholder { color: var(--text-tertiary); }
.input:focus, .search-input:focus {
  border-color: rgba(139, 92, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.search-wrap { position: relative; width: min(280px, 100%); }
.search-wrap > svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--text-tertiary); pointer-events: none;
  stroke: currentColor; fill: none; stroke-width: 1.8;
}
.search-wrap .search-input {
  padding-left: 2.35rem;
  border-radius: 999px;
  background: rgba(10, 14, 22, 0.55);
}

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  border: 2px solid rgba(10, 13, 20, 0.85);
  flex-shrink: 0;
}
.avatar-lg { width: 40px; height: 40px; font-size: 0.85rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }

.glass-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)), var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), inset 0 1px 0 var(--highlight);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--text-secondary);
}
.empty-state h3 { margin: 0 0 0.4rem; color: var(--text); }

.progress {
  height: 6px; border-radius: 999px;
  background: rgba(255,255,255,0.08); overflow: hidden;
}
.progress > span {
  display: block; height: 100%; border-radius: inherit;
  background: var(--accent-grad);
}

.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; }
.linkish {
  border: 0; background: transparent; color: #c4b5fd;
  font-weight: 600; font-size: 0.86rem; padding: 0;
}
.field { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; font-size: 0.75rem; color: var(--text-secondary); }
.field input, .field select, .field textarea, .field-input {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 0.65rem 0.9rem; background: rgba(255,255,255,0.04);
  font-size: 16px; color: var(--text);
}
.panel { composes: none; }
.panel {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.shell {
  width: min(480px, calc(100% - 2rem));
  margin: 0 auto;
  padding: calc(1.5rem + var(--safe-top)) 0 calc(2rem + var(--safe-bottom));
}
.brand { font-weight: 750; letter-spacing: -0.04em; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.hero { display: grid; gap: 1rem; }
.hero-copy h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -0.04em; }
.hero-copy p { color: var(--text-secondary); }
.status { margin-top: 0.75rem; font-size: 0.86rem; }
.status.is-error { color: #f87171; }

.id-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0 0 0.9rem;
  padding: 0.25rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}
.id-tab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  min-height: 40px;
  border-radius: 11px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.id-tab.is-active {
  background: rgba(139, 92, 246, 0.22);
  color: var(--text);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
