﻿:root {
  --primary: #0d6efd;
  --dark: #101828;
  --muted: #667085;
  --light-bg: #f5f7fb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --surface-soft: #f8fafc;
  --surface-hover: #f1f5f9;
  --surface-active: #eef4ff;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --input-text: #101828;
  --shadow-soft: rgba(16, 24, 40, 0.06);
  --sidebar-shadow: rgba(16, 24, 40, 0.08);
  --radius: 18px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --dark: #f8fafc;
  --muted: #a8b3c7;
  --light-bg: #07111f;
  --card-bg: #101b2d;
  --border: #263247;
  --surface-soft: #121f33;
  --surface-hover: #17263d;
  --surface-active: rgba(13, 110, 253, 0.18);
  --sidebar-bg: #0d1727;
  --input-bg: #0b1524;
  --input-text: #edf3ff;
  --shadow-soft: rgba(0, 0, 0, 0.24);
  --sidebar-shadow: rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  font-family: 'Poppins', Arial, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--light-bg);
  color: var(--dark);
  font-size: 14px;
}

#wrapper {
  min-height: 100vh;
  overflow-x: hidden;
  align-items: stretch;
  margin: 0 !important;
  padding: 0 !important;
}

.sidebar {
  width: 260px;
  min-height: 100vh;
  transition: margin 0.25s ease-out;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 30px var(--sidebar-shadow);
  padding: 14px;
  margin-top: 0;
  top: 0;
  left: 0;
  position: fixed;
  z-index: 1040;
}

.sidebar-system-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 0 !important;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, var(--surface-soft), var(--sidebar-bg));
  box-shadow: 0 12px 28px rgba(13, 110, 253, 0.1);
}

.sidebar-system-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0d6efd, #4f8cff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.1);
}

.sidebar-system-copy strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
}

.sidebar-system-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

#page-content-wrapper {
  background-color: var(--light-bg);
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  margin-left: 260px !important;
  width: calc(100% - 260px);
}

.content-area {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

#wrapper.toggled .sidebar {
  margin-left: -260px;
}

.navbar {
  background-color: var(--card-bg) !important;
  border-top: none !important;
  border-bottom: 1px solid var(--border) !important;
}

.menu-toggle-btn {
  display: none;
}

.mobile-topbar {
  display: none;
}

.navbar .font-weight-bold {
  color: var(--dark);
}

.list-group-item {
  border: none;
  border-radius: 14px !important;
  background: transparent !important;
  color: var(--dark) !important;
  margin-bottom: 8px;
  font-weight: 600;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex: 0 0 18px;
}

.list-group-item:hover {
  background-color: var(--surface-hover) !important;
  color: var(--dark) !important;
  transform: translateX(4px);
}

.active-menu {
  background: linear-gradient(135deg, #0d6efd, #4f8cff) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(13, 110, 253, 0.25);
}

.sidebar-theme-toggle {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--dark);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-weight: 700;
  transition: 0.2s;
}

.sidebar-theme-toggle:hover {
  background: var(--surface-hover);
}

.sidebar-theme-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.sidebar-theme-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-theme-toggle small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.card,
.table,
.alert,
.breadcrumb-area {
  background: var(--card-bg);
  border-color: var(--border) !important;
  color: var(--dark);
}

.card-resumo {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px var(--shadow-soft);
}

.card-resumo .card-body {
  padding: 20px;
}

.card-titulo {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}

.card-valor {
  font-size: 24px;
  font-weight: bold;
  line-height: 1.2;
  word-break: break-word;
}

.table {
  color: var(--dark);
}

.table thead th {
  border-top: none;
  white-space: nowrap;
  color: var(--muted);
}

.table td,
.table th {
  vertical-align: middle;
  border-color: var(--border) !important;
}

.badge-status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 30px;
}

.form-control,
.btn,
.card,
.table {
  border-radius: 10px;
}

.form-control,
textarea,
select {
  background-color: var(--input-bg) !important;
  color: var(--input-text) !important;
  border-color: var(--border) !important;
}

.form-control::placeholder {
  color: var(--muted);
}

h1, h2, h3, h4, h5 {
  color: var(--dark);
}

h4 {
  font-weight: 700;
}

.alert {
  border-width: 1px;
  border-radius: 12px;
}

.btn-sm {
  min-width: 78px;
}

.card-header {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border) !important;
}

.card-header strong {
  font-weight: 700;
}

.page-actions .btn {
  margin-left: 6px;
}

.table .btn {
  margin-bottom: 4px;
}

.breadcrumb-area {
  border-radius: 10px;
  padding: 10px 15px;
  margin-bottom: 15px;
  box-shadow: 0 0.125rem 0.25rem var(--shadow-soft);
}

.text-muted {
  color: var(--muted) !important;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-stack-actions .btn {
  margin-bottom: 8px;
}

.page-header-mobile {
  gap: 10px;
}

@media (max-width: 991.98px) {
  .mobile-topbar {
    display: flex;
  }

  .menu-toggle-btn {
    display: inline-block;
  }

  .sidebar {
    margin-left: -260px;
    position: fixed;
    z-index: 1040;
    top: 0;
    left: 0;
  }

  #wrapper.toggled .sidebar {
    margin-left: 0;
  }

  #page-content-wrapper {
    width: 100%;
    margin-left: 0 !important;
  }

  .navbar .btn {
    min-width: auto;
  }
}

@media (min-width: 992px) {
  .mobile-topbar {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }
}

@media (max-width: 767.98px) {
  body {
    font-size: 13px;
  }

  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card-resumo .card-body {
    padding: 16px;
  }

  .card-titulo {
    font-size: 13px;
  }

  .card-valor {
    font-size: 20px;
  }

  .table {
    font-size: 12px;
  }

  .btn,
  .form-control {
    font-size: 14px;
  }

  .page-header-mobile {
    flex-direction: column;
    align-items: stretch !important;
  }

  .page-header-mobile .btn,
  .page-header-mobile a.btn {
    width: 100%;
  }

  .mobile-full-btns .btn,
  .mobile-full-btns a.btn {
    width: 100%;
    margin-bottom: 8px;
  }

  .mobile-full-btns .btn:last-child,
  .mobile-full-btns a.btn:last-child {
    margin-bottom: 0;
  }

  .table .btn {
    width: 100%;
    min-width: 0;
  }

  .breadcrumb-area {
    padding: 8px 12px;
  }

  .hide-mobile {
    display: none !important;
  }
}
