/* ═══════════════════════════════════════════════════
   MM Suporte — Layout baseado no NOC Manager
═══════════════════════════════════════════════════ */
:root {
  --noc-bg:           #060b19;
  --noc-bg-soft:      #101728;
  --noc-panel:        #101728;
  --noc-panel-border: rgba(91, 116, 151, 0.32);
  --noc-input-bg:     #243046;
  --noc-input-focus:  #26334b;
  --noc-input-border: #314057;
  --noc-text:         #dce7f7;
  --noc-text-bright:  #f3f6fb;
  --noc-muted:        #7e8ca4;
  --noc-label:        #9aa8bd;
  
  --brand-cyan:       #00d2d3;
  --brand-blue:       #0284c7;
  --brand-gradient:   linear-gradient(90deg, #00d2d3, #0284c7);
  --brand-glow:       0 14px 26px rgba(0, 210, 211, 0.25);

  --bs-body-bg:       var(--noc-bg);
  --bs-body-color:    var(--noc-text);
  --bs-card-bg:       var(--noc-panel);
  --bs-border-color:  var(--noc-panel-border);
  
  --bs-primary:       var(--brand-cyan);
  --bs-secondary:     #64748b;
  --bs-success:       #10b981;
  --bs-danger:        #f05252;
  --bs-warning:       #ffb020;
  --bs-info:          #38bdf8;
  --bs-dark:          var(--noc-bg);
  --bs-light:         var(--noc-text-bright);

  --font:             'Outfit', -apple-system, sans-serif;
  --safe-top:         env(safe-area-inset-top, 0px);
  --safe-bot:         env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; letter-spacing: 0; }

html, body {
  height: 100%; overflow: hidden;
  background-color: var(--noc-bg) !important;
  color: var(--noc-text) !important;
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── App Shell ────────────────────────────────────── */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--noc-bg);
}

/* ── Screens ──────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--noc-bg);
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity .22s ease, transform .22s ease;
  overflow: hidden;
  z-index: 1;
}

/* Login screen has transparent background so canvas shows */
#screen-login {
  background: transparent;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
}


/* ── Top Bar ──────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: var(--noc-bg-soft);
  border-bottom: 1px solid var(--noc-panel-border);
  flex-shrink: 0;
  min-height: 60px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.topbar-back {
  background: none; border: none;
  color: var(--brand-cyan); font-size: 1.4rem;
  cursor: pointer; padding: 4px 8px;
  line-height: 1;
}
.topbar-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--noc-text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Scroll Content ───────────────────────────────── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--safe-bot) + 84px);
}

/* ── Bottom Nav Bar ───────────────────────────────── */
.bottom-nav {
  display: flex;
  background: var(--noc-bg-soft);
  border-top: 1px solid var(--noc-panel-border);
  padding-bottom: var(--safe-bot);
  flex-shrink: 0;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}
.bn-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: var(--noc-muted);
  font-family: var(--font);
  font-size: .72rem;
  cursor: pointer;
  transition: all .15s;
}
.bn-item.active { color: var(--brand-cyan); font-weight: 700; }
.bn-icon { font-size: 1.35rem; }

/* ── NOC Manager Auth Layout (.auth-wrapper, .auth-panel) ─ */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  background: transparent;
  z-index: 1;
}

.auth-panel {
  position: relative;
  z-index: 2;
  width: min(100%, 540px);
  padding: 38px 28px 28px;
  border: 1px solid var(--noc-panel-border);
  border-radius: 12px;
  background: var(--noc-panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.auth-logo {
  display: block;
  max-width: 300px;
  height: auto;
  object-fit: contain;
}

.auth-brand-centered {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand-centered strong {
  display: block;
  color: var(--noc-text-bright);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.15;
}

.auth-brand-centered strong span {
  color: var(--brand-cyan);
}

.auth-brand-centered small {
  display: block;
  margin-top: 8px;
  color: var(--noc-muted);
  font-size: 0.86rem;
}

.auth-form {
  display: grid;
  gap: 18px;
  width: 100%;
}

.auth-form .form-label {
  margin-bottom: 8px;
  color: var(--noc-label);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form .form-control {
  min-height: 48px;
  padding: 0 16px;
  color: var(--noc-text) !important;
  border: 1px solid var(--noc-input-border) !important;
  border-radius: 8px !important;
  background: var(--noc-input-bg) !important;
  box-shadow: none !important;
}

.auth-form .form-control::placeholder {
  color: var(--noc-muted);
}

.auth-form .form-control:focus {
  border-color: var(--brand-cyan) !important;
  background: var(--noc-input-focus) !important;
  box-shadow: 0 0 0 3px rgba(0, 210, 211, 0.18) !important;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand-cyan);
  font-size: 1.05rem;
  line-height: 1;
  pointer-events: none;
  z-index: 5;
  transition: color 0.2s ease, transform 0.2s ease;
}

.input-icon-wrapper:focus-within .input-icon {
  color: var(--brand-cyan);
  transform: translateY(-50%) scale(1.12);
}

.input-icon-wrapper .form-control {
  padding-left: 46px !important;
  border-radius: 10px !important;
}



.auth-form .btn-auth {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-gradient);
  box-shadow: var(--brand-glow);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  transition: opacity .2s ease, transform .15s ease;
}

.auth-form .btn-auth:hover, .auth-form .btn-auth:active {
  opacity: 0.92;
  color: #fff;
  transform: translateY(-1px);
}

.form-check-input {
  background-color: var(--noc-input-bg) !important;
  border-color: var(--noc-input-border) !important;
}
.form-check-input:checked {
  background-color: var(--brand-cyan) !important;
  border-color: var(--brand-cyan) !important;
}

/* ── OS Card List ─────────────────────────────────── */
.card-os {
  background: var(--noc-panel);
  border: 1px solid var(--noc-panel-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.card-os:hover, .card-os:active {
  transform: translateY(-2px);
  border-color: var(--brand-cyan);
  box-shadow: 0 8px 25px rgba(0, 210, 211, 0.2);
}

.os-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px;
}
.os-card-id {
  font-size: .82rem; color: var(--brand-cyan); font-weight: 700; font-family: monospace;
}
.os-card-title {
  font-size: .98rem; font-weight: 700; color: var(--noc-text-bright); flex: 1;
}
.os-card-body {
  font-size: .85rem; color: var(--noc-muted); line-height: 1.5; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.os-card-footer {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px;
}

/* ── Detail Cards ─────────────────────────────────── */
.detail-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: .82rem; color: var(--noc-muted); flex-shrink: 0; }
.detail-val { font-size: .88rem; font-weight: 600; color: var(--noc-text-bright); text-align: right; }

/* ── Notes & Photos ───────────────────────────────── */
.note-item {
  background: var(--noc-input-bg);
  border-left: 4px solid var(--brand-cyan);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.note-meta { font-size: .75rem; color: var(--noc-muted); margin-bottom: 4px; }
.note-text { font-size: .88rem; line-height: 1.55; white-space: pre-wrap; color: var(--noc-text); }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 16px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--noc-input-bg);
  border: 1px solid var(--noc-panel-border);
  transition: transform .15s;
}
.photo-thumb:active { transform: scale(.95); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Bottom Sheet Modals ──────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(6, 11, 25, 0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.sheet-overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  width: 100%; max-height: 85vh;
  background: var(--noc-panel);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid var(--noc-panel-border);
  padding: 0 0 calc(var(--safe-bot) + 16px);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.sheet-overlay.open .sheet { transform: translateY(0); }
.sheet-handle {
  width: 44px; height: 5px;
  background: var(--noc-input-border);
  border-radius: 3px;
  margin: 12px auto 16px;
}
.sheet-title {
  font-size: 1.05rem; font-weight: 700;
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--noc-panel-border);
  margin-bottom: 16px;
  color: var(--brand-cyan);
}
.sheet-body { padding: 0 20px; display: flex; flex-direction: column; gap: 14px; }

/* ── Toast & Spinners ─────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--safe-bot) + 80px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--noc-panel); border: 1px solid var(--brand-cyan);
  color: var(--noc-text-bright); padding: 12px 20px;
  border-radius: 30px; font-size: .88rem; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  z-index: 500; opacity: 0;
  transition: all .25s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--bs-success); color: #34d399; }
.toast.error   { border-color: var(--bs-danger);  color: #f87171; }

.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px;
  text-align: center; color: var(--noc-muted);
}
.empty-icon { font-size: 3rem; opacity: .35; }
.empty-text { font-size: .9rem; line-height: 1.5; }

.spinner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 50px 20px;
  color: var(--noc-muted); font-size: .9rem;
}
.spin {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--brand-cyan);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Photo Viewer ─────────────────────────────────── */
.photo-viewer {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(6, 11, 25, 0.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.photo-viewer.open { opacity: 1; pointer-events: all; }
.photo-viewer img { max-width: 95vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
.photo-viewer-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(0,0,0,.6); border: none; color: #fff;
  font-size: 1.6rem; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ── Mobile Login — sem moldura, full screen elegante ─ */
@media (max-width: 600px) {
  .auth-wrapper {
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .auth-panel {
    width: 100%;
    max-width: 440px;
    min-height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: auto 0;
  }

  .auth-logo-wrap {
    margin-top: 0;
    margin-bottom: 12px;
  }

  .auth-logo {
    max-width: 250px;
    width: 75%;
  }

  .auth-brand-centered {
    margin-bottom: 28px;
  }

  .auth-brand-centered small {
    font-size: 0.92rem;
    color: var(--noc-muted);
  }

  .auth-form .form-control {
    min-height: 54px !important;
    font-size: 1rem;
    border-radius: 12px !important;
    background: rgba(36, 48, 70, 0.85) !important;
    border-color: rgba(49, 64, 87, 0.6) !important;
    backdrop-filter: blur(8px);
  }

  .input-icon-wrapper .form-control {
    min-height: 54px !important;
    padding-left: 50px !important;
    font-size: 1rem;
    border-radius: 14px !important;
    background: rgba(36, 48, 70, 0.85) !important;
    border-color: rgba(49, 64, 87, 0.6) !important;
    backdrop-filter: blur(8px);
  }

  .input-icon-wrapper .input-icon {
    left: 18px;
    font-size: 1.15rem;
  }

  .auth-form .btn-auth {
    min-height: 56px;
    border-radius: 14px;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    margin-top: 10px;
  }

  .auth-footer {
    margin-top: 24px;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .auth-footer-logo {
    max-width: 95px;
  }

  #login-error {
    border-radius: 12px;
  }
}

.auth-footer {
    margin-top: auto;
    margin-bottom: auto;
    padding-top: 20px;
    padding-bottom: 10px;
  }

  .auth-footer-logo {
    max-width: 98px;
  }

  .auth-logo {
    max-width: 270px;
    width: 75%;
  }

  .auth-brand-centered {
    margin-bottom: 36px;
  }

  .auth-brand-centered small {
    font-size: 0.92rem;
    color: var(--noc-muted);
  }

  .auth-form .form-control {
    min-height: 54px !important;
    font-size: 1rem;
    border-radius: 12px !important;
    background: rgba(36, 48, 70, 0.85) !important;
    border-color: rgba(49, 64, 87, 0.6) !important;
    backdrop-filter: blur(8px);
  }

  .input-icon-wrapper .form-control {
    min-height: 54px !important;
    padding-left: 50px !important;
    font-size: 1rem;
    border-radius: 14px !important;
    background: rgba(36, 48, 70, 0.85) !important;
    border-color: rgba(49, 64, 87, 0.6) !important;
    backdrop-filter: blur(8px);
  }

  .input-icon-wrapper .input-icon {
    left: 18px;
    font-size: 1.15rem;
  }

  .auth-form .btn-auth {
    min-height: 56px;
    border-radius: 14px;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
    margin-top: 10px;
  }

  #login-error {
    border-radius: 12px;
  }
}


.auth-footer {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.auth-footer:hover {
  opacity: 0.95;
}

.auth-footer-logo {
  max-width: 110px;
  height: auto;
  object-fit: contain;
}

.auth-footer-text {
  font-size: 0.72rem;
  color: var(--noc-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}
