/* ══════════════════════════════════════
   ERPro Console — Brand-matched styles
   ══════════════════════════════════════ */
:root {
  --sans: 'DM Sans', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --red: #C0272D;
  --red-d: #9B1B20;
  --red-l: #F87171;
  --red50: #FEF2F2;
  --green: #16A34A;
  --green50: #F0FDF4;
  --blue: #2563EB;
  --blue50: #EFF6FF;
  --g50: #F9FAFB;
  --g100: #F3F4F6;
  --g200: #E5E7EB;
  --g300: #D1D5DB;
  --g400: #9CA3AF;
  --g500: #6B7280;
  --g600: #4B5563;
  --g700: #374151;
  --g800: #1F2937;
  --g900: #111827;
  --g950: #030712;
  --sidebar-w: 240px;
  --r: 12px;
  --rl: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--sans);
  color: var(--g800);
  background: var(--g50);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

/* ═══ SIDEBAR ═══ */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--g950);
  color: rgba(255,255,255,.6);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  z-index: 100;
  border-right: 1px solid rgba(255,255,255,.06);
}

.sidebar__logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 0 8px;
  margin-bottom: 36px;
}
.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -.03em;
}
.logo-sub {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.35);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.5);
  transition: all .15s var(--ease);
}
.nav-item:hover {
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.05);
}
.nav-item--active {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.nav-item--active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 2px 2px 0;
  background: var(--red);
}

.sidebar__footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar__link {
  font-size: 12px;
  color: rgba(255,255,255,.3);
  padding: 4px 8px;
  transition: color .15s;
}
.sidebar__link:hover { color: rgba(255,255,255,.6); }

/* ═══ MAIN ═══ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 40px 48px;
  max-width: 1100px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--g900);
  letter-spacing: -.03em;
}
.page-subtitle {
  font-size: 15px;
  color: var(--g400);
  margin-top: 4px;
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--r);
  border: 1.5px solid var(--g200);
  background: #fff;
  color: var(--g700);
  cursor: pointer;
  transition: all .2s var(--ease);
}
.btn:hover {
  border-color: var(--g300);
  background: var(--g50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.04);
}
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--sm { padding: 8px 16px; font-size: 13px; }

.btn--primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn--primary:hover {
  background: var(--red-d);
  border-color: var(--red-d);
  box-shadow: 0 4px 16px rgba(192,39,45,.2);
}

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ CARDS ═══ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--rl);
  padding: 24px;
  transition: all .25s var(--ease);
}
.card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,.05);
  transform: translateY(-2px);
  border-color: var(--g300);
}

.card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--g100);
}
.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--g900);
}
.card__domain {
  font-size: 12px;
  color: var(--g400);
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card__label {
  font-size: 13px;
  color: var(--g400);
  font-weight: 500;
}
.card__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--g700);
}
.card__value--dim {
  font-weight: 400;
  color: var(--g400);
  font-size: 12px;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge--ok {
  background: #22c55e12;
  border: 1px solid #22c55e30;
  color: #16a34a;
}
.badge--err {
  background: #ef444412;
  border: 1px solid #ef444430;
  color: #ef4444;
}
.badge--loading {
  background: var(--g100);
  border: 1px solid var(--g200);
  color: var(--g400);
}
.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
.badge__dot--ok { background: #22c55e; }
.badge__dot--err { background: #ef4444; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.refresh-note {
  text-align: center;
  font-size: 12px;
  color: var(--g400);
  margin-top: 24px;
}

/* ═══ DOWNLOADS ═══ */
.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--g900);
  margin-bottom: 16px;
  letter-spacing: -.02em;
}

.download-section {
  margin-bottom: 40px;
}

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

.download-card {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--rl);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: all .25s var(--ease);
}
.download-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
  transform: translateY(-2px);
}
.download-card--unavailable {
  opacity: .5;
}

.download-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--g50);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--g500);
}
.download-card__platform {
  font-size: 16px;
  font-weight: 700;
  color: var(--g900);
}
.download-card__version {
  font-size: 13px;
  color: var(--g500);
  font-weight: 500;
}
.download-card__size {
  font-size: 12px;
  color: var(--g400);
}
.download-card__na {
  font-size: 13px;
  color: var(--g400);
  font-style: italic;
}
.download-card__btn {
  margin-top: 4px;
}
.download-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.release-notes {
  margin-top: 16px;
  padding: 16px 20px;
  background: var(--g50);
  border: 1px solid var(--g200);
  border-radius: var(--r);
}
.release-notes h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--g500);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.release-notes p {
  font-size: 14px;
  color: var(--g600);
  line-height: 1.7;
}

/* ═══ SUPPORT ═══ */
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.support-card {
  background: #fff;
  border: 1px solid var(--g200);
  border-radius: var(--rl);
  padding: 28px;
  transition: all .25s var(--ease);
}
.support-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.04);
  transform: translateY(-2px);
}

.support-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.support-card__icon--red { background: var(--red50); color: var(--red); }
.support-card__icon--green { background: var(--green50); color: var(--green); }
.support-card__icon--blue { background: var(--blue50); color: var(--blue); }

.support-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--g900);
  margin-bottom: 6px;
}
.support-card p {
  font-size: 14px;
  color: var(--g500);
  margin-bottom: 12px;
  line-height: 1.6;
}
.support-card__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--red);
  transition: color .15s;
}
.support-card__link:hover { color: var(--red-d); }

/* ═══ FAQ ═══ */
.faq-section {
  margin-top: 8px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--g200);
  border: 1px solid var(--g200);
  border-radius: var(--rl);
  overflow: hidden;
}

.faq-item {
  background: #fff;
}
.faq-item--open {
  background: var(--g50);
}

.faq-item__q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--g800);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--sans);
  transition: color .15s;
}
.faq-item__q:hover { color: var(--red); }

.faq-chevron {
  flex-shrink: 0;
  transition: transform .2s var(--ease);
}
.faq-item--open .faq-chevron {
  transform: rotate(180deg);
}

.faq-item__a {
  padding: 0 24px 18px;
}
.faq-item__a p {
  font-size: 14px;
  color: var(--g500);
  line-height: 1.75;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    padding: 8px 16px;
    border-right: none;
    border-top: 1px solid rgba(255,255,255,.06);
    z-index: 200;
  }
  .sidebar__logo, .sidebar__footer { display: none; }
  .sidebar__nav {
    flex-direction: row;
    justify-content: center;
    gap: 4px;
    width: 100%;
  }
  .nav-item {
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    padding: 8px 16px;
  }
  .nav-item--active::before { display: none; }

  .main {
    margin-left: 0;
    padding: 24px 16px 80px;
  }
  .page-header { flex-direction: column; gap: 12px; }
  .cards { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
}
