/* ==========================================================================
   SIGTEL - Base Apple Light Clean
   ========================================================================== */
:root{
  /* BASE */
  --bg:#f5f5f7;
  --bgSoft:#fafafa;
  --bgElevated:#ffffff;
  --card:#ffffff;

  /* TEXTO */
  --text:#1d1d1f;
  --textSoft:#3a3a3c;
  --muted:#6e6e73;

  /* LINHAS */
  --line:#e5e5e7;
  --line2:#d2d2d7;
  --border:#dcdce0;

  /* IDENTIDADE */
  --brand:#1d1d1f;
  --brandSoft:#2c2c2e;

  /* PRIMARY */
  --primary:#0071e3;
  --primaryHover:#005bb5;
  --primarySoft:rgba(0,113,227,.10);

  /* STATUS */
  --ok:#34c759;
  --okHover:#28a745;
  --okSoft:rgba(52,199,89,.10);

  --bad:#ff3b30;
  --badHover:#d92c20;
  --badSoft:rgba(255,59,48,.10);

  --warn:#ff9f0a;
  --warnHover:#d98200;
  --warnSoft:rgba(255,159,10,.10);

  /* EFEITOS */
  --shadow:0 8px 20px rgba(0,0,0,.04);
  --shadowSoft:0 2px 6px rgba(0,0,0,.03);
  --shadowInset:inset 0 1px 0 rgba(255,255,255,.75);

  --radius:16px;
  --radiusSm:12px;
  --radiusLg:22px;

  /* LAYOUT */
  --sidebarW:260px;
  --topbarH:72px;
}

/* ==========================================================================
   RESET
   ========================================================================== */
*{ box-sizing:border-box; }

html,body{
  height:100%;
}

html{
  -webkit-text-size-adjust:100%;
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size:14px;
  line-height:1.5;
  color:var(--text);
  background:linear-gradient(180deg,#fbfbfd 0%, var(--bg) 100%);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

img{
  max-width:100%;
  display:block;
}

a{
  color:var(--primary);
  text-decoration:none;
  transition:color .18s ease;
}

a:hover{
  color:var(--primaryHover);
  text-decoration:none;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  border:0;
  background:none;
}

button,
select{
  cursor:pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:none;
  box-shadow:0 0 0 4px var(--primarySoft);
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
   
   .app{
  min-height:100vh;
  display:grid;
  grid-template-columns:var(--sidebarW) minmax(0,1fr);
}

.main{
  min-width:0;
  padding:24px;
}


.sidebar{
  position:sticky;
  top:0;
  align-self:start;
  min-height:100vh;
  padding:24px 18px;
  background:linear-gradient(180deg,#f7f7f8 0%, #efeff1 100%);
  border-right:1px solid var(--border);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.7);
}

.main{
  min-width:0;
  padding:24px;
}

/* ==========================================================================
   SIDEBAR / BRAND
   ========================================================================== */
.brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:24px;
  padding:10px 8px 18px;
  border-bottom:1px solid var(--line);
}

.brand img{
  width:54px;
  height:54px;
  object-fit:contain;
  border-radius:14px;
  background:linear-gradient(180deg,#ffffff 0%, #f1f1f4 100%);
  border:1px solid var(--border);
  padding:8px;
  box-shadow:var(--shadowSoft);
}

.brand h1{
  margin:0;
  font-size:22px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:.01em;
  color:var(--text);
}

.brand p{
  margin:4px 0 0;
  font-size:13px;
  color:var(--muted);
}

/* ==========================================================================
   MENU
   ========================================================================== */
.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.nav a{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:0 14px;
  border:1px solid transparent;
  border-radius:14px;
  color:var(--textSoft);
  font-weight:700;
  transition:
    background .18s ease,
    color .18s ease,
    border-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.nav a:hover{
  background:rgba(255,255,255,.82);
  border-color:var(--border);
  color:var(--text);
  transform:translateX(2px);
  box-shadow:var(--shadowSoft);
}

.nav a.active{
  background:#ffffff;
  color:var(--text);
  border-color:var(--border);
  box-shadow:var(--shadow);
}

.nav .dot{
  width:10px;
  height:10px;
  border-radius:999px;
  background:currentColor;
  opacity:.72;
  flex:0 0 auto;
}

.hint{
  margin-top:22px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.78);
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
  box-shadow:var(--shadowSoft);
}

/* ==========================================================================
   TOPO
   ========================================================================== */
.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:22px;
}

.title h2{
  margin:0;
  font-size:28px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.02em;
  color:var(--text);
}

.title p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
}

.actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* ==========================================================================
   CONTAINERS / GRID
   ========================================================================== */
.container{
  width:100%;
  max-width:1280px;
  margin:0 auto;
}

.grid{
  display:grid;
  gap:18px;
}

.grid2{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:18px;
}

.grid3{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:18px;
}

.grid4{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:18px;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radiusLg);
  box-shadow:var(--shadow);
  padding:18px;
}

.card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.card-title{
  margin:0;
  font-size:18px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:-.01em;
  color:var(--text);
}

.card-subtitle{
  margin:6px 0 0;
  font-size:13px;
  color:var(--muted);
}

.card-body{
  min-width:0;
}

.card-footer{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

/* ==========================================================================
   CHIP / BADGES
   ========================================================================== */
.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  white-space:nowrap;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid transparent;
}

.badge-ok{
  background:var(--okSoft);
  color:var(--okHover);
  border-color:rgba(52,199,89,.16);
}

.badge-bad{
  background:var(--badSoft);
  color:var(--badHover);
  border-color:rgba(255,59,48,.16);
}

.badge-warn{
  background:var(--warnSoft);
  color:var(--warnHover);
  border-color:rgba(255,159,10,.16);
}

.badge-neutral{
  background:#f3f4f6;
  color:#4b5563;
  border-color:#e5e7eb;
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:0 16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  font-weight:700;
  white-space:nowrap;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease,
    color .18s ease;
}

.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(0,0,0,.06);
}

.btn:active{
  transform:translateY(0);
}

.btn-primary,
.btn.primary{
  background:var(--primary);
  color:#fff;
  border-color:var(--primary);
}

.btn-primary:hover,
.btn.primary:hover{
  background:var(--primaryHover);
  border-color:var(--primaryHover);
  color:#fff;
}

.btn-ok{
  background:var(--ok);
  color:#fff;
  border-color:var(--ok);
}

.btn-ok:hover{
  background:var(--okHover);
  border-color:var(--okHover);
  color:#fff;
}

.btn-bad{
  background:var(--bad);
  color:#fff;
  border-color:var(--bad);
}

.btn-bad:hover{
  background:var(--badHover);
  border-color:var(--badHover);
  color:#fff;
}

.btn-ghost{
  background:rgba(255,255,255,.78);
  color:var(--text);
  border-color:var(--border);
}

.btn-ghost:hover{
  background:#fff;
  border-color:#cfcfd4;
}

.btn-sm{
  min-height:36px;
  padding:0 12px;
  border-radius:12px;
  font-size:13px;
}

.btn-lg{
  min-height:50px;
  padding:0 20px;
  border-radius:16px;
  font-size:15px;
}

/* ==========================================================================
   FORMULÁRIOS
   ========================================================================== */
.form-group,
.campo{
  display:flex;
  flex-direction:column;
  gap:8px;
}

label{
  font-size:13px;
  font-weight:700;
  color:var(--textSoft);
}

.input,
.campo input,
.campo select,
textarea,
select{
  width:100%;
  min-height:44px;
  padding:12px 14px;
  border:1px solid var(--line2);
  border-radius:14px;
  outline:none;
  background:#fff;
  color:var(--text);
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

textarea{
  min-height:120px;
  resize:vertical;
}

.input::placeholder,
textarea::placeholder{
  color:#9a9aa1;
}

.input:focus,
.campo input:focus,
.campo select:focus,
textarea:focus,
select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primarySoft);
}

.input[disabled],
select[disabled],
textarea[disabled]{
  background:#f3f4f6;
  color:#8e8e93;
  cursor:not-allowed;
}

.small{
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.help{
  font-size:12px;
  color:var(--muted);
}

.error-text{
  font-size:12px;
  color:var(--badHover);
}

/* ==========================================================================
   TABELAS
   ========================================================================== */
.table-wrap{
  width:100%;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadowSoft);
}

table{
  width:100%;
  min-width:920px;
  border-collapse:collapse;
  background:#fff;
}

thead th{
  text-align:left;
  padding:14px 16px;
  background:#f8f8fa;
  color:#6b7280;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  font-weight:800;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}

tbody td{
  padding:14px 16px;
  border-bottom:1px solid #efeff1;
  vertical-align:middle;
  color:var(--textSoft);
}

tbody tr:hover td{
  background:#fcfcfd;
}

tbody tr:last-child td{
  border-bottom:0;
}

/* ==========================================================================
   MÉTRICAS
   ========================================================================== */
.metric{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.metric-label{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.metric-value{
  font-size:30px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.03em;
  color:var(--text);
}

.metric-foot{
  font-size:12px;
  color:var(--muted);
}

/* ==========================================================================
   ALERTAS
   ========================================================================== */
.alert{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px 16px;
  border-radius:16px;
  border:1px solid var(--border);
  background:#fff;
}

.alert-ok{
  background:var(--okSoft);
  border-color:rgba(52,199,89,.18);
}

.alert-bad{
  background:var(--badSoft);
  border-color:rgba(255,59,48,.18);
}

.alert-warn{
  background:var(--warnSoft);
  border-color:rgba(255,159,10,.18);
}

/* ==========================================================================
   UTILITÁRIOS
   ========================================================================== */
.text-center{ text-align:center; }
.text-right{ text-align:right; }
.text-muted{ color:var(--muted); }
.text-primary{ color:var(--primary); }
.text-ok{ color:var(--okHover); }
.text-bad{ color:var(--badHover); }
.text-warn{ color:var(--warnHover); }

.mt-0{ margin-top:0; }
.mt-8{ margin-top:8px; }
.mt-12{ margin-top:12px; }
.mt-16{ margin-top:16px; }
.mt-20{ margin-top:20px; }
.mt-24{ margin-top:24px; }

.mb-0{ margin-bottom:0; }
.mb-8{ margin-bottom:8px; }
.mb-12{ margin-bottom:12px; }
.mb-16{ margin-bottom:16px; }
.mb-20{ margin-bottom:20px; }
.mb-24{ margin-bottom:24px; }

.w-100{ width:100%; }
.hidden{ display:none !important; }

/* ==========================================================================
   RESPONSIVO
   ========================================================================== */
@media (max-width:1200px){
  .grid4{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:1100px){
  .app{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:relative;
    min-height:auto;
    padding-bottom:18px;
  }

  .main{
    padding:18px;
  }

  .grid3{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width:760px){
  .main{
    padding:14px;
  }

  .topbar{
    flex-direction:column;
    align-items:flex-start;
  }

  .actions{
    width:100%;
    justify-content:flex-start;
  }

  .title h2{
    font-size:24px;
  }

  .card{
    padding:16px;
    border-radius:18px;
  }

  .grid2,
  .grid3,
  .grid4{
    grid-template-columns:1fr;
  }

  .brand h1{
    font-size:20px;
  }

  .metric-value{
    font-size:26px;
  }
}