/* ============================================================
   SisSCP - Style System
   Paleta: Marrom #795548, Fundo #30221c, Destaque #d28d0e, Texto #ffffff
   ============================================================ */

:root {
  --primary: #573425;
  --primary-light: #a1887f;
  --primary-dark: #30221c;
  --accent: #d28d0e;
  --accent-hover: #e9a626;
  --bg: #1e1410;
  --card-bg: #573425;
  --glass-bg: rgba(87, 52, 37, 0.92);
  --glass-border: rgba(210, 141, 14, 0.15);
  --text: #ffffff;
  --text-muted: #c4b8b2;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #30221c 0%, #261810 100%);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.2rem;
  border-right: 1px solid var(--glass-border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
  color: var(--accent);
}
.logo i {
  font-size: 1.8rem;
}

.nav-menu {
  flex: 1;
  display: flex;
  margin-top: 2rem;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: var(--transition);
  font-weight: 500;
}
.nav-item i {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}
.nav-item:hover {
  background: rgba(121, 85, 72, 0.3);
  color: #fff;
}
.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(121, 85, 72, 0.4);
}

.sidebar-footer {
  margin-top: auto;
}

.btn-whatsapp {
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 4px 4px 18px rgba(192, 179, 179, 0.3);
  border-radius: var(--radius);
  color: #25d366;
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition);
}
.btn-whatsapp:hover {
  background: rgba(37, 211, 102, 0.1);
  border-color: #25d366;
  color: #fff;
}

.suporte {
  display: flex;
  justify-content: center;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}
/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--bg) 0%, #2a1c14 100%);
}

.top-header {
  height: 70px;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-bar {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  width: 400px;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.search-bar i {
  color: var(--text-muted);
}
.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: inherit;
  color: #fff;
}
.search-bar input::placeholder {
  color: var(--text-muted);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.notifications {
  position: relative;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
}
.badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}

.avatar img {
  width: 38px;
  height: 38px;
  margin: 5px 0 5px 0px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

/* ============================================================
   CONTENT BODY & SECTIONS
   ============================================================ */
.content-body {
  padding: 2rem;
}
.section-page {
  display: none;
  animation: fadeIn 0.35s ease;
}
.section-page.active-section {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
}
.title-group h1 {
  font-size: 1.8rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.title-group p {
  color: var(--text-muted);
  margin-top: 4px;
}
.action-group {
  display: flex;
  gap: 10px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  background: var(--accent);
  color: var(--primary-dark);
  border: none;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-family: inherit;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(210, 141, 14, 0.35);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: -3px 3px 8px rgba(255, 255, 255, 0.619);
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-3px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-icon.active {
  background: rgba(56, 178, 172, 0.15);
  color: #38b2ac;
}
.stat-icon.archived {
  background: rgba(66, 153, 225, 0.15);
  color: #4299e1;
}
.stat-icon.warning {
  background: rgba(245, 101, 101, 0.15);
  color: #f56565;
}
.stat-icon.total {
  background: rgba(210, 141, 14, 0.15);
  color: var(--accent);
}

.stat-info h3 {
  font-size: 1.5rem;
  color: var(--accent);
}
.stat-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filters-container {
  display: flex;
  gap: 2rem;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  align-items: flex-end;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-group > label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radio-group {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 8px;
}
.radio-label {
  cursor: pointer;
  font-size: 0.88rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.radio-label input {
  display: none;
}
.radio-label span {
  transition: var(--transition);
}
.radio-label input:checked + span {
  background: var(--accent);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: 5px;
  font-weight: 600;
}

.filter-group input[type="date"] {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-family: inherit;
  outline: none;
}
.filter-group input[type="date"]:focus {
  border-color: var(--accent);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-container {
  border-radius: var(--radius);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 1rem 1.2rem;
  background: #5a3626;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.6px;
}

td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.92rem;
}

tbody tr {
  transition: var(--transition);
}
tbody tr:hover {
  background: #693f2d;
}

.proc-cell strong {
  display: block;
  font-size: 0.9rem;
}
.proc-cell small {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.andamento-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  color: var(--accent);
  transition: var(--transition);
}
.andamento-cell:hover {
  color: #fff;
  text-decoration: underline;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
}
.status-badge.ativo {
  background: rgba(56, 178, 172, 0.2);
  color: #68d391;
}
.status-badge.arquivado {
  background: rgba(255, 255, 255, 0.06);
  color: #a0aec0;
}

.deadline-red {
  color: #fc8181;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(245, 101, 101, 0.5);
}
.deadline-yellow {
  color: #fbd38d;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(236, 201, 75, 0.3);
}
.deadline-hearing {
  color: #90cdf4;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(99, 179, 237, 0.3);
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.85rem;
}
.btn-icon:hover {
  transform: scale(1.15);
}
.btn-edit {
  background: rgba(66, 153, 225, 0.15);
  color: #63b3ed;
}
.btn-delete {
  background: rgba(245, 101, 101, 0.15);
  color: #fc8181;
}
.btn-view {
  background: rgba(56, 178, 172, 0.15);
  color: #4fd1c5;
}

/* ============================================================
   ALERTAS SECTION
   ============================================================ */
.alerts-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.alert-setting-card {
  padding: 2rem;
  border-radius: var(--radius);
  transition: var(--transition);
}
.alert-setting-card:hover {
  transform: translateY(-4px);
}

.red-glow {
  border-left: 4px solid #e53e3e;
}
.yellow-glow {
  border-left: 4px solid #ecc94b;
}
.blue-glow {
  border-left: 4px solid #4299e1;
}

.alert-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
}
.alert-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.alert-icon-circle.red {
  background: rgba(229, 62, 62, 0.2);
  color: #fc8181;
}
.alert-icon-circle.yellow {
  background: rgba(236, 201, 75, 0.2);
  color: #fbd38d;
}
.alert-icon-circle.blue {
  background: rgba(66, 153, 225, 0.2);
  color: #90cdf4;
}

.alert-setting-card h3 {
  color: var(--accent);
  font-size: 1.1rem;
}
.alert-setting-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
  line-height: 1.5;
}

.hint-text {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
  display: block;
}

.alert-save-area {
  text-align: right;
}

/* ============================================================
   PARÂMETROS SECTION
   ============================================================ */
.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.param-card {
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  box-shadow: -3px 3px 8px rgba(255, 255, 255, 0.619);
  border-radius: var(--radius);
}
.param-card i {
  font-size: 2.5rem;
  color: var(--accent);
  transition: var(--transition);
}
.param-card span {
  font-weight: 600;
  font-size: 1rem;
}

.param-card:hover {
  background: var(--accent);
  /*transition: box-shadow 2.2s ease;*/
  box-shadow: 3px -2px 8px rgba(255, 255, 255, 0.906);
  transform: translateY(-6px);
  /*box-shadow: 0 8px 25px rgba(210, 141, 14, 0.3);*/
}
.param-card:hover i,
.param-card:hover span {
  color: var(--primary-dark);
}

/* ============================================================
   MODALS
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 92%;
  max-width: 800px;
  border-radius: 20px;
  padding: 2rem;
  animation: slideIn 0.3s ease-out;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content.large {
  max-width: 1000px;
}

@keyframes slideIn {
  from {
    transform: translateY(-30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.modal-header h2 {
  color: var(--accent);
}

.close-modal {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.close-modal:hover {
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}
.full-width {
  grid-column: span 2;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  transition: var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(210, 141, 14, 0.15);
}
.form-group select {
  cursor: pointer;
}
.form-group select option {
  background: var(--card-bg);
  color: #fff;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.andamento-body {
  max-height: 450px;
  overflow-y: auto;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Alert Popup */
.alert-popup-header h2 {
  color: #fc8181 !important;
}
.alert-popup-body {
  max-height: 400px;
  overflow-y: auto;
}
.alert-popup-item {
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  border-left: 4px solid;
  background: rgba(0, 0, 0, 0.2);
}
.alert-popup-item.red {
  border-color: #e53e3e;
}
.alert-popup-item.yellow {
  border-color: #ecc94b;
}
.alert-popup-item.hearing {
  border-color: #4299e1;
}
.alert-popup-item strong {
  display: block;
  margin-bottom: 4px;
}
.alert-popup-item small {
  color: var(--text-muted);
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .alerts-settings-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .sidebar {
    width: 70px;
    padding: 1rem 0.5rem;
  }
  .sidebar .logo span,
  .sidebar .nav-item span,
  .sidebar .btn-whatsapp span {
    display: none;
  }
  .sidebar .logo {
    justify-content: center;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full-width {
    grid-column: span 1;
  }
  .search-bar {
    width: 200px;
  }
}
