/* Almeida Carneiro — Suprimentos — shell compartilhado (sidebar, topbar, login, componentes) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #091A35;
  --navy-deep: #050D1C;
  --blue-ac: #7AA8D4;
  --blue-ac-deep: #3D6D9E;
  --white: #FFFFFF;

  --page-bg: #F4F6FA;
  --surface: #FFFFFF;
  --line: rgba(9,26,53,0.10);
  --line-strong: rgba(9,26,53,0.16);

  --ink: #0D1B2E;
  --ink-dim: rgba(13,27,46,0.62);
  --ink-faint: rgba(13,27,46,0.4);

  --side-ink: rgba(255,255,255,0.6);
  --side-ink-faint: rgba(255,255,255,0.35);
  --side-line: rgba(255,255,255,0.1);

  --danger: #C62828;
  --shadow: 0 1px 2px rgba(9,26,53,0.04), 0 8px 24px -10px rgba(9,26,53,0.14);
}

html { -webkit-font-smoothing: antialiased; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--blue-ac-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

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

/* ---------- Lock screen ---------- */

.lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 360px;
  padding: 40px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.logo-chip {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.lock-logo { width: 56px; height: 56px; object-fit: contain; }

.lock-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-align: center;
  color: var(--navy);
}

.lock-wordmark { width: 100%; max-width: 210px; height: auto; }

.lock-subtitle {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--blue-ac-deep);
  text-align: center;
  margin-top: -14px;
  text-transform: uppercase;
}

.lock-form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 4px; }

.lock-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--page-bg);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  text-align: center;
  outline: none;
}

.lock-form input:focus { border-color: var(--blue-ac); }
.lock-form input::placeholder { letter-spacing: 1px; color: var(--ink-faint); }

.lock-form button {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.lock-form button:hover { opacity: 0.85; }

.lock-error { font-size: 13px; color: var(--danger); text-align: center; display: none; }

.lock-footer {
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--ink-faint);
  text-align: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  width: 100%;
}

/* ---------- App shell ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 232px;
  height: 100vh;
  background: var(--navy);
  border-right: 1px solid var(--side-line);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
}

.sidebar-logo { width: 30px; height: 30px; object-fit: contain; flex: none; }

.sidebar-wordmark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.25;
  color: var(--white);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--side-ink);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { flex: none; width: 18px; height: 18px; }

.nav-badge {
  margin-left: auto;
  background: var(--danger, #C62828);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 100px;
}

.nav-item:hover { background: rgba(122,168,212,0.1); color: var(--white); }

.nav-item.active {
  background: rgba(122,168,212,0.18);
  color: var(--white);
  border-left-color: var(--blue-ac);
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--side-line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-user {
  font-size: 11.5px;
  color: var(--side-ink-faint);
  padding: 0 12px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  background: none;
  border: none;
  color: var(--side-ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.nav-logout:hover { background: rgba(244,67,54,0.12); color: #EF9A9A; }
.nav-logout svg { flex: none; width: 18px; height: 18px; }

.sidebar-version {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--side-ink-faint);
  padding: 6px 12px 0;
}

.app-main {
  margin-left: 232px;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.breadcrumb {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.breadcrumb .sep { margin: 0 8px; color: var(--line-strong); }
.breadcrumb .current { color: var(--blue-ac-deep); }

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

/* ---------- Narrow screens: sidebar stays lateral, collapses to icon rail ---------- */

@media (max-width: 860px) {
  .sidebar { width: 72px; }
  .app-main { margin-left: 72px; }

  .sidebar-brand { padding: 20px 0; justify-content: center; }
  .sidebar-wordmark { display: none; }

  .sidebar-nav { padding: 8px; align-items: center; }

  .nav-item { justify-content: center; padding: 12px; width: 100%; gap: 0; position: relative; }
  .nav-item span { display: none; }

  .sidebar-footer { align-items: center; }
  .sidebar-version { display: none; }
  .sidebar-user { display: none; }

  .nav-logout { justify-content: center; padding: 10px; position: relative; }
  .nav-logout span { display: none; }

  .content { padding: 28px 20px 48px; }
  .topbar { padding: 0 20px; }

  /* Tooltip with the item's name, since the label is hidden in icon-rail mode */
  .nav-item::after, .nav-logout::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--navy-deep);
    color: var(--white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 50;
  }

  .nav-item:hover::after, .nav-item:focus-visible::after,
  .nav-logout:hover::after, .nav-logout:focus-visible::after {
    opacity: 1;
    visibility: visible;
  }
}
