/**
 * Admin-Panel CSS
 */

/* === RESET & BASE ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: #000;
  background: #fff;
  padding: 1rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* === HEADER =============================================================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid color-mix(in srgb, #2a397a 31%, #cddeef 69%);
}

h1 {
  font-size: 17px;
  font-weight: bold;
}

/* === CARDS ================================================================ */
.card {
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  padding: 1rem;
  margin-bottom: 1rem;
}

.card h2 {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #ccc;
}

.card p {
  margin-bottom: 0.75rem;
  color: #333;
}

/* === MESSAGES ============================================================= */
.success {
  background: #d4edda;
  color: #155724;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #1d8b37;
}

.error {
  background: #f8d7da;
  color: #dc3545;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #dc3545;
}

/* === BUTTONS ============================================================== */
.btn-update,
.btn-upload,
.btn-save,
.btn-logout {
  background: color-mix(in srgb, #2a397a 31%, #cddeef 69%);
  color: #000;
  padding: 0.5rem 1.5rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-update:hover,
.btn-upload:hover,
.btn-save:hover,
.btn-logout:hover {
  background: color-mix(in srgb, #2a397a 45%, #cddeef 55%);
}

.btn-logout {
  background: #f0f0f0;
  font-weight: normal;
  margin-left: 1rem;
}

/* === STATUS GRID ========================================================== */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.status-item {
  background: #fff;
  padding: 0.6rem;
  border: 1px solid #ccc;
}

.status-item label {
  display: block;
  font-size: 11px;
  color: #666;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-item .value {
  font-size: 14px;
  font-weight: bold;
}

.status-item .status-sub {
  font-size: 11px;
  color: #666;
  margin-top: 0.2rem;
}

.status-ok {
  color: #22c55e;
}

.status-error {
  color: #dc3545;
}

/* === UPDATE RESULT ======================================================== */
.update-result {
  margin-top: 0.75rem;
  border: 1px solid #ccc;
  background: #fff;
}

.update-result-header {
  padding: 0.6rem 0.75rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.update-result-header.success {
  background: #d4edda;
  color: #155724;
  border-bottom: 1px solid #28a745;
}

.update-result-header.error {
  background: #f8d7da;
  color: #721c24;
  border-bottom: 1px solid #dc3545;
}

.update-result-body {
  padding: 0.75rem;
  font-family: monospace;
  font-size: 11px;
  background: #f8f9fa;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  color: #333;
}

.update-result-toggle {
  font-size: 11px;
  color: #0066cc;
  cursor: pointer;
  margin-left: auto;
}

/* === IMPORT INFO ========================================================== */
.import-info {
  background: #fff;
  border: 1px solid #ccc;
  margin-top: 0.75rem;
}

.import-info-header {
  padding: 0.5rem 0.75rem;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  font-size: 12px;
}

.import-info-body {
  padding: 0.75rem;
}

.import-info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.import-info-row:last-child {
  border-bottom: none;
}

.import-info-label {
  color: #666;
}

.import-info-value {
  font-weight: bold;
}

/* === VIEW TILES =========================================================== */
.view-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (max-width: 700px) {
  .view-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

.view-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem;
  background: #f0f0f0;
  border: 1px solid #ccc;
  text-decoration: none;
  color: #333;
  min-height: 90px;
}

.view-tile:hover {
  background: color-mix(in srgb, #2a397a 31%, #cddeef 69%);
  border-color: #999;
  text-decoration: none;
}

.view-tile-icon {
  font-size: 28px;
  margin-bottom: 0.4rem;
  line-height: 1;
}

.view-tile-label {
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  color: #000;
}

.view-tile-sub {
  font-size: 10px;
  color: #666;
  margin-top: 0.2rem;
}

/* === SETTINGS ============================================================= */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.setting-item label {
  font-size: 12px;
  font-weight: bold;
}

.setting-item input[type="number"],
.setting-item input[type="text"],
.setting-item select {
  padding: 0.4rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
}

.setting-hint {
  font-size: 11px;
  color: #666;
  margin-top: 0.5rem;
}

/* === CHECKBOX ITEM ======================================================== */
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* === BANNER SETTINGS ====================================================== */
.banner-settings {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.banner-settings textarea {
  width: 100%;
  padding: 0.4rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
}

/* === SCHULART EDITOR ====================================================== */
.schulart-section {
  margin-top: 0.75rem;
}

.schulart-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #e8e8e8;
  border: 1px solid #ccc;
  cursor: pointer;
  user-select: none;
}

.schulart-header:hover {
  background: #ddd;
}

.schulart-toggle {
  font-size: 10px;
  transition: transform 0.2s;
}

.schulart-toggle.open {
  transform: rotate(90deg);
}

.schulart-title {
  font-weight: bold;
  font-size: 13px;
}

.schulart-info-btn {
  margin-left: auto;
  background: #fff;
  border: 1px solid #999;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schulart-body,
.schulart-full-list {
  border: 1px solid #ccc;
  border-top: none;
  padding: 0.75rem;
  background: #fff;
  max-height: 300px;
  overflow-y: auto;
}

.schulart-full-list {
  padding: 0;
}

.schulart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem;
}

.schulart-row,
.schulart-list-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  background: #f8f8f8;
  border-bottom: 1px solid #eee;
  font-size: 12px;
}

.schulart-list-row:last-child {
  border-bottom: none;
}

.schulart-list-row:nth-child(even) {
  background: #f9f9f9;
}

.schulart-klasse,
.schulart-list-klasse {
  font-weight: bold;
  min-width: 100px;
  font-family: monospace;
}

.schulart-options {
  display: flex;
  gap: 0.75rem;
}

.schulart-options label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.schulart-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #ccc;
  cursor: pointer;
  margin-left: 0.5rem;
  color: #000;
  background: #f0f0f0;
  font-family: inherit;
}

.schulart-badge:hover {
  background: color-mix(in srgb, #2a397a 20%, #cddeef 80%);
}

.schulart-badge.active {
  background: color-mix(in srgb, #2a397a 31%, #cddeef 69%);
  border-color: #999;
}

.schulart-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* === MODAL ================================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  padding: 1.5rem;
  max-width: 500px;
  border: 1px solid #ccc;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h3 {
  margin-bottom: 1rem;
  font-size: 15px;
}

.modal-content ul {
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 12px;
}

.modal-content li {
  margin-bottom: 0.3rem;
}

.modal-close {
  background: #f0f0f0;
  border: 1px solid #ccc;
  padding: 0.4rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

/* === LOGIN ================================================================ */
.login-container {
  max-width: 320px;
  margin: 3rem auto;
}

.login-container h1 {
  margin-bottom: 1rem;
  text-align: center;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-form input {
  padding: 0.6rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
}

.login-form button {
  padding: 0.6rem;
  background: color-mix(in srgb, #2a397a 31%, #cddeef 69%);
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.login-form button:hover {
  background: color-mix(in srgb, #2a397a 45%, #cddeef 55%);
}

.login-error {
  background: #f8d7da;
  color: #dc3545;
  padding: 0.5rem;
  border: 1px solid #dc3545;
  text-align: center;
}

/* === FOOTER LINKS ========================================================= */
.footer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
}

/* === FORMS ================================================================ */
input[type="file"] {
  margin-bottom: 0.75rem;
  font-family: inherit;
  font-size: 13px;
}

input[type="number"] {
  width: 80px;
  padding: 0.3rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.interval-form {
  background: #fff;
  padding: 0.75rem;
  border: 1px solid #ccc;
}

.interval-form .btn-save {
  margin-top: 0.75rem;
}

.interval-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.interval-row:last-of-type {
  margin-bottom: 0.75rem;
}

.interval-row label {
  font-size: 12px;
  color: #333;
  min-width: 110px;
}

.interval-row .hint {
  font-size: 11px;
  color: #888;
}

.user-info {
  font-size: 12px;
  color: #666;
}

/* === COLLAPSIBLE SECTIONS ================================================= */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 0.4rem;
  margin: -0.4rem -0.4rem 0 -0.4rem;
}

.collapsible-header:hover {
  background: #e8e8e8;
}

.collapsible-toggle {
  font-size: 14px;
  color: #666;
  transition: transform 0.2s;
}

.collapsible-toggle.open {
  transform: rotate(180deg);
}

.collapsible-content {
  display: none;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ccc;
}

.collapsible-content.open {
  display: block;
}

/* === INFO MODAL =========================================================== */
.info-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.info-modal-overlay.open {
  display: flex;
}

.info-modal {
  background: #fff;
  border: 1px solid #ccc;
  padding: 1rem;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.info-modal h3 {
  font-size: 14px;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.4rem;
}

.info-modal ul {
  margin: 0.5rem 0 0.5rem 1.5rem;
  font-size: 11px;
}

.info-modal li {
  margin-bottom: 0.3rem;
}

.info-modal .close-btn {
  margin-top: 0.75rem;
}

/* === LINKS ================================================================ */
a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === LOGIN PAGE =========================================================== */
body.login-page {
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 0;
}

.login-container {
  background: #fff;
  padding: 2rem;
  border: 1px solid #ddd;
  width: 100%;
  max-width: 360px;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.login-header h1 {
  font-size: 18px;
  color: #2a397a;
  margin: 0;
}

.login-header .login-logo {
  height: 80px;
  width: auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 0.3rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 13px;
}

.form-group input:focus {
  outline: none;
  border-color: #2a397a;
}

.btn-login {
  width: 100%;
  background: color-mix(in srgb, #2a397a 31%, #cddeef 69%);
  color: #000;
  padding: 0.7rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn-login:hover {
  background: color-mix(in srgb, #2a397a 45%, #cddeef 55%);
}

.school-name {
  text-align: center;
  font-size: 11px;
  color: #999;
  margin-top: 1.5rem;
}

/* === BANNER TEXTAREA ====================================================== */
.banner-textarea {
  width: 100%;
  min-height: 60px;
  padding: 0.4rem;
  border: 1px solid #ccc;
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}

/* === SETTINGS SECTION DIVIDER ============================================= */
.settings-divider {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ccc;
}

/* === SETTINGS HINT BOX ==================================================== */
.settings-hint {
  font-size: 11px;
  color: #666;
  margin: 0.5rem 0;
  padding: 0.4rem;
  background: #fff8e6;
  border: 1px solid #f0d070;
}

/* === BANNER STATUS ======================================================== */
.banner-status {
  font-weight: bold;
}

.banner-status.active {
  color: #1d8b37;
}

.banner-status.inactive {
  color: #dc3545;
}

/* === PIPELINE FLOWCHART =================================================== */
.pipeline-summary {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-toggle {
  cursor: pointer;
  font-size: 12px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pipeline-toggle:hover {
  color: #007bff;
}

.pipeline-status-icon {
  font-weight: bold;
}

.pipeline-status-icon.ok { color: #28a745; }
.pipeline-status-icon.error { color: #dc3545; }

.pipeline-expand-icon {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}

.pipeline-details:not(.hidden) + .pipeline-summary .pipeline-expand-icon,
.pipeline-summary:has(+ .pipeline-details:not(.hidden)) .pipeline-expand-icon {
  transform: rotate(180deg);
}

.pipeline-time {
  font-size: 11px;
  color: #999;
}

.pipeline-details {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 4px;
}

.pipeline-details.hidden {
  display: none;
}

.pipeline-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 11px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  cursor: help;
}

.pipeline-step.step-ok {
  background: #d4edda;
  border-color: #28a745;
}

.pipeline-step.step-error {
  background: #f8d7da;
  border-color: #dc3545;
}

.pipeline-step.step-skipped {
  background: #fff3cd;
  border-color: #ffc107;
}

.step-icon {
  font-weight: bold;
  font-size: 10px;
}

.step-ok .step-icon { color: #28a745; }
.step-error .step-icon { color: #dc3545; }
.step-skipped .step-icon { color: #856404; }

.step-name {
  font-weight: 500;
}

.pipeline-arrow {
  color: #bbb;
  font-size: 12px;
}

.pipeline-meta {
  margin-top: 0.5rem;
  font-size: 10px;
  color: #666;
  line-height: 1.4;
}
