/* ============================
   Noctra - Base Styles
   ============================ */

:root {
  --bg-primary: #050507;
  --bg-secondary: #0B0E14;
  --bg-card: #121826;

  --color-primary: #7C5CFF;
  --color-primary-hover: #9B7CFF;

  --text-primary: #E6E8EE;
  --text-secondary: #9AA0B3;

  --border-color: #1E2333;
  --danger: #FF5C7C;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* ============================
   Reset & Base
   ============================ */

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

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top,
      #0B0E14,
      #050507 60%);
  color: var(--text-primary);
  line-height: 1.5;
}

/* ============================
   Links
   ============================ */

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-hover);
}

/* ============================
   Buttons
   ============================ */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.25s ease;
}

.button-primary {
  background: var(--color-primary);
  color: #fff;
}

.button-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
  color: #fff;
}

.button-primary:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.button-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff;
}

.button-danger {
  background: var(--danger) !important;
  color: #fff !important;
}

.button-danger:hover {
  background: #ff7c96;
  box-shadow: 0 8px 24px rgba(255, 92, 124, 0.35);
  color: #fff;
}

.button-google {
  background: #ffffff !important;
  color: #1f1f1f !important;
  border: 1px solid #dadce0 !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

.button-google:hover {
  background: #ffffff !important;
  color: #1f1f1f !important;
  border-color: #c7c9cc !important;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25), 0 2px 6px rgba(60, 64, 67, 0.15);
  transform: translateY(-1px);
}

.button-google:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 2px rgba(60, 64, 67, 0.2);
}

.button-google .google-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-google .google-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ============================
   Inputs
   ============================ */

input {
  width: 100%;
  padding: 0.7rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  outline: none;
  transition: border 0.2s ease;
  position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

input::placeholder {
  color: var(--text-secondary);
}

input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.15);
}

select option {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

/* ============================
   Checkboxes
   ============================ */

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input[type="checkbox"]:checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

input[type="checkbox"]:checked::after {
  content: '';
  width: 10px;
  height: 5px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px) translateX(0.5px);
}

input[type="checkbox"]:hover {
  border-color: var(--color-primary);
}

/* ============================
   Select
   ============================ */
.select {
  position: relative;
  display: block;
  width: 100%;
}

/* Hard-reset Bulma and other frameworks arrows */
.select::after,
.select-sm::after,
.select::before,
.select-sm::before,
.select:after,
.select-sm:after,
.select:before,
.select-sm:before {
  display: none !important;
  content: none !important;
}

.select select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 36px 8px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239AA0B3' d='M6 8.8L1.2 4h9.6L6 8.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px;
}

.select select:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background-color: rgba(124, 92, 255, 0.08);
}

.select select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
  background-color: rgba(0, 0, 0, 0.4);
}

.select-sm select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 5px 28px 5px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.25s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239AA0B3' d='M6 8.8L1.2 4h9.6L6 8.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.select-sm select:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background-color: rgba(124, 92, 255, 0.08);
}

.select select::-ms-expand,
.select-sm select::-ms-expand {
  display: none;
}

.select-sm select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
  background-color: rgba(0, 0, 0, 0.4);
}

/* ============================
   Cards
   ============================ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-color);
}

/* ============================
   App Layout
   ============================ */

.app-body {
  height: 100vh;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ============================
   Main / Topbar
   ============================ */

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;

  transition:
    transform 0.45s cubic-bezier(.22, 1, .36, 1);

  transform: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;

  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 24px 0 32px;

  background: linear-gradient(to bottom,
      rgba(11, 14, 20, 0.85),
      rgba(11, 14, 20, 0.65));

  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 35, 51, 0.6);
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  margin-left: 22px;
  margin-top: 5px;

  transition:
    padding-left 0.35s cubic-bezier(.4, 0, .2, 1),
    background 0.35s ease,
    box-shadow 0.35s ease,
    margin-left 0.35s cubic-bezier(.22, 1, .36, 1);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.plan-badge .plan-name {
  color: #fff;
  font-weight: 600;
}

.plan-badge .plan-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  color: #fff;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-badge .plan-date {
  color: var(--text-secondary);
}

.plan-badge .plan-cta {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  border: 1px solid rgba(124, 92, 255, 0.35);
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
}

.plan-badge .plan-cta:hover {
  background: rgba(124, 92, 255, 0.35);
  color: #fff;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 6px 12px;
  border-radius: 999px;

  background: rgba(124, 92, 255, .08);
  border: 1px solid rgba(124, 92, 255, .18);

  font-size: .9rem;
  color: #E6E8EE;
}

.user-badge-link:hover {
  color: #fff;
  border-color: rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.16);
}

.user-name-link {
  color: var(--text-secondary);
}

.user-name-link:hover {
  color: #fff;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7C5CFF, #9B7CFF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .75rem;
  color: #fff;
}

.logout-button {
  background: none;
  border: none;
  color: #9AA0B3;
  font-size: .85rem;
  cursor: pointer;
  margin-right: 25px;
  transition: color .2s ease, transform .2s ease;
}

.logout-button:hover {
  color: #7C5CFF;
  transform: translateY(-1px);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right,
      transparent,
      rgba(124, 92, 255, .25),
      transparent);
}

.user-name {
  color: var(--text-secondary);
}

/* ============================
   Content
   ============================ */

.app-content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

.app-content:hover~.topbar {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.45);
}

.hamburger-btn {
  display: none;
}

.sidebar-overlay {
  display: none;
}

.mobile-only {
  display: none;
}

.topbar-center {
  display: none;
}

.topbar-logo {
  height: 26px;
  width: auto;
  display: block;
}

.topbar-logo-link {
  display: inline-flex;
  align-items: center;
}

.user-name-mobile {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.section-card {
  background: #121826;
  border: 1px solid #1E2333;
  border-radius: 14px;
  padding: 24px;
}

.container-header {
  background: linear-gradient(135deg,
      rgba(30, 35, 51, .9),
      rgba(18, 24, 38, .9));
  border-radius: 18px;
  padding: 28px 32px;
  max-width: 1100px;
  margin-left: 0;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 20px 40px rgba(0, 0, 0, 0.35);
}

.container-header .title {
  font-size: 1.6rem;
  font-weight: 600;
}

.container-header .subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: 4px;
}

.kpi-delta {
  font-size: 0.8rem;
  margin-top: 6px;
}

.kpi-delta.positive {
  color: #2ECC71;
}

.label {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity .25s ease,
    transform .25s ease;
}

/* ================================
   Noctra Custom Scrollbar
   ================================ */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #7C5CFF transparent;
}

/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,
      rgba(124, 92, 255, 0.9),
      rgba(90, 62, 220, 0.9));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Hover suave */
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg,
      #9B7CFF,
      #7C5CFF);
}

/* Estado ativo (drag) */
::-webkit-scrollbar-thumb:active {
  background: #5A3EDC;
}

/* Remove botões (setinhas antigas) */
::-webkit-scrollbar-button {
  display: none;
}

body::-webkit-scrollbar {
  display: none;
}

/* ============================
   Noctra Confirm
   ============================ */

.noctra-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.noctra-confirm-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.noctra-confirm-modal {
  width: 420px;
  max-width: calc(100vw - 32px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(160deg, rgba(18, 24, 38, 0.98), rgba(11, 14, 20, 0.98));
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}

.noctra-confirm-overlay.open .noctra-confirm-modal {
  transform: translateY(0) scale(1);
}

.noctra-confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-secondary);
  cursor: pointer;
}

.noctra-confirm-close:hover {
  color: #fff;
  border-color: rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.16);
}

.noctra-confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--color-primary);
  background: rgba(124, 92, 255, 0.12);
}

.noctra-confirm-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.8;
}

.noctra-confirm-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.noctra-confirm-message {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.noctra-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.noctra-confirm-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.noctra-confirm-btn.cancel {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}

.noctra-confirm-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.noctra-confirm-btn.confirm {
  background: rgba(124, 92, 255, 0.9);
  color: #fff;
  border-color: rgba(124, 92, 255, 0.6);
}

.noctra-confirm-btn.confirm:hover {
  background: rgba(124, 92, 255, 1);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35);
}

.noctra-confirm-btn.danger {
  background: rgba(255, 92, 124, 0.9);
  border-color: rgba(255, 92, 124, 0.6);
}

.noctra-confirm-btn.danger:hover {
  background: rgba(255, 92, 124, 1);
  box-shadow: 0 8px 24px rgba(255, 92, 124, 0.35);
}
/* ============================
   Noctra Datepicker
   ============================ */

.noctra-datepicker {
  position: absolute;
  z-index: 9999;
  width: 280px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(124, 92, 255, 0.22);
  background: linear-gradient(160deg, rgba(18, 24, 38, 0.98), rgba(11, 14, 20, 0.98));
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.noctra-datepicker.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ndp-header {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ndp-month-label {
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  text-transform: capitalize;
}

.ndp-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ndp-nav:hover {
  background: rgba(124, 92, 255, 0.18);
  border-color: rgba(124, 92, 255, 0.35);
}

.ndp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ndp-weekdays span {
  text-align: center;
}

.ndp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.ndp-day {
  height: 32px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ndp-day:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background: rgba(124, 92, 255, 0.16);
}

.ndp-day.muted {
  color: rgba(154, 160, 179, 0.55);
  background: rgba(0, 0, 0, 0.18);
}

.ndp-day.today {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}

.ndp-day.selected {
  background: rgba(124, 92, 255, 0.35);
  border-color: rgba(124, 92, 255, 0.8);
  color: #fff;
}
