:root {
  --bg-dark: #111827;
  --bg-light: #f5f7fb;
  --accent: #1f9d55;
  --accent-soft: rgba(31,157,85,0.12);
  --text-dark: #111827;
  --text-light: #f9fafb;
  --radius-xl: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 30px rgba(15,23,42,0.18);
  --transition-fast: 0.25s ease;
  --sidebar-width: 250px;
}

html[data-theme="dark"] {
  --bg-body: var(--bg-dark);
  --bg-card: #111827;
  --border-subtle: #1f2937;
  --text-main: var(--text-light);
  --text-muted: #9ca3af;
}

html[data-theme="light"] {
  --bg-body: var(--bg-light);
  --bg-card: #ffffff;
  --border-subtle: #e5e7eb;
  --text-main: var(--text-dark);
  --text-muted: #6b7280;
}

/* ===== Estrutura Geral ===== */
body.nc-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro", sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
}

/* ===== Header ===== */
.nc-header {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nc-logo {
  height: 34px;
}

.nc-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nc-icon-btn {
  border: none;
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.nc-icon-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* ===== Menu do Usuário ===== */
.nc-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  cursor: pointer;
}

.nc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
}

.nc-user-info span {
  font-size: 14px;
  font-weight: 500;
}
.nc-user-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.nc-user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 42px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 8px 0;
  min-width: 160px;
  z-index: 99;
}

.nc-user-dropdown a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-main);
  text-decoration: none;
}

.nc-user-dropdown a:hover {
  background: var(--accent-soft);
}

.nc-user-menu:hover .nc-user-dropdown {
  display: block;
}

/* ===== Layout ===== */
.nc-layout {
  display: flex;
}

.nc-sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - 64px);
  background: #020817;
  color: #9ca3af;
  padding: 16px 14px;
  box-shadow: 4px 0 18px rgba(15,23,42,0.4);
  position: sticky;
  top: 64px;
}

.nc-sidebar[data-collapsed="true"] {
  width: 72px;
}

.nc-sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.nc-sidebar-logo {
  height: 30px;
}

.nc-sidebar nav a {
  display: block;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 13px;
  text-decoration: none;
  transition: var(--transition-fast);
}

.nc-sidebar nav a:hover {
  background: var(--accent-soft);
  color: #fff;
}

.nc-main {
  flex: 1;
  padding: 24px;
}

/* ===== Cards ===== */
.nc-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 18px 18px 14px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 18px;
}

.nc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.nc-card-header h3 {
  margin: 0;
  font-size: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-fast);
}

.btn-primary:hover {
  filter: brightness(1.08);
}

/* ===== Tabelas (zebradas, alinhadas e suaves) ===== */
table.nc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

table.nc-table thead {
  background: rgba(255, 255, 255, 0.04);
}

table.nc-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.2px;
  padding: 12px 14px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

table.nc-table td {
  padding: 12px 14px;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

table.nc-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.01);
}
table.nc-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}
table.nc-table tr:last-child td {
  border-bottom: none;
}
table.nc-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.25s ease;
}

table.nc-table .action-icon {
  cursor: pointer;
  margin-right: 8px;
  opacity: 0.75;
  transition: opacity 0.25s ease;
}
table.nc-table .action-icon:hover {
  opacity: 1;
}

table.nc-table .badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
table.nc-table .badge-success {
  background: rgba(22,163,74,0.16);
  color: #22c55e;
}
table.nc-table .badge-secondary {
  background: rgba(107,114,128,0.16);
  color: #9ca3af;
}

/* ===== Login ===== */
body.login-body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh;
  display: flex;
  background: #020817;
  color: #fff;
}

.login-bg {
  flex: 1.7;
  position: relative;
  overflow: hidden;
}

.login-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.65);
}

.login-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  background: radial-gradient(circle at top, #111827, #020817);
}

.login-logo-wrap {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  height: 70px;
  margin-bottom: 8px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form label {
  font-size: 12px;
  color: #9ca3af;
}

.login-form input {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid #111827;
  background: #020817;
  color: #e5e7eb;
  outline: none;
  margin-bottom: 8px;
}

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

.alert.alert-error {
  background: rgba(239,68,68,0.12);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: #fecaca;
  margin-bottom: 8px;
}

.login-footer-info {
  margin-top: 16px;
  font-size: 10px;
  text-align: center;
  color: #6b7280;
}

/* ===== Configurações (settings.php) ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.grid-2 label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.grid-2 input[type="text"],
.grid-2 textarea,
.grid-2 select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.25s ease;
}

.grid-2 input:focus,
.grid-2 textarea:focus,
.grid-2 select:focus {
  border-color: var(--accent);
}

.grid-2 textarea {
  resize: vertical;
  min-height: 60px;
}

/* Previews */
.preview-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-wrap img {
  background: #0f172a;
  padding: 5px;
  border-radius: 6px;
  box-shadow: 0 0 6px rgba(0,0,0,0.25);
  max-height: 70px;
}

/* Footer */
.nc-footer {
  padding: 10px 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Modal */
.nc-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.nc-modal-content input[type="text"],
.nc-modal-content input[type="email"],
.nc-modal-content input[type="number"],
.nc-modal-content input[type="date"],
.nc-modal-content select {
  width: 100%;
  margin-bottom: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-body);
  color: var(--text-main);
  font-size: 13px;
}
