/* ============================================================
   GlowManager App – Stylesheet
   Design System: Elegant Minimalism, Rose/Mauve Palette
   ============================================================ */

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

:root {
  --c-primary:       #C4527A;
  --c-primary-dark:  #9B3D6B;
  --c-primary-light: #F9E4EC;
  --c-accent:        #E8A0B4;
  --c-dark:          #1A1028;
  --c-text:          #3D2B3D;
  --c-muted:         #7A6A7A;
  --c-bg:            #F7F5F9;
  --c-white:         #FFFFFF;
  --c-border:        #EDE0EA;
  --c-success:       #22C55E;
  --c-success-bg:    #DCFCE7;
  --c-danger:        #EF4444;
  --c-danger-bg:     #FEE2E2;
  --c-warning:       #F59E0B;
  --c-warning-bg:    #FEF3C7;
  --c-info:          #3B82F6;
  --c-info-bg:       #DBEAFE;

  --sidebar-w:       240px;
  --header-h:        64px;
  --radius-sm:       8px;
  --radius-md:       12px;
  --radius-lg:       20px;
  --shadow-sm:       0 1px 4px rgba(0,0,0,.07);
  --shadow-md:       0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:       0 8px 32px rgba(0,0,0,.14);
  --font-display:    'Playfair Display', Georgia, serif;
  --font-body:       'Inter', system-ui, sans-serif;
  --transition:      .18s ease;
}

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrap { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--c-dark); min-height: 100vh;
  position: fixed; left: 0; top: 0; z-index: 50;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.sidebar__logo {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 18px;
  font-family: var(--font-display); font-size: 20px;
  color: #fff; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.sidebar__logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar__nav { padding: 14px 12px; flex: 1; }
.sidebar__section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.3);
  padding: 14px 8px 6px;
}
.sidebar__link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.65);
  text-decoration: none; transition: all var(--transition);
  margin-bottom: 2px;
}
.sidebar__link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar__link.active { background: rgba(196,82,122,.25); color: #fff; }
.sidebar__link.active .sidebar__icon { color: var(--c-accent); }
.sidebar__icon { width: 18px; flex-shrink: 0; opacity: .8; }
.sidebar__badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--c-primary); color: #fff;
  padding: 2px 7px; border-radius: 100px;
}
.sidebar__lock {
  opacity: .4; font-size: 12px; margin-left: auto;
}
.sidebar__bottom {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: var(--radius-sm);
}
.sidebar__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary-light), var(--c-accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: var(--c-primary-dark);
  flex-shrink: 0;
}
.sidebar__user-name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar__user-plan { font-size: 11px; color: rgba(255,255,255,.45); }

/* ── Main ────────────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
  min-height: 100vh;
}
.app-header {
  height: var(--header-h);
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 40;
  box-shadow: var(--shadow-sm);
}
.app-header__title { font-size: 18px; font-weight: 700; color: var(--c-dark); }
.app-header__right { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; gap: 6px; }
.lang-switch a {
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: 100px; text-decoration: none;
  color: var(--c-muted); border: 1px solid var(--c-border);
  transition: all var(--transition);
}
.lang-switch a.active, .lang-switch a:hover {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.header-logout {
  font-size: 13px; color: var(--c-muted); text-decoration: none;
  font-weight: 500; transition: color var(--transition);
}
.header-logout:hover { color: var(--c-danger); }

.page-content { padding: 28px; flex: 1; }

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header__title {
  font-size: 24px; font-weight: 700; color: var(--c-dark);
}
.page-header__sub { font-size: 14px; color: var(--c-muted); margin-top: 2px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--c-white); border-radius: var(--radius-md);
  border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header__title { font-size: 15px; font-weight: 700; color: var(--c-dark); }

/* ── Stat Cards ──────────────────────────────────────────────── */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--c-white); border-radius: var(--radius-md);
  padding: 20px; border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
}
.stat-card__label { font-size: 13px; color: var(--c-muted); font-weight: 500; margin-bottom: 8px; }
.stat-card__value {
  font-size: 28px; font-weight: 700; color: var(--c-dark);
  line-height: 1; margin-bottom: 6px;
}
.stat-card__icon {
  position: absolute; top: 18px; right: 18px;
  font-size: 24px; opacity: .15;
}
.stat-card__sub { font-size: 12px; color: var(--c-muted); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 14px; padding: 9px 18px; border: none; cursor: pointer;
  transition: all var(--transition); text-decoration: none;
  white-space: nowrap; line-height: 1;
}
.btn:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.btn--primary {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; box-shadow: var(--shadow-sm);
}
.btn--primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn--secondary { background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border); }
.btn--secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--danger:hover { opacity: .88; }
.btn--ghost { background: transparent; color: var(--c-muted); }
.btn--ghost:hover { color: var(--c-primary); background: var(--c-primary-light); }
.btn--sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn--icon { padding: 8px; border-radius: 6px; }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--c-dark);
  margin-bottom: 6px;
}
.form-label span { color: var(--c-danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font-body);
  color: var(--c-text); background: var(--c-white); transition: border-color var(--transition);
  line-height: 1.5;
}
.form-control:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(196,82,122,.12); }
.form-control::placeholder { color: var(--c-muted); }
.form-control:disabled { background: var(--c-bg); opacity: .6; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--c-danger); margin-top: 4px; }
.form-row { display: grid; gap: 16px; }
.form-row--2 { grid-template-columns: 1fr 1fr; }
.form-row--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Table ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; padding: 10px 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--c-muted);
  border-bottom: 1.5px solid var(--c-border); background: var(--c-bg);
}
tbody td {
  padding: 13px 16px; border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FCF9FB; }

/* ── Badges / Pills ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.badge--success { background: var(--c-success-bg); color: #15803D; }
.badge--danger  { background: var(--c-danger-bg);  color: #B91C1C; }
.badge--warning { background: var(--c-warning-bg); color: #92400E; }
.badge--info    { background: var(--c-info-bg);    color: #1D4ED8; }
.badge--muted   { background: var(--c-bg);         color: var(--c-muted); border: 1px solid var(--c-border); }

/* ── Alerts / Flash ──────────────────────────────────────────── */
.alert {
  padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px;
}
.alert--success { background: var(--c-success-bg); color: #15803D; border: 1px solid #BBF7D0; }
.alert--danger  { background: var(--c-danger-bg);  color: #B91C1C; border: 1px solid #FECACA; }
.alert--warning { background: var(--c-warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.alert--info    { background: var(--c-info-bg);    color: #1D4ED8; border: 1px solid #BFDBFE; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,16,40,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(3px);
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--c-white); border-radius: var(--radius-lg);
  width: 90%; max-width: 560px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--c-dark); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--c-border);
  display: flex; gap: 10px; justify-content: flex-end;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 24px; color: var(--c-muted);
}
.empty-state__icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state__title { font-size: 17px; font-weight: 700; color: var(--c-dark); margin-bottom: 8px; }
.empty-state__text  { font-size: 14px; margin-bottom: 20px; }

/* ── Plan Lock Banner ────────────────────────────────────────── */
.plan-lock {
  background: linear-gradient(135deg, var(--c-primary-light), #FFF);
  border: 1.5px solid var(--c-accent); border-radius: var(--radius-md);
  padding: 28px; text-align: center; margin: 24px 0;
}
.plan-lock__title { font-size: 18px; font-weight: 700; color: var(--c-dark); margin-bottom: 8px; }
.plan-lock__text  { font-size: 14px; color: var(--c-muted); margin-bottom: 18px; }

/* ── Trial Banner ────────────────────────────────────────────── */
.trial-banner {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; padding: 10px 28px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  text-align: center;
}
.trial-banner a { color: #fff; font-weight: 700; text-decoration: underline; }

/* ── Utilities ───────────────────────────────────────────────── */
.text-muted  { color: var(--c-muted); }
.text-danger { color: var(--c-danger); }
.text-success{ color: var(--c-success); }
.text-sm     { font-size: 13px; }
.font-bold   { font-weight: 700; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Auth Pages ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #FFF7FB 0%, var(--c-bg) 100%);
  padding: 24px;
}
.auth-card {
  background: var(--c-white); border-radius: var(--radius-lg);
  padding: 40px; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--c-border);
}
.auth-logo {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-size: 22px; color: var(--c-primary);
  font-weight: 700; margin-bottom: 28px;
}
.auth-title { font-size: 22px; font-weight: 700; color: var(--c-dark); margin-bottom: 6px; }
.auth-sub   { font-size: 14px; color: var(--c-muted); margin-bottom: 24px; }
.auth-divider { text-align: center; color: var(--c-muted); font-size: 13px; margin: 18px 0; }
.auth-switch  { text-align: center; font-size: 14px; color: var(--c-muted); margin-top: 22px; }
.auth-switch a { color: var(--c-primary); font-weight: 600; text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .page-content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row--2, .form-row--3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
