/* Shared styles for Dashboard and CV Editor pages */
:root {
  --accent: #2ecc71;
  --muted: #6b7280;
  --card-bg: #ffffff;
}

body.light-version main {
  padding-bottom: 60px;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06)
}

.grid-2 {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  align-items: start
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px
}

.small {
  font-size: 0.9rem;
  color: var(--muted)
}

.muted {
  color: var(--muted)
}

.metrics {
  display: flex;
  gap: 14px
}

.metric {
  flex: 1;
  background: linear-gradient(180deg, #ffffff, #def7ff);
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #f0f6f0
}

.metric h3 {
  margin: 6px 0;
  color: #0f172a
}

.metric .small {
  color: var(--muted)
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px
}

.section-title h4 {
  margin: 0;
  font-size: 1.1rem
}

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: #f3f6f4;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  font-weight: 600
}

.btn.green-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(46, 204, 113, 0.12)
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px
}

.template-thumb {
  border: 1px solid #f0f3f2;
  border-radius: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #fbfbfb);
  text-align: center
}

.template-thumb h5 {
  margin: 6px 0;
  font-size: 0.95rem
}

.preview-pane {
  border: 1px solid #eef2f6;
  border-radius: 10px;
  min-height: 420px;
  overflow: auto;
  padding: 16px;
  background: #fff
}

.form-control {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e9eef0
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

.tone-group .btn {
  margin-right: 8px;
  margin-bottom: 8px
}

.keywords-chip {
  display: inline-block;
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 18px;
  margin: 4px;
  font-size: 0.85rem
}

/* Responsive */
@media (max-width:900px) {
  .grid-2 {
    grid-template-columns: 1fr
  }

  .templates-grid {
    grid-template-columns: repeat(2, 1fr)
  }

  .form-row {
    grid-template-columns: 1fr
  }
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff
}

.table th,
.table td {
  padding: 14px 12px;
  border-bottom: 1px solid #f1f5f7;
  text-align: left;
  vertical-align: middle
}

.table thead th {
  background: linear-gradient(180deg, #fbfdff, #f7fbf8);
  font-weight: 700;
  color: #0f172a;
  border-bottom: 2px solid #e6edf3
}

.table tbody tr:hover {
  background: #fbfbfe
}

.table .muted {
  color: var(--muted);
  font-size: 0.95rem
}

.table .actions {
  display: flex;
  gap: 8px
}

.table .actions .btn {
  padding: 6px 10px;
  font-size: 0.9rem;
  border-radius: 8px
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.8rem
}

.badge.green {
  background: #ecfdf3;
  color: #065f46
}

.badge.yellow {
  background: #fffbeb;
  color: #92400e
}

.badge.red {
  background: #fff1f2;
  color: #981b1b
}

/* Responsive table wrapper */
.table-responsive {
  overflow: auto;
  border-radius: 12px
}

/* Modal preview */
.cv-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200
}

.cv-modal {
  background: #fff;
  width: 92%;
  max-width: 980px;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.25);
  overflow: hidden
}

.cv-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f6f4
}

.cv-modal-body {
  padding: 18px;
  height: 70vh;
  overflow: auto;
  background: #fff
}

.cv-modal-footer {
  padding: 14px 18px;
  border-top: 1px solid #f1f6f4;
  text-align: right
}

.cv-modal-close {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer
}

/* Profile dropdown in header */
.profile-wrapper {
  position: relative;
  display: inline-block
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(180deg, #eefaf0, #e6f6ea);
  color: #064e2a;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  cursor: pointer
}

.profile-menu {
  position: absolute;
  right: 0;
  top: 52px;
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.08);
  min-width: 200px;
  z-index: 1300;
  padding: 10px;
  display: none
}

.profile-menu a,
.profile-menu button {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: #0f172a !important;
  border-radius: 8px;
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%
}

.profile-menu a:hover,
.profile-menu button:hover {
  background: #f6fbf8
}

.profile-menu .muted {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 10px
}

/* Small utilities */
.text-muted {
  color: var(--muted)
}

.center {
  display: flex;
  align-items: center;
  justify-content: center
}

.mb-2 {
  margin-bottom: 8px
}

.mt-2 {
  margin-top: 8px
}

.preview-pane h2 {
  font-size: 24px;
}