/* BAVINCK LAB HOME PORTAL - ESTILO CASAOS */
:root {
  --bg-glass-card: rgba(15, 23, 42, 0.58);
  --bg-glass-card-hover: rgba(30, 41, 59, 0.75);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glass-hover: rgba(255, 255, 255, 0.26);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-blue: #0284c7;
  --accent-cyan: #38bdf8;
  --accent-green: #22c55e;
  --radius-card: 16px;
  --radius-sm: 10px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  background: #090d16 url('../img/wallpaper01.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  user-select: none;
}

/* Overlay sutil para manter legibilidade excelente */
.bg-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.3) 0%, rgba(8, 12, 22, 0.72) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Topbar / Busca */
.portal-header {
  position: relative;
  z-index: 10;
  padding: 16px 24px 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-container {
  flex: 1;
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.search-box {
  width: 100%;
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 10px 16px 10px 42px;
  font-size: 0.95rem;
  color: #ffffff;
  outline: none;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.search-box:focus {
  border-color: var(--accent-cyan);
  background: rgba(15, 23, 42, 0.75);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 8px 25px rgba(0, 0, 0, 0.35);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.clock-display {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f1f5f9;
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Layout Principal */
.portal-main {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 60px 24px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

/* Coluna Lateral de Widgets (Estilo CasaOS) */
.widgets-column {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  transition: var(--transition);
}

.widget-card:hover {
  border-color: var(--border-glass-hover);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  cursor: pointer;
}

.widget-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Medidores Circulares de CPU e RAM */
.system-gauges {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 8px 0;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.gauge-svg {
  width: 82px;
  height: 82px;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.gauge-progress {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease-in-out;
}

.gauge-progress.ram {
  stroke: #38bdf8;
}

.gauge-progress.cpu {
  stroke: #06b6d4;
}

.gauge-center-text {
  position: absolute;
  top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
}

.gauge-unit {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: -2px;
}

.gauge-subinfo {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

/* Armazenamento */
.storage-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.storage-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.storage-details {
  flex: 1;
}

.storage-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.badge-healthy {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
}

.storage-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.storage-bar-bg {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.storage-bar-fill {
  height: 100%;
  width: 26%;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Status de Rede */
.network-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.network-iface {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #e2e8f0;
  font-family: monospace;
}

.network-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.network-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.73rem;
  color: var(--text-dim);
}

.network-stat-row strong {
  color: var(--text-main);
}

/* Área Central de Conteúdo */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Banner de Boas-Vindas Ministerial */
.portal-banner {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.banner-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.banner-text p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.banner-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Seção da Gaveta de Apps (App Drawer) */
.app-drawer-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.drawer-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.drawer-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.btn-add-app {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  color: #ffffff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-add-app:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  transform: scale(1.06);
}

/* Grade de Aplicativos */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.app-card:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--border-glass-hover);
  transform: translateY(-5px);
  box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
}

.app-icon-wrapper {
  width: 68px;
  height: 68px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.app-card:hover .app-icon-wrapper {
  transform: scale(1.05);
}

.app-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.app-domain {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.app-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Rodapé Estilo CasaOS */
.portal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 15, 28, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-glass);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  padding: 3px 10px;
  border-radius: 16px;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.brand-name {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
}

.footer-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.footer-link-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* Modal de Adicionar Atalho */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border-glass-hover);
  border-radius: var(--radius-card);
  padding: 24px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #ffffff;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.form-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-primary {
  background: var(--accent-blue);
  border: none;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Responsividade Tablet e Mobile */
@media (max-width: 920px) {
  .portal-main {
    flex-direction: column;
    padding: 12px 16px 70px 16px;
  }
  .widgets-column {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .widgets-column {
    grid-template-columns: 1fr;
  }
  .portal-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}