/* ================================================================
   ACDC ENERGIA · ESTILOS GLOBAIS
   Proteções anti-cópia + Login + Viewer + Menu Documentos
   ================================================================ */

/* ============== PROTEÇÕES ANTI-CÓPIA/IMPRESSÃO ============== */
@media print {
  html, body { display: none !important; }
}

body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img, canvas {
  pointer-events: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* ============== LOGIN SCREEN ============== */
.login-screen {
  position: fixed; inset: 0;
  background: #050810;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s;
}
.login-screen.hide { opacity: 0; pointer-events: none; }

.login-card {
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(10,18,36,0.95));
  border: 1px solid rgba(243,146,0,0.25);
  border-radius: 12px;
  padding: 48px 40px;
  width: 420px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

.login-card .logo { width: 200px; margin-bottom: 32px; opacity: 0.95; }
.login-card .title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: #F7FAFC;
  margin-bottom: 6px;
}
.login-card .subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: #A0AEC0;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.login-field {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(243,146,0,0.2);
  border-radius: 6px;
  padding: 14px 18px;
  color: #F7FAFC;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.3s;
  -webkit-user-select: text;
  user-select: text;
}
.login-field:focus { border-color: #F39200; }
.login-field::placeholder { color: #4A5568; }

.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #F39200, #C57500);
  border: none;
  border-radius: 6px;
  padding: 14px;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(243,146,0,0.35); }

.login-error {
  color: #ef4444;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  margin-top: 12px;
  min-height: 1.2em;
}

.login-footer {
  margin-top: 28px;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: #4A5568;
  text-transform: uppercase;
}

/* ============== DOCUMENT MENU OVERLAY ============== */
.doc-menu-overlay {
  position: fixed; inset: 0;
  background: rgba(5,8,16,0.97);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  overflow-y: auto;
}
.doc-menu-overlay.open { opacity: 1; pointer-events: all; }

.doc-menu-header {
  text-align: center;
  margin-bottom: 40px;
}
.doc-menu-header img { width: 180px; margin-bottom: 20px; opacity: 0.9; }
.doc-menu-header .title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  color: #F7FAFC;
}
.doc-menu-header .subtitle {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  color: #F39200;
  text-transform: uppercase;
  margin-top: 8px;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  width: 90%;
  margin-bottom: 30px;
}

.doc-card {
  background: linear-gradient(135deg, rgba(15,23,42,0.9), rgba(15,23,42,0.5));
  border: 1px solid rgba(243,146,0,0.2);
  border-radius: 8px;
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.doc-card:hover {
  border-color: #F39200;
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(243,146,0,0.15);
}
.doc-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #F39200, #FFD23F);
  opacity: 0;
  transition: opacity 0.3s;
}
.doc-card:hover::before { opacity: 1; }

.doc-card .icon {
  font-size: 2rem;
  margin-bottom: 14px;
}
.doc-card .name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: #F7FAFC;
  line-height: 1.2;
  margin-bottom: 8px;
}
.doc-card .desc {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  font-size: 0.7rem;
  color: #A0AEC0;
  line-height: 1.5;
}

.doc-menu-controls {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.doc-menu-controls button {
  background: rgba(243,146,0,0.15);
  border: 1px solid rgba(243,146,0,0.4);
  color: #F39200;
  padding: 10px 24px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  border-radius: 4px;
  text-transform: uppercase;
  transition: all 0.3s;
}
.doc-menu-controls button:hover {
  background: rgba(243,146,0,0.3);
}

/* ============== DOCUMENT VIEWER ============== */
.doc-viewer {
  position: fixed; inset: 0;
  background: #0a0e1a;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.doc-viewer.open { opacity: 1; pointer-events: all; }

.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(10,14,26,0.95);
  border-bottom: 1px solid rgba(243,146,0,0.15);
  flex-shrink: 0;
}
.doc-viewer-header .left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.doc-viewer-header .back-btn {
  background: rgba(243,146,0,0.15);
  border: 1px solid rgba(243,146,0,0.3);
  color: #F39200;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}
.doc-viewer-header .back-btn:hover { background: rgba(243,146,0,0.3); }
.doc-viewer-header .doc-info .title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  color: #F7FAFC;
}
.doc-viewer-header .doc-info .sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: #A0AEC0;
  letter-spacing: 0.1em;
}
.doc-viewer-header .page-info {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: #F39200;
  letter-spacing: 0.15em;
}

.doc-viewer-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* PDF Pages */
.pdf-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 900px;
}
.pdf-page {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.pdf-page img {
  width: 100%;
  display: block;
  pointer-events: none;
}
.watermark-overlay {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 200px,
    rgba(243,146,0,0.015) 200px,
    rgba(243,146,0,0.015) 201px
  );
  pointer-events: none;
}
.page-label {
  position: absolute;
  bottom: 8px; right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  color: rgba(160,174,192,0.5);
  letter-spacing: 0.1em;
}

/* Excel viewer */
.excel-tabs {
  display: flex;
  gap: 4px;
  padding: 0 10px;
  margin-bottom: 0;
  width: 100%;
  max-width: 1200px;
  overflow-x: auto;
  flex-shrink: 0;
}
.excel-tab {
  background: rgba(15,23,42,0.8);
  border: 1px solid rgba(243,146,0,0.15);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  padding: 10px 20px;
  color: #A0AEC0;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.excel-tab.active {
  background: rgba(243,146,0,0.15);
  color: #F39200;
  border-color: rgba(243,146,0,0.4);
}
.excel-tab:hover:not(.active) { color: #F7FAFC; }

.excel-sheets { width: 100%; max-width: 1200px; }
.excel-sheet { display: none; }
.excel-sheet.active { display: block; }

.excel-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(243,146,0,0.15);
  border-radius: 0 6px 6px 6px;
  overflow: hidden;
}
.excel-table th {
  background: rgba(243,146,0,0.12);
  color: #F39200;
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(243,146,0,0.3);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.excel-table td {
  padding: 8px 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  white-space: nowrap;
}
.excel-table tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
.excel-table tr:hover td {
  background: rgba(243,146,0,0.06);
}

/* ============== RESPONSIVE ============== */
@media (max-width: 900px) {
  .doc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }
  .login-card {
    padding: 32px 24px;
  }
}
