/* ============================================================================
   NIS-2 COMPLIANCE TOOL - Stylesheet
   Branding: Navy #1B2A4A, Gold #C9A84C
   Strategie Manufaktur Unternehmensberatung e.U.
   ============================================================================ */

:root {
  --navy: #1B2A4A;
  --navy-light: #2A3F6A;
  --navy-dark: #111D33;
  --gold: #C9A84C;
  --gold-light: #D4BC72;
  --red: #C0392B;
  --orange: #E67E22;
  --yellow: #F39C12;
  --green: #27AE60;
  --grey: #95A5A6;
  --grey-light: #ECF0F1;
  --grey-dark: #7F8C8D;
  --white: #FFFFFF;
  --bg: #F8F9FA;
  --text: #333333;
  --text-light: #666666;
  --shadow: 0 2px 8px rgba(27,42,74,0.1);
  --shadow-lg: 0 4px 20px rgba(27,42,74,0.15);
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; min-height: 100vh;
}

/* === LAYOUT === */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; background: var(--navy); color: var(--white);
  padding: 24px 0; position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 100;
}
.sidebar-brand { padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-brand h2 { font-size: 15px; color: var(--gold); letter-spacing: 1px; }
.sidebar-brand small { font-size: 11px; color: rgba(255,255,255,0.5); }
.sidebar-nav { flex: 1; padding: 16px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; color: rgba(255,255,255,0.7);
  text-decoration: none; font-size: 14px; transition: var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.1); color: var(--white);
}
.sidebar-nav a.active { border-left: 3px solid var(--gold); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12px; color: rgba(255,255,255,0.4); }
.main { flex: 1; margin-left: 260px; padding: 32px; }

/* === LOGIN PAGE === */
.login-wrapper {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}
.login-card {
  background: var(--white); border-radius: var(--radius); padding: 48px;
  width: 420px; max-width: 90vw; box-shadow: var(--shadow-lg);
}
.login-card h1 { color: var(--navy); font-size: 24px; margin-bottom: 8px; }
.login-card .subtitle { color: var(--text-light); margin-bottom: 32px; font-size: 14px; }

/* === FORMS === */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid #D5D8DC;
  border-radius: var(--radius-sm); font-size: 14px; transition: var(--transition);
  background: var(--white);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition);
  text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: var(--gold-light); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-light); }
.btn-outline { background: transparent; border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-danger { background: var(--red); color: var(--white); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === CARDS === */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-header h2 { font-size: 18px; color: var(--navy); }
.card-header h3 { font-size: 16px; color: var(--navy); }

/* === PAGE HEADER === */
.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 26px; color: var(--navy); margin-bottom: 4px; }
.page-header p { color: var(--text-light); font-size: 14px; }

/* === SCORE === */
.score-display { text-align: center; padding: 32px; }
.score-number { font-size: 64px; font-weight: 800; line-height: 1; }
.score-label { font-size: 16px; color: var(--text-light); margin-top: 8px; }
.risk-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 700; color: var(--white); margin-top: 12px;
}
.risk-Kritisch { background: var(--red); }
.risk-Hoch { background: var(--orange); }
.risk-Mittel { background: var(--yellow); color: var(--navy); }
.risk-Niedrig { background: var(--green); }

/* === TRAFFIC LIGHTS === */
.status-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  margin-right: 8px; vertical-align: middle;
}
.status-green { background: var(--green); }
.status-yellow { background: var(--yellow); }
.status-orange { background: var(--orange); }
.status-red { background: var(--red); }
.status-grey { background: var(--grey); }

/* === PROGRESS BAR === */
.progress-bar { height: 8px; background: var(--grey-light); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 4px; transition: width 0.4s ease; }

/* === ASSESSMENT FORM === */
.control-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px; border-left: 4px solid var(--grey);
  transition: var(--transition);
}
.control-card.answered { border-left-color: var(--green); }
.control-card.partial { border-left-color: var(--yellow); }
.control-card.negative { border-left-color: var(--red); }
.control-card .control-id { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.control-card h3 { font-size: 16px; color: var(--navy); margin: 6px 0 12px; }
.control-card .question { font-size: 14px; color: var(--text); margin-bottom: 16px; line-height: 1.5; }
.control-card .meta { font-size: 12px; color: var(--text-light); margin-top: 12px; }

.answer-options { display: flex; gap: 8px; flex-wrap: wrap; }
.answer-option {
  padding: 8px 16px; border: 2px solid #D5D8DC; border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: var(--transition); user-select: none;
}
.answer-option:hover { border-color: var(--navy); }
.answer-option.selected-ja { border-color: var(--green); background: rgba(39,174,96,0.08); color: var(--green); }
.answer-option.selected-teilweise { border-color: var(--yellow); background: rgba(243,156,18,0.08); color: #D4A017; }
.answer-option.selected-nein { border-color: var(--red); background: rgba(192,57,43,0.08); color: var(--red); }
.answer-option.selected-na { border-color: var(--grey); background: rgba(149,165,166,0.08); color: var(--grey-dark); }

/* === TABLE === */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--navy); color: var(--white); padding: 12px 16px; text-align: left; font-size: 13px; font-weight: 600; }
td { padding: 12px 16px; border-bottom: 1px solid var(--grey-light); font-size: 13px; }
tr:hover td { background: rgba(201,168,76,0.04); }

/* === ALERTS === */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #FDEDEC; border-left: 4px solid var(--red); color: var(--red); }
.alert-success { background: #EAFAF1; border-left: 4px solid var(--green); color: #1E8449; }
.alert-info { background: #EBF5FB; border-left: 4px solid #3498DB; color: #2471A3; }

/* === STATS ROW === */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.stat-card .stat-value { font-size: 32px; font-weight: 800; color: var(--navy); }
.stat-card .stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* === LOADING === */
.spinner { width: 36px; height: 36px; border: 3px solid var(--grey-light); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.85); display: flex; align-items: center; justify-content: center; z-index: 1000; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 16px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 32px 24px; }
  .answer-options { flex-direction: column; }
}

/* === PRINT === */
@media print {
  .sidebar, .btn, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
