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

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f2f4f8;
}

/* =========================
   LAYOUT
========================= */

.layout {
  display: flex;
  min-height: 100vh;
}

/* =========================
   SIDEBAR
========================= */

.sidebar {
  width: 320px;
  background: #1f4e79;
  color: #fff;
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header h3 {
  margin: 0;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
}

.sidebar-content ul {
  padding-left: 18px;
  margin: 0;
}

.sidebar-content li {
  margin-bottom: 8px;
}

/* =========================
   SIP PANEL
========================= */

.sip-panel {
  background: #ffffff;
  color: #111;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  box-sizing: border-box;
}

.sip-title {
  background: #163a5a;
  color: #fff;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.sip-panel input,
.sip-panel button {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  margin-bottom: 8px;
}

.sip-panel button {
  cursor: pointer;
}

/* =========================
   VOLUME
========================= */

.volume-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-area button {
  width: 40px;
  height: 32px;
  font-weight: bold;
  cursor: pointer;
}

.volume-slider {
  flex: 1;
  height: 26px;
  cursor: pointer;
}

.volume-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: #ccc;
  border-radius: 4px;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  margin-top: -5px;
  background: #1f4e79;
  border-radius: 50%;
  cursor: pointer;
}

.volume-slider::-moz-range-track {
  height: 6px;
  background: #ccc;
  border-radius: 4px;
}

.volume-slider::-moz-range-thumb {
  height: 16px;
  width: 16px;
  background: #1f4e79;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

/* =========================
   MAIN CONTENT
========================= */

.content {
  flex: 1;
  padding: 20px;
  box-sizing: border-box;
}

/* =========================
   TOOLBAR
========================= */

.toolbar {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  text-align: center;
}

.toolbar-titulo {
  font-weight: bold;
  font-size: 20px;
  color: #1f4e79;
}

.toolbar-sub {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
}

/* =========================
   GRID RAMAIS
========================= */

#status-ramais-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 15px;
}

/* =========================
   CARD BASE
========================= */

.box {
  padding: 12px;
  text-align: center;
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s;
  box-sizing: border-box;
  font-weight: bold;
}

.box:hover {
  transform: scale(1.03);
}

/* =========================
   ESTADOS (CORES)
========================= */

.online {
  background: #1f8f3a; /* Verde forte */
  color: #ffffff;
}

.ocupado {
  background: #f2b705; /* Amarelo vivo */
  color: #111111;
}

.offline {
  background: #b12a2a; /* Vermelho */
  color: #ffffff;
}

/* =========================
   TEXTOS INTERNOS
========================= */

.ramal-numero {
  font-size: 20px;
  margin-bottom: 6px;
}

.ramal-nome {
  font-size: 12px;
  margin: 6px 0;
  padding: 4px 0;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.4);
}

.ocupado .ramal-nome {
  border-top: 1px solid rgba(0,0,0,0.3);
  border-bottom: 1px solid rgba(0,0,0,0.3);
}

.ramal-direto {
  font-size: 11px;
  margin-top: 6px;
}

.ramal-status {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  display: inline-block;
  background: rgba(0,0,0,0.2);
}

.ocupado .ramal-status {
  background: rgba(0,0,0,0.3);
}

.ramal-ultimo {
  margin-top: 8px;
  font-size: 10px;
  font-weight: normal;
}

/* =========================
   RESPONSIVO
========================= */

@media (max-width: 768px) {

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  #status-ramais-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 380px) {
  #status-ramais-container {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}

/* =========================
   MINI PHONE FLUTUANTE
========================= */

.mini-phone {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  overflow: hidden;
  z-index: 9999;
  transition: transform 0.3s ease, height 0.3s ease;
}

.phone-header {
  background: #1f4e79;
  color: #ffffff;
  padding: 10px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.phone-body {
  padding: 12px;
  background: #f9f9f9;
}

.mini-phone.minimized .phone-body {
  display: none;
}

.phone-handle {
  font-weight: bold;
}

/* MOBILE AJUSTE */
@media (max-width: 768px) {
  .mini-phone {
    right: 10px;
    left: 10px;
    width: auto;
  }
}
