/* ===== VellumCadence Client Portal ===== */

:root {
  --bg:        #08080f;
  --surface:   #0d0d18;
  --surface2:  #13131f;
  --border:    rgba(255,255,255,0.08);
  --border-hi: rgba(255,255,255,0.15);
  --text:      #ffffff;
  --text-dim:  rgba(255,255,255,0.6);
  --text-muted:rgba(255,255,255,0.35);
  --accent:    #8b5cf6;
  --accent2:   #06b6d4;
  --accent3:   #ec4899;
  --green:     #22c55e;
  --yellow:    #f59e0b;
  --red:       #ef4444;
  --gradient:  linear-gradient(135deg, #8b5cf6, #06b6d4);
  --font:      'Inter', -apple-system, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --sidebar-w: 240px;
  --radius:    14px;
  --radius-sm: 8px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: var(--font); cursor: pointer; }
input, textarea, select { font-family: var(--font); }

/* ===== VIEW TRANSITIONS ===== */
@supports (view-transition-name: none) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation-duration: 0.22s;
    animation-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
  }
  .section.active { view-transition-name: portal-section; }
}

/* ===== LAYOUT ===== */
.portal-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 20px 20px;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.logo-mark {
  width: 30px; height: 30px;
  background: var(--gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.logo-accent { color: var(--accent); }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  position: relative;
  text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}
.nav-item.active {
  background: rgba(139,92,246,0.15);
  color: #fff;
}
.nav-item.active svg { stroke: var(--accent); }
.nav-item svg { flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.nav-item.active svg, .nav-item:hover svg { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--yellow);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  font-family: var(--mono);
}
.nav-dot {
  width: 7px; height: 7px;
  background: var(--accent2);
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-user {
  padding: 16px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}
.user-name { font-size: 0.82rem; font-weight: 600; }
.user-plan { font-size: 0.72rem; color: var(--accent); font-family: var(--mono); }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 200;
}
.mobile-burger {
  background: none; border: none;
  display: flex; flex-direction: column; gap: 4px;
  padding: 4px;
}
.mobile-burger span {
  display: block; width: 20px; height: 2px;
  background: var(--text-dim);
  border-radius: 2px;
  transition: all 0.25s;
}
.mobile-logo { font-weight: 700; font-size: 0.9rem; }
.mobile-avatar {
  width: 30px; height: 30px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 90;
  backdrop-filter: blur(2px);
}

/* ===== MAIN CONTENT ===== */
.portal-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  padding: 40px 48px 80px;
  max-width: calc(100vw - var(--sidebar-w));
}

/* ===== SECTIONS ===== */
.section { display: none; }
.section.active { display: block; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--mono);
}
.subsection-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--text-dim);
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.card-title { font-size: 0.9rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.card-link { font-size: 0.82rem; color: var(--accent); font-weight: 600; }
.card-link:hover { text-decoration: underline; }

/* ===== DASHBOARD ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 8px; font-family: var(--mono); }
.stat-of { font-size: 1rem; color: var(--text-dim); font-weight: 500; }
.stat-hint { font-size: 0.75rem; color: var(--text-muted); }
.stat-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-bottom: 6px; }
.stat-fill { height: 100%; background: var(--gradient); border-radius: 2px; }

.stat-green .stat-value { color: var(--green); }
.stat-yellow .stat-value { color: var(--yellow); }
.stat-cyan .stat-value { color: var(--accent2); }

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* Upcoming list */
.upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.upcoming-item:last-child { border-bottom: none; }
.upcoming-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(6,182,212,0.3));
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--text-dim);
  font-family: var(--mono);
}
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-title { font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upcoming-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* Message preview */
.msg-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg-prev-item { display: flex; gap: 10px; }
.msg-prev-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gradient); display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.msg-prev-avatar.client-av { background: rgba(255,255,255,0.1); }
.msg-prev-body { flex: 1; }
.msg-prev-name { font-size: 0.72rem; font-weight: 700; color: var(--text-dim); margin-bottom: 2px; }
.msg-prev-text { font-size: 0.82rem; color: var(--text-dim); line-height: 1.4; }

/* Renewal card */
.renewal-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(6,182,212,0.08));
  border-color: rgba(139,92,246,0.3);
}
.renewal-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.renewal-date { font-size: 1.1rem; font-weight: 700; }
.renewal-right { text-align: right; }
.renewal-pkg { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 4px; }
.renewal-price { font-size: 1.3rem; font-weight: 800; font-family: var(--mono); color: var(--accent); }

/* ===== CONTENT GRID ===== */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}
.filter-tab {
  background: none; border: none;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.2s, color 0.2s;
  display: flex; align-items: center; gap: 6px;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active { background: rgba(139,92,246,0.2); color: #fff; }
.tab-count {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.1);
  padding: 1px 6px;
  border-radius: 20px;
  font-family: var(--mono);
}
.filter-tab.active .tab-count { background: rgba(139,92,246,0.3); }

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.content-card:hover { border-color: var(--border-hi); transform: translateY(-2px); }

.content-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.1em;
  position: relative;
  overflow: hidden;
}
.content-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: inherit;
  filter: brightness(0.8);
}

.content-body { padding: 14px; }
.content-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.content-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; flex: 1; margin-right: 8px; }
.content-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.content-date { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }
.content-actions { display: flex; gap: 8px; }

/* badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.badge-review  { background: rgba(245,158,11,0.15); color: var(--yellow); border: 1px solid rgba(245,158,11,0.3); }
.badge-approved { background: rgba(34,197,94,0.15); color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-scheduled { background: rgba(6,182,212,0.15); color: var(--accent2); border: 1px solid rgba(6,182,212,0.3); }

.type-badge {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}
.type-reel { background: rgba(139,92,246,0.2); color: var(--accent); }
.type-carousel { background: rgba(6,182,212,0.2); color: var(--accent2); }
.type-visual { background: rgba(236,72,153,0.2); color: var(--accent3); }

/* platform badge */
.platform-badge {
  font-size: 0.68rem; color: var(--text-muted); font-family: var(--mono);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient);
  color: #fff;
}
.btn-primary:hover { opacity: 0.85; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text-dim);
}
.btn-outline:hover { border-color: var(--accent); color: var(--text); }
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-dim);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-approve {
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
  font-size: 0.75rem;
  padding: 6px 12px;
}
.btn-approve:hover { background: rgba(34,197,94,0.25); }
.btn-revision {
  background: rgba(245,158,11,0.1);
  color: var(--yellow);
  border: 1px solid rgba(245,158,11,0.2);
  font-size: 0.75rem;
  padding: 6px 12px;
}
.btn-revision:hover { background: rgba(245,158,11,0.2); }
.btn-send {
  background: var(--gradient);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.btn-send:hover { opacity: 0.85; }

/* ===== PACKAGE SECTION ===== */
.pkg-usage-card { margin-bottom: 8px; }
.pkg-usage-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
}
.pkg-usage-name { font-size: 1.2rem; font-weight: 800; }
.pkg-usage-desc { font-size: 0.8rem; color: var(--text-dim); margin-top: 4px; font-family: var(--mono); }
.pkg-usage-price { font-size: 1.5rem; font-weight: 800; font-family: var(--mono); color: var(--accent); }
.pkg-per { font-size: 0.8rem; color: var(--text-dim); font-weight: 400; }

.progress-bar-wrap { margin-bottom: 20px; }
.progress-labels {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; color: var(--text-dim);
  margin-bottom: 8px; font-family: var(--mono);
}
.progress-bar { height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; }
.progress-fill { height: 100%; background: var(--gradient); border-radius: 3px; transition: width 0.6s ease; }

.pkg-breakdown {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.breakdown-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem;
}
.breakdown-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-purple { background: var(--accent); }
.dot-cyan { background: var(--accent2); }
.dot-pink { background: var(--accent3); }
.breakdown-type { color: var(--text-dim); }
.breakdown-count { font-weight: 700; font-family: var(--mono); }
.breakdown-remaining { margin-left: auto; }
.breakdown-remaining .breakdown-count { color: var(--accent2); }

.packages-compare {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pkg-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
}
.pkg-current {
  border-color: rgba(139,92,246,0.5);
  background: rgba(139,92,246,0.07);
}
.pkg-badge {
  display: inline-block;
  background: var(--gradient);
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.pkg-card-name { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.pkg-card-price { font-size: 1.6rem; font-weight: 800; font-family: var(--mono); color: var(--accent); margin-bottom: 4px; }
.pkg-card-price span { font-size: 0.85rem; font-weight: 400; color: var(--text-dim); }
.pkg-card-units { font-size: 0.8rem; color: var(--text-dim); font-family: var(--mono); margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pkg-features { display: flex; flex-direction: column; gap: 8px; }
.pkg-features li {
  font-size: 0.82rem; color: var(--text-dim);
  padding-left: 14px; position: relative;
}
.pkg-features li::before {
  content: '—';
  position: absolute; left: 0;
  color: var(--accent);
}

/* ===== BRIEF ===== */
.brief-months {
  display: flex; gap: 8px; margin-bottom: 24px;
}
.brief-month-btn {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 0.82rem; font-weight: 600;
  padding: 8px 16px; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s;
}
.brief-month-btn.active {
  background: rgba(139,92,246,0.2);
  border-color: rgba(139,92,246,0.4);
  color: #fff;
}

.brief-form { display: flex; flex-direction: column; gap: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  resize: vertical;
  transition: border-color 0.2s;
  outline: none;
}
.form-input:focus { border-color: rgba(139,92,246,0.5); background: rgba(139,92,246,0.05); }
.form-input::placeholder { color: var(--text-muted); }
.form-select { -webkit-appearance: none; cursor: pointer; }

.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.form-hint { font-size: 0.8rem; color: var(--green); font-weight: 500; opacity: 0; transition: opacity 0.3s; }
.form-hint.visible { opacity: 1; }

/* ===== MESSAGES ===== */
.messages-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 500px;
  padding: 0;
  overflow: hidden;
}
.messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.messages-list::-webkit-scrollbar { width: 4px; }
.messages-list::-webkit-scrollbar-track { background: transparent; }
.messages-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.msg-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 75%;
}
.msg-bubble.from-client {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  flex-shrink: 0;
}
.msg-bubble.from-client .msg-avatar { background: rgba(255,255,255,0.1); }
.msg-content {}
.msg-name { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.msg-bubble.from-client .msg-name { text-align: right; }
.msg-text {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-dim);
}
.msg-bubble.from-client .msg-text {
  background: rgba(139,92,246,0.15);
  border-color: rgba(139,92,246,0.2);
  border-radius: 12px 12px 2px 12px;
  color: var(--text);
}
.msg-time { font-size: 0.67rem; color: var(--text-muted); margin-top: 4px; font-family: var(--mono); }
.msg-bubble.from-client .msg-time { text-align: right; }

.messages-input-row {
  display: flex; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.messages-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}
.messages-input:focus { border-color: rgba(139,92,246,0.5); }
.messages-input::placeholder { color: var(--text-muted); }

/* ===== CALENDAR ===== */
.calendar-month-label {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin-bottom: 12px; font-family: var(--mono);
  padding-top: 8px;
}
.calendar-month-label:first-child { padding-top: 0; }

.cal-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}
.cal-item:hover { border-color: var(--border-hi); }

.cal-date-block {
  text-align: center;
  min-width: 44px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 6px 8px;
  flex-shrink: 0;
}
.cal-day { font-size: 1.4rem; font-weight: 800; line-height: 1; font-family: var(--mono); }
.cal-weekday { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 2px; }

.cal-info { flex: 1; min-width: 0; }
.cal-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-meta { display: flex; align-items: center; gap: 8px; }
.cal-time { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }
.cal-platform { font-size: 0.72rem; color: var(--text-muted); }

.cal-status { flex-shrink: 0; }

/* ===== INVOICES ===== */
.invoice-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.inv-summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.inv-summary-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; }
.inv-summary-value { font-size: 1.4rem; font-weight: 800; font-family: var(--mono); }
.inv-summary-value.green { color: var(--green); }
.inv-summary-value.yellow { color: var(--yellow); }

.invoice-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.inv-table-header {
  display: grid;
  grid-template-columns: 100px 1fr 120px 100px 80px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); font-weight: 700;
}
.inv-row {
  display: grid;
  grid-template-columns: 100px 1fr 120px 100px 80px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.15s;
}
.inv-row:last-child { border-bottom: none; }
.inv-row:hover { background: rgba(255,255,255,0.02); }
.inv-id { font-size: 0.78rem; font-family: var(--mono); color: var(--text-dim); }
.inv-desc { font-size: 0.85rem; font-weight: 500; }
.inv-date { font-size: 0.78rem; color: var(--text-dim); font-family: var(--mono); }
.inv-amount { font-size: 0.9rem; font-weight: 700; font-family: var(--mono); }
.inv-actions { display: flex; justify-content: flex-end; }

.inv-status-paid { color: var(--green); }
.inv-status-upcoming { color: var(--yellow); }

.btn-pdf {
  font-size: 0.72rem; padding: 5px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-dim);
  cursor: pointer; transition: all 0.2s;
}
.btn-pdf:hover { background: rgba(255,255,255,0.1); color: var(--text); border-color: var(--border-hi); }

/* ===== SETTINGS ===== */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.toggle-list { display: flex; flex-direction: column; gap: 4px; }
.toggle-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.toggle-item:last-child { border-bottom: none; }
.toggle-label { font-size: 0.875rem; font-weight: 600; }
.toggle-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-track {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: rgba(139,92,246,0.4); border-color: rgba(139,92,246,0.5); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); background: var(--accent); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .packages-compare { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .invoice-summary { grid-template-columns: 1fr 1fr; }
  .inv-table-header,
  .inv-row { grid-template-columns: 80px 1fr 90px 80px; }
  .inv-table-header > :last-child,
  .inv-row > :last-child { display: none; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 150;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }

  .mobile-header { display: flex; }

  .portal-main {
    margin-left: 0;
    padding: 80px 16px 60px;
    max-width: 100vw;
  }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .content-grid { grid-template-columns: 1fr; }
  .invoice-summary { grid-template-columns: 1fr; }
  .inv-table-header { display: none; }
  .inv-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 16px; }
  .inv-row > * { display: block; }
  .inv-id { color: var(--text-muted); font-size: 0.7rem; }
  .renewal-card { flex-direction: column; gap: 12px; }
  .renewal-right { text-align: left; }
}
