:root {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent: #059669;
  --accent-soft: #ecfdf5;
  --accent-border: #bbf7d0;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.07);
  --radius-lg: 18px;
}
*,
*::before,
*::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #e0f2fe 0, #f8fafc 40%, #f1f5f9 100%);
  color: var(--text-main);
}
.app { min-height: 100vh; display: flex; }
.sidebar {
  width: 270px; max-width: 80vw;
  border-right: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.9); backdrop-filter: blur(12px);
  display: flex; flex-direction: column;
}
.sidebar-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-logo { max-width: 160px; width: 100%; height: auto; display: block; }
.logo-circle {
  width: 42px; height: 42px; border-radius: 999px;
  background: #e2f3f3; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.logo-circle.small { width: 36px; height: 36px; }
.logo-circle img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sidebar-nav { flex: 1; padding: 14px 10px 8px; overflow-y: auto; }
.nav-item {
  width: 100%; border: none; background: transparent;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 999px;
  cursor: pointer; font-size: .86rem; color: var(--text-muted);
  transition: background .15s ease, color .15s ease, transform .05s ease;
}
.nav-item:hover { background: #e5f3ff; color: var(--text-main); transform: translateY(-1px); }
.nav-item.active { background: #0f766e10; color: var(--text-main); }
.nav-icon {
  width: 26px; height: 26px; border-radius: 999px;
  background: #f1f5f9; display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 600; color: #0f766e;
}
.sidebar-footer {
  padding: 10px 16px 16px; font-size: .72rem; color: var(--text-muted);
  border-top: 1px dashed var(--border-subtle);
}
.main { flex: 1; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.menu-button {
  display: none; border-radius: 999px; border: 1px solid var(--border-subtle);
  background: #fff; padding: 6px 10px; font-size: 1rem; cursor: pointer;
}
.topbar-logo { display: none; align-items: center; gap: 10px; }
.topbar-title { display: flex; flex-direction: column; }
.topbar-company { font-size: .9rem; font-weight: 600; }
.topbar-subtitle { font-size: .7rem; color: var(--text-muted); }
.topbar-project { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.topbar-project h1 {
  margin: 0; font-size: 1.05rem; font-weight: 600; color: #020617;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--border-subtle);
  font-size: .65rem; text-transform: uppercase; letter-spacing: .18em;
  color: var(--text-muted);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  border-radius: 999px; border: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: .78rem; font-weight: 500; cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn span { display: inline-block; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 25px rgba(16,185,129,0.35); }
.btn-primary:hover { background: #047857; transform: translateY(-1px); }
.btn-outline { background: #fff; border: 1px solid var(--border-subtle); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; }
.btn-small { font-size: .75rem; padding: 6px 12px; }
.content { padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: rgba(255,255,255,0.96); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); box-shadow: var(--shadow-soft);
  padding: 14px 16px 14px;
}
.card-main { padding-bottom: 18px; }
.card-header { margin-bottom: 8px; }
.card-header h2 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: 6px; }
.card-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-tag { font-size: .7rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-muted); }
.card-body p { margin: 0 0 8px 0; font-size: .86rem; color: var(--text-main); }
.card-body ul, .card-body ol {
  margin: 0 0 8px 0; padding-left: 18px; font-size: .85rem; color: var(--text-main);
}
.card-body li + li { margin-top: 4px; }
.card-hint { margin-top: 6px; font-size: .76rem; color: var(--text-muted); }
.card-hint.small { font-size: .72rem; }
.grid.grid-3 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1.2fr); gap: 16px; }
.module-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 6px; }
.module-card {
  border-radius: 14px; border: 1px solid var(--border-subtle);
  padding: 8px 10px; text-align: left; background: #fdfefe;
  cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  transition: border .15s ease, box-shadow .15s ease, transform .05s ease, background .15s ease;
}
.module-card:hover { border-color: #94a3b8; box-shadow: 0 8px 18px rgba(148,163,184,0.35); background: #fff; transform: translateY(-1px); }
.module-card-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.module-name { font-size: .8rem; font-weight: 600; color: #020617; }
.module-card p { margin: 0; font-size: .72rem; color: var(--text-muted); }
.status {
  font-size: .7rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--accent-border);
}
.status-on { background: var(--accent-soft); color: #166534; }
.reg-form { margin-top: 10px; display: flex; flex-direction: column; gap: 14px; }
.reg-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 14px; }
.reg-extra { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .78rem; color: var(--text-main); font-weight: 500; }
.field input, .field select, .field textarea {
  border-radius: 10px; border: 1px solid var(--border-subtle);
  padding: 6px 8px; font-size: .82rem; font-family: inherit; outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #0ea5e9; box-shadow: 0 0 0 1px #0ea5e930;
}
.reg-checks { display: flex; flex-direction: column; gap: 6px; }
.checkbox { display: flex; align-items: flex-start; gap: 6px; font-size: .78rem; color: var(--text-main); }
.checkbox input { margin-top: 2px; }
.reg-actions { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.upload-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 14px; align-items: stretch; }
.upload-dropzone {
  border-radius: 18px; border: 1px dashed var(--border-subtle);
  background: #f8fafc; padding: 18px 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.upload-icon {
  width: 32px; height: 32px; border-radius: 999px; background: #e0f2fe;
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.upload-dropzone p { margin: 0; font-size: .82rem; }
.upload-sub { font-size: .75rem; color: var(--text-muted); }
.upload-info { font-size: .8rem; color: var(--text-main); }
.upload-title { font-weight: 600; margin-bottom: 4px; }
@media (max-width: 900px) {
  .grid.grid-3 { grid-template-columns: minmax(0,1fr); }
  .module-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .upload-grid { grid-template-columns: minmax(0,1fr); }
  .topbar-project h1 { font-size: .95rem; }
  .reg-grid { grid-template-columns: minmax(0,1fr); }
  .reg-actions { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; transform: translateX(-100%);
    transition: transform .2s ease; z-index: 20;
    box-shadow: 18px 0 40px rgba(15,23,42,0.35);
  }
  .sidebar-open { transform: translateX(0); }
  .main { min-height: 100vh; }
  .topbar { align-items: center; }
  .menu-button { display: inline-flex; }
  .topbar-logo { display: flex; }
  .topbar-project { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn span { display: none; }
  .content { padding: 14px 12px 20px; }
  .module-grid { grid-template-columns: minmax(0,1fr); }
}
