/* ============================================================
   Dashboard — Oberthur Feerica (ATM EVE)
   Template HTML/CSS gerado a partir do mockup Dashboard-03
   ============================================================ */

:root {
  --blue:        #0000d4;   /* azul primário (logo, botões, item activo) */
  --blue-light:  #28a2de;   /* azul claro (maintenance) */
  --green:       #34a630;
  --red:         #e0000e;
  --orange:      #f7b033;
  --black:       #111111;

  --bg:          #e9e9e9;   /* fundo topo + sidebar */
  --content-bg:  #ffffff;   /* fundo da área de conteúdo */
  --panel:       #f4f4f4;   /* corpo dos painéis */
  --head-dark:   #b9b9b9;   /* cabeçalho do painel expandido */
  --head-mid:    #c9c9c9;   /* cabeçalhos dos painéis fechados */
  --head-light:  #e7e7e7;   /* cabeçalhos das sub-secções */

  --text:        #4b4b4b;
  --text-muted:  #8a8a8a;
  --track:       #d2d2d2;   /* trilho das barras de progresso */
  --bar-dark:    #58595b;

  --radius-lg:   26px;
  --radius-md:   14px;

  --sidebar-w:   272px;
  --topbar-h:    72px;
}

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

html, body { height: 100%; }

body {
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: var(--content-bg);
  color: var(--text);
  font-size: 14px;
}

button { font-family: inherit; cursor: pointer; }

/* ============================================================
   BARRA SUPERIOR
   ============================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 22px;
  width: calc(var(--sidebar-w) - 28px);
  flex-shrink: 0;
}

.topbar__logo { height: 40px; width: auto; display: block; }

.hamburger {
  background: none;
  border: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  width: 26px;
  height: 3px;
  background: #1d2b36;
  border-radius: 2px;
}

.topbar__nav {
  display: flex;
  align-items: center;
  gap: 34px;
  flex: 1;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .4px;
  font-size: 13px;
}
.topbar__link:hover { color: var(--text); }

.icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-circle svg { width: 17px; height: 17px; }

.topbar__right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar__clock {
  color: var(--text-muted);
  font-size: 17px;
  letter-spacing: 2px;
}

.select-pill {
  position: relative;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.select-pill select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  padding: 9px 44px 9px 16px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 150px;
  outline: none;
}
.select-pill::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #9a9a9a;
  border-bottom: 2px solid #9a9a9a;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  padding-bottom: 40px;
}

/* Pesquisa */
.sidebar__search {
  display: flex;
  align-items: stretch;
  background: #f5f5f5;
}
.sidebar__search-btn {
  width: 46px;
  background: var(--blue);
  border: 0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar__search-btn svg { width: 18px; height: 18px; }
.sidebar__search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 14px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
}
.sidebar__search input::placeholder { color: #b3b3b3; }

/* Menu */
.menu { list-style: none; }

.menu__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  color: #7c7c7c;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: .5px;
  border-bottom: 1px solid rgba(255,255,255,.55);
  transition: background .15s ease;
}
.menu__link:hover { background: #e0e0e0; }

.menu__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu__icon svg {
  width: 22px;
  height: 22px;
  stroke: #7c7c7c;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu__label { flex: 1; }

/* seta circular à direita */
.menu__chev {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #e2e2e2);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.menu__chev::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid #4b4b4b;
  border-bottom: 2px solid #4b4b4b;
  transform: rotate(-45deg) translate(-1px, 1px);
}
.menu__chev--down::before { transform: rotate(45deg) translate(0, -2px); }

/* Item activo (ATM) */
.menu__link--active {
  background: var(--blue);
  color: #fff;
}
.menu__link--active:hover { background: var(--blue); }
.menu__link--active .menu__icon svg { stroke: #fff; }

/* Submenu */
.submenu { list-style: none; }
.submenu__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px 13px 56px;
  color: #6f6f6f;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 12.5px;
  letter-spacing: .5px;
  transition: background .15s ease;
}
.submenu--open { background: #cfcfcf; }
.submenu--open .submenu__link { border-bottom: 1px solid rgba(255,255,255,.35); }
.submenu__link:hover { background: #c4c4c4; }
.submenu__link--active { background: #b9b9b9; color: #5a5a5a; }

/* ============================================================
   CONTEÚDO
   ============================================================ */
.content {
  flex: 1;
  background: var(--content-bg);
  padding: 34px 44px 60px;
  min-width: 0;
}

.page-title {
  color: var(--blue);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: .5px;
  margin-bottom: 24px;
}
.page-title strong { font-weight: 700; }

/* ============================================================
   PAINÉIS (acordeão)
   ============================================================ */
.panel { margin-bottom: 26px; }

.panel__toggle { display: none; }

.panel__head {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--head-mid);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  cursor: pointer;
  user-select: none;
}
.panel__head:hover { filter: brightness(.98); }

.panel__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #1c1c1c;
  text-transform: uppercase;
}

/* botão circular com seta */
.chev-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dcdcdc);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chev-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2.5px solid #333;
  border-bottom: 2.5px solid #333;
  transform: rotate(-45deg) translate(-1px, 1px); /* fechado: > */
  transition: transform .2s ease;
}

.panel__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel__datetime {
  color: #8f8f8f;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Botões */
.btn {
  border: 0;
  border-radius: 7px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1.15;
}
.btn--light {
  background: linear-gradient(180deg, #ffffff, #ececec);
  color: #1c1c1c;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.btn--primary:hover { background: #0000b8; }
.btn--sm { padding: 5px 12px; font-size: 11px; }

/* Corpo do painel */
.panel__body {
  background: var(--panel);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 30px 26px 34px;
}

/* Painel expandido: cabeçalho escuro, só cantos de cima redondos */
.panel__toggle:checked ~ .panel__head {
  background: var(--head-dark);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.panel__toggle:checked ~ .panel__head .chev-btn::before {
  transform: rotate(45deg) translate(0, -2px);   /* aberto: v */
}
.panel__body { display: none; }
.panel__toggle:checked ~ .panel__body { display: block; }

/* Sub-secções dentro do painel (Smartdoor / Cassette) */
.subpanel__head {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--head-light);
  border-radius: 18px;
  padding: 12px 22px;
  margin: 34px -4px 6px;
}
.subpanel__head .panel__title { font-size: 15px; }

/* ============================================================
   LINHA DE DISPOSITIVO (imagem + estatísticas)
   ============================================================ */
.device-row {
  display: flex;
  gap: 34px;
  align-items: flex-start;
  padding: 18px 4px 8px;
}

.device-row__img {
  width: 150px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.device-row__img img {
  max-width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
}

.stats {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  column-gap: 38px;
  row-gap: 34px;
  min-width: 0;
}

/* Bloco de estatística */
.stat { min-width: 0; }

.stat__head {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #8f8f8f;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .4px;
  margin-bottom: 2px;
}

.stat__zoom {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #6d6d6d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat__zoom svg { width: 11px; height: 11px; }

.stat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat__value {
  font-size: 34px;
  font-weight: 300;
  letter-spacing: 1px;
  line-height: 1.15;
}

.stat__icon svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat__bar {
  margin-top: 8px;
  height: 9px;
  border-radius: 6px;
  background: var(--track);
  overflow: hidden;
}
.stat__bar span {
  display: block;
  height: 100%;
  border-radius: 6px;
}

/* Variantes de cor */
.stat--dark   .stat__value { color: #6d6d6d; }
.stat--dark   .stat__bar span { background: var(--bar-dark); }
.stat--dark   .stat__icon svg { stroke: #9a9a9a; }

.stat--green  .stat__value { color: var(--green); }
.stat--green  .stat__bar span { background: var(--green); }
.stat--green  .stat__icon svg { stroke: var(--green); }

.stat--red    .stat__value { color: var(--red); }
.stat--red    .stat__bar span { background: var(--red); }
.stat--red    .stat__icon svg { stroke: var(--red); }

.stat--orange .stat__value { color: var(--orange); }
.stat--orange .stat__bar span { background: var(--orange); }
.stat--orange .stat__icon svg { stroke: var(--orange); }

.stat--black  .stat__value { color: var(--black); }
.stat--black  .stat__bar span { background: var(--black); }
.stat--black  .stat__icon svg { stroke: var(--black); }

.stat--blue   .stat__value { color: var(--blue-light); }
.stat--blue   .stat__bar span { background: var(--blue-light); }
.stat--blue   .stat__icon svg { stroke: var(--blue-light); }

.stat--gray   .stat__value { color: #b3b3b3; }
.stat--gray   .stat__bar span { background: #9a9a9a; }
.stat--gray   .stat__icon svg { stroke: #b3b3b3; }

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 1500px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1150px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar__nav { gap: 18px; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar__brand { width: auto; }
  .content { padding: 24px 18px 50px; }
  .device-row { flex-direction: column; align-items: center; }
  .panel__meta { flex-wrap: wrap; justify-content: flex-end; }
}
