:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f7f6f3;
  --ink: #37352f;
  --muted: #787774;
  --line: #e9e9e7;
  --green: #548164;
  --green-dark: #486a55;
  --blue: #487ca5;
  --red: #c4554d;
  --yellow: #c29343;
  --purple: #7c3aed;
  --orange: #ea580c;
  --shadow: none;
  --hover: rgba(55, 53, 47, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  background: var(--panel-soft);
  color: var(--ink);
}

button:hover {
  background: var(--hover);
}

.install-button {
  margin-left: auto;
  background: var(--blue);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  min-width: 140px;
}

.install-button:hover {
  background: #3d6a89;
}

input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  width: 100%;
  background: var(--panel);
}

.tag-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
}

.topic-chip span {
  display: inline-block;
  font-weight: 700;
}

.tag-list .empty-state {
  margin: 0;
  padding: 0;
  background: none;
}

.app-header {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  max-width: 720px;
  font-size: 2.7rem;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.today-box {
  min-width: 138px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: right;
}

.today-box span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.today-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1.45rem;
}

.app-shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  padding: 0;
  margin: 0;
}

.tab-button {
  flex: 1;
  padding: 16px;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  border-radius: 0;
  text-align: center;
}

.tab-button.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.tab-button:hover {
  background: var(--hover);
}

.tab-panel {
  display: none;
  padding: 24px;
}

.tab-panel.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 20px;
}

.section-heading > div:first-child {
  flex: 1;
}

.summary-pill {
  background: var(--panel-soft);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.entry-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  padding: 20px;
  background: var(--panel-soft);
  border-radius: 8px;
  margin-bottom: 24px;
}

.entry-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry-form button {
  grid-column: 1 / -1;
  padding: 12px;
  background: var(--green);
  color: white;
  font-weight: 600;
}

.entry-form button:hover {
  background: var(--green-dark);
}

.days-field {
  grid-column: 1 / -1;
  border: none;
  padding: 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.day-option {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.day-option input {
  width: auto;
  border: none;
  padding: 0;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.item-time {
  font-weight: 600;
  color: var(--blue);
  min-width: 60px;
}

.item-title {
  margin: 0 0 4px;
  font-weight: 600;
}

.item-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.routine-days {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 4px;
}

.item-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.status-button {
  padding: 6px 12px;
  font-size: 0.85rem;
  background: white;
  border: 1px solid var(--line);
}

.status-button.active[data-status="done"] {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.status-button.active[data-status="doing"] {
  background: var(--yellow);
  color: white;
  border-color: var(--yellow);
}

.status-button.active[data-status="todo"] {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: transparent;
  border: 1px solid var(--line);
}

.icon-button.delete:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

.icon-button.edit:hover {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 20px;
}

.calendar-header > div:first-child {
  flex: 1;
}

.calendar-actions {
  display: flex;
  gap: 8px;
}

.secondary-button {
  padding: 8px 16px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.secondary-button:hover {
  background: var(--hover);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
  font-size: 0.9rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  cursor: pointer;
  font-size: 0.9rem;
}

.calendar-day.other-month {
  color: var(--muted);
  opacity: 0.5;
}

.calendar-day.today {
  background: var(--green);
  color: white;
  font-weight: 600;
}

.calendar-day.selected {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.calendar-day-number {
  width: 100%;
  text-align: left;
  font-weight: 600;
}

.calendar-day-tasks {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  width: 100%;
  text-align: left;
}

.calendar-day-tasks span {
  display: block;
  background: rgba(72, 124, 165, 0.12);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: var(--blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-detail {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
}

.calendar-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 16px;
}

.calendar-detail .calendar-day-tasks {
  display: grid;
  gap: 8px;
}

.calendar-day-detail-list {
  display: grid;
  gap: 12px;
}

.routine-detail-item {
  padding: 16px;
  border-radius: 12px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.detail-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.detail-item-meta,
.detail-item-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.routine-item.highlighted {
  box-shadow: inset 3px 0 0 var(--blue);
}

.subject-item .edit {
  margin-right: 8px;
}

.money-grid, .stats-grid, .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.money-card, .stat-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: center;
}

.money-card span, .stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.money-card strong, .stat-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.money-card.income {
  border-left: 4px solid var(--green);
}

.money-card.expense {
  border-left: 4px solid var(--red);
}

.money-card.fixed {
  border-left: 4px solid var(--yellow);
}

.money-card.saved {
  border-left: 4px solid var(--blue);
}

.money-card.receivable {
  border-left: 4px solid var(--purple);
}

.money-card.balance {
  border-left: 4px solid var(--orange);
}

.timer-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  background: var(--panel-soft);
  border-radius: 8px;
  margin-bottom: 24px;
}

.timer-display {
  font-size: 3rem;
  font-weight: 700;
  font-family: monospace;
  margin: 20px 0;
}

.timer-target {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.timer-controls {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.control-button {
  padding: 12px;
  font-weight: 600;
}

.control-button.start {
  background: var(--green);
  color: white;
}

.control-button.pause {
  background: var(--yellow);
  color: white;
}

.control-button.save {
  background: var(--blue);
  color: white;
}

.control-button.reset {
  background: var(--red);
  color: white;
}

.finance-type {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.finance-type.income {
  background: var(--green);
  color: white;
}

.finance-type.expense {
  background: var(--red);
  color: white;
}

.finance-type.fixed {
  background: var(--yellow);
  color: white;
}

.finance-item strong {
  margin-left: auto;
  font-weight: 700;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.subject-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.study-chart-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.chart-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
}

.chart-card h4 {
  margin: 0 0 16px;
  font-size: 1rem;
}

.chart-bars {
  display: grid;
  gap: 14px;
}

.bar-item {
  display: grid;
  gap: 8px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-size: 0.9rem;
}

.bar-fill {
  height: 14px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: 999px;
  min-width: 4%;
}

.list-title {
  margin: 24px 0 12px;
  font-size: 1.1rem;
  font-weight: 600;
}

.list-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 12px;
  flex-wrap: wrap;
}

.list-toolbar .list-title {
  margin: 0;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.filter-control select {
  min-width: 180px;
}

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* ===== RESPONSIVO ===== */

/* Tablet: 481px até 1024px */
@media (max-width: 1024px) {
  .app-header {
    width: calc(100% - 24px);
    padding: 32px 0 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .today-box {
    align-self: flex-end;
  }

  .app-shell {
    width: calc(100% - 24px);
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .tab-button {
    flex: 1 1 auto;
    min-width: 100px;
  }

  .entry-form {
    grid-template-columns: 1fr;
  }

  .timer-panel {
    grid-template-columns: 1fr;
  }

  .money-grid, .stats-grid, .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .item {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .calendar-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-actions {
    width: 100%;
  }

  .secondary-button {
    flex: 1;
  }
}

/* Celular: até 480px */
@media (max-width: 480px) {
  :root {
    font-size: 14px;
  }

  .app-header {
    width: calc(100% - 16px);
    padding: 20px 0 12px;
    margin: 0 auto;
    padding-left: 8px;
    padding-right: 8px;
  }

  .eyebrow {
    font-size: 0.7rem;
  }

  h1 {
    font-size: 1.4rem;
    max-width: 100%;
  }

  h2 {
    font-size: 1.1rem;
  }

  h3 {
    font-size: 1rem;
  }

  .today-box {
    min-width: auto;
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .today-box strong {
    font-size: 1.2rem;
  }

  .app-shell {
    width: calc(100% - 16px);
    margin: 0 auto 20px;
  }

  .tab-button {
    padding: 12px 8px;
    font-size: 0.75rem;
  }

  .tab-panel {
    padding: 12px;
  }

  .section-heading {
    gap: 8px;
  }

  .summary-pill {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .entry-form {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .entry-form label {
    gap: 4px;
  }

  .entry-form button {
    padding: 10px;
    font-size: 0.9rem;
  }

  input, select, textarea {
    padding: 6px 8px;
    font-size: 16px;
  }

  .days-field {
    padding: 8px;
    gap: 8px;
  }

  .day-option {
    font-size: 0.85rem;
  }

  .item {
    padding: 12px;
    gap: 8px;
    flex-direction: column;
  }

  .item-time {
    min-width: auto;
  }

  .item-title {
    font-size: 0.95rem;
  }

  .item-meta {
    font-size: 0.8rem;
  }

  .routine-days {
    font-size: 0.8rem;
  }

  .item-actions {
    width: 100%;
    margin-left: 0;
    gap: 6px;
  }

  .status-button {
    padding: 5px 8px;
    font-size: 0.75rem;
    flex: 1;
  }

  .icon-button {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }

  .money-grid, .stats-grid, .card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .money-card, .stat-card {
    padding: 16px;
  }

  .money-card span, .stat-card span {
    font-size: 0.8rem;
  }

  .money-card strong, .stat-card strong {
    font-size: 1.3rem;
  }

  .timer-panel {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 12px;
  }

  .timer-display {
    font-size: 2rem;
    margin: 12px 0;
  }

  .timer-controls {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .control-button {
    padding: 8px;
    font-size: 0.8rem;
  }

  .calendar-header {
    gap: 8px;
    padding: 0;
  }

  .calendar-header > div:first-child {
    width: 100%;
  }

  .calendar-actions {
    width: 100%;
    gap: 4px;
  }

  .secondary-button {
    padding: 6px 8px;
    font-size: 0.75rem;
    flex: 1;
  }

  .calendar-grid, .calendar-weekdays {
    gap: 4px;
  }

  .calendar-day {
    font-size: 0.8rem;
  }

  .finance-type {
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  .finance-item strong {
    margin-left: auto;
    font-size: 0.95rem;
  }

  .breakdown-item {
    gap: 8px;
  }

  .list-title {
    margin: 16px 0 8px;
    font-size: 1rem;
  }

  .empty-state {
    padding: 20px;
    font-size: 0.9rem;
  }

  .subject-item {
    gap: 4px;
  }

  .breakdown-list {
    gap: 8px;
    margin-bottom: 16px;
  }
}

/* ===== AUTENTICAÇÃO ===== */

.app-wrapper {
  display: block;
}

.auth-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--green), var(--blue));
  z-index: 1000;
}

.auth-container.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-screen {
  display: none;
  animation: slideIn 0.3s ease-out;
}

.auth-screen.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-box {
  background: white;
  border-radius: 12px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header h1 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--muted);
  margin: 0;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label span {
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-form input {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(84, 129, 100, 0.1);
}

.primary-button {
  padding: 12px;
  background: var(--green);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 8px;
}

.primary-button:hover {
  background: var(--green-dark);
}

.auth-link {
  text-align: center;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-link a {
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.auth-link a:hover {
  text-decoration: underline;
}

.form-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.hidden {
  display: none !important;
}

.features {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  text-align: left;
}

.features li {
  padding: 8px 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.error-message {
  padding: 12px;
  background: #fee;
  color: var(--red);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid var(--red);
}

.success-message {
  padding: 12px;
  background: #e8f5e9;
  color: var(--green);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid var(--green);
}

#logoutButton {
  margin-left: auto;
  background: var(--red);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  min-width: 100px;
}

#logoutButton:hover {
  background: #a04540;
}

/* ===== MENU DE USUÁRIO ===== */

.user-menu-container {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-menu-button:hover {
  background: var(--hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.user-name {
  font-weight: 600;
  color: var(--ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  z-index: 100;
  min-width: 200px;
  margin-top: 8px;
}

.user-menu-dropdown.active {
  display: block;
}

.menu-header {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-header strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.menu-header small {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 0;
}

.menu-item {
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  transition: background 0.2s ease;
}

.menu-item:hover {
  background: var(--panel-soft);
}

.menu-item span {
  font-size: 1.1rem;
}

.menu-item.logout {
  color: var(--red);
}

.menu-item.logout:hover {
  background: #fee;
}

/* ===== MODAIS ===== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.4rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--panel-soft);
  border-radius: 6px;
}

.modal-body {
  padding: 24px;
}

.profile-info {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-details {
  flex: 1;
  min-width: 250px;
}

.profile-details label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}

.profile-details input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  font-size: 0.95rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.status-badge.paid {
  background: #e8f5e9;
  color: var(--green);
}

.status-badge.trial {
  background: #fff3e0;
  color: var(--yellow);
}

.status-badge.expired {
  background: #fee;
  color: var(--red);
}

.upgrade-button {
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

.upgrade-button:hover {
  background: var(--green-dark);
}

/* Responsivo Menu */
@media (max-width: 1024px) {
  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .user-name {
    display: none;
  }

  .user-menu-button {
    padding: 8px;
  }
}

/* Responsivo Auth */
@media (max-width: 480px) {
  .auth-box {
    padding: 24px;
    margin: 16px;
  }

  .auth-header h1 {
    font-size: 1.4rem;
  }

  .price .amount {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
  
  #logoutButton {
    width: 100%;
    margin-left: 0;
  }
}
