/* ── ARKAN Mobile — Sprint MOBILE-002 (Главная) ──────────────────────────
   Fully namespaced under .am-*. Every rule here is either scoped to
   body.am-mode or to an .am-* class — nothing here can leak into or be
   affected by desktop CSS, and nothing in main.css/variables.css targets
   .am-* selectors. Colors/spacing reuse the same design tokens as the rest
   of the product (--font-sans, --font-mono, --space-*) for brand
   continuity, but layout/markup is entirely new — not a copy of
   Mission Control or the desktop Dashboard.
   ────────────────────────────────────────────────────────────────────── */

/* Desktop shell hidden only while ARKAN Mobile owns the screen — scoped to
   body.am-mode so desktop routes are byte-for-byte unaffected. */
body.am-mode #app-header,
body.am-mode #app-sidebar,
body.am-mode #app-main {
  display: none !important;
}
body.am-mode {
  overflow: hidden;
}

.am-shell {
  --am-bg:        #060B14;
  --am-surface:   rgba(255, 255, 255, .04);
  --am-surface-2: rgba(255, 255, 255, .02);
  --am-border:    rgba(255, 255, 255, .08);
  --am-accent:    #00C8FF;
  --am-text:      #E8F1FA;
  --am-text-dim:  #8CA0B8;
  --am-text-faint:#5C7189;
  --am-danger:    #FF4D5E;
  --am-warn:      #FF8A3D;

  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 700px at 50% -10%, #0B1626, var(--am-bg) 70%);
  color: var(--am-text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

.am-shell * { box-sizing: border-box; }

/* ── Top Bar ─────────────────────────────────────────────────────────── */
.am-topbar {
  flex: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 18px 16px;
}
.am-topbar__greeting {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.am-topbar__date {
  margin-top: 3px;
  font-size: 13px;
  color: var(--am-text-dim);
  text-transform: capitalize;
}
.am-topbar__clock {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  color: var(--am-accent);
  flex-shrink: 0;
}

/* ── Scroll area ─────────────────────────────────────────────────────── */
.am-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 0;
}
.am-bottom-spacer { height: 12px; }

/* ── Section shell ───────────────────────────────────────────────────── */
.am-section { padding: 14px 18px 4px; }
.am-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.am-section__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--am-text-dim);
}
.am-section__more {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--am-accent);
  cursor: pointer;
  padding: 4px 0;
}

/* ── Horizontal scroll row (Attention) ──────────────────────────────── */
.am-scroll-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
}
.am-scroll-row::-webkit-scrollbar { display: none; }

.am-att-card {
  scroll-snap-align: start;
  flex: none;
  width: 128px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  text-decoration: none;
  color: inherit;
}
.am-att-card__icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--am-c) 16%, transparent);
  color: var(--am-c);
}
.am-att-card__value {
  font-family: var(--font-mono, monospace);
  font-size: 22px;
  font-weight: 700;
  color: var(--am-text);
}
.am-att-card__label {
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--am-text-dim);
}

/* ── Vertical list (Work / Events) ──────────────────────────────────── */
.am-list { display: flex; flex-direction: column; gap: 8px; }

.am-work-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border-radius: 14px;
  background: var(--am-surface);
  border: 1px solid var(--am-border);
  text-decoration: none;
  color: inherit;
}
.am-work-card__icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--am-accent) 14%, transparent);
  color: var(--am-accent);
}
.am-work-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.am-work-card__title {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-work-card__sub {
  font-size: 12px;
  color: var(--am-text-dim);
  font-family: var(--font-mono, monospace);
}
.am-work-card__meta { display: flex; gap: 10px; margin-top: 2px; }
.am-work-card__due,
.am-work-card__author {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--am-text-dim);
}
.am-work-card__due--over { color: var(--am-danger); }
.am-work-card__cta { flex: none; color: var(--am-text-faint); }

.am-event-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 12px;
  background: var(--am-surface-2);
}
.am-event-row__icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--am-surface);
  color: var(--am-text-dim);
}
.am-event-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.am-event-row__title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-event-row__sub {
  font-size: 11.5px;
  color: var(--am-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.am-event-row__time {
  flex: none;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--am-text-faint);
}

/* ── KPI carousel ────────────────────────────────────────────────────── */
.am-kpi-carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: 0 -18px;
  padding: 0 18px 2px;
}
.am-kpi-carousel::-webkit-scrollbar { display: none; }
.am-kpi-chip {
  scroll-snap-align: start;
  flex: none;
  min-width: 108px;
  padding: 14px 15px;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--am-accent) 10%, transparent), transparent);
  border: 1px solid var(--am-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.am-kpi-chip__value {
  font-family: var(--font-mono, monospace);
  font-size: 24px;
  font-weight: 700;
  color: var(--am-accent);
}
.am-kpi-chip__label {
  font-size: 11px;
  color: var(--am-text-dim);
  line-height: 1.25;
}

/* ── Empty / error / loading states ─────────────────────────────────── */
.am-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 14px;
  border-radius: 14px;
  background: var(--am-surface-2);
  color: var(--am-text-faint);
  font-size: 13px;
}
.am-empty--error { color: var(--am-warn); background: color-mix(in srgb, var(--am-warn) 8%, transparent); }

.am-skel-row { display: flex; flex-direction: column; gap: 8px; }
.am-skel {
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--am-surface) 25%, var(--am-surface-2) 37%, var(--am-surface) 63%);
  background-size: 400% 100%;
  animation: am-shimmer 1.4s ease infinite;
}
@keyframes am-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .am-skel { animation: none; opacity: .5; }
}

/* ── Bottom navigation ───────────────────────────────────────────────── */
.am-bottomnav {
  flex: none;
  display: flex;
  padding: 6px 6px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: rgba(7, 12, 21, .92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--am-border);
}
.am-bottomnav__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 4px 5px;
  background: none;
  border: none;
  color: var(--am-text-faint);
  font-family: inherit;
  font-size: 10.5px;
  cursor: pointer;
  border-radius: 12px;
  transition: color .15s ease;
}
.am-bottomnav__tab--active { color: var(--am-accent); }
.am-bottomnav__tab:active { background: var(--am-surface); }

/* ── Only render this screen below the tablet breakpoint in the browser
   preview; real usage is via the dedicated #/mobile route regardless of
   width, this just keeps a stray desktop visit from looking broken. ──── */
@media (min-width: 900px) {
  .am-shell { max-width: 430px; left: 50%; transform: translateX(-50%); box-shadow: 0 0 0 1px var(--am-border), 0 40px 80px rgba(0,0,0,.5); }
}
