/* ============================================================
   Geschäftsstelle Gemeinderat Pfullingen – App-Stylesheet
   ============================================================ */

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

:root {
  --bg:        #f4f5f7;
  --surface:   #ffffff;
  --border:    #e1e4e8;
  --text:      #1a1d23;
  --muted:     #6b7280;
  --primary:   #1a3a5c;
  --primary-l: #e8eff7;
  --info:      #0d6efd;
  --info-l:    #dbeafe;
  --ok:        #16a34a;
  --ok-l:      #dcfce7;
  --warn:      #d97706;
  --warn-l:    #fef3c7;
  --danger:    #dc2626;
  --danger-l:  #fee2e2;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
       font-size: 14px; color: var(--text); background: var(--bg); }

/* ----- Topbar ----- */
.topbar { background: var(--primary); color: #fff; padding: 10px 20px;
          display: flex; align-items: center; justify-content: space-between;
          flex-wrap: wrap; gap: 8px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-title  { font-size: 15px; font-weight: 600; display: block; }
.topbar-sub    { font-size: 11px; opacity: .7; display: block; }
.topbar-user   { display: flex; align-items: center; gap: 8px; }
.user-info     { display: flex; flex-direction: column; }
.user-name     { font-size: 12px; font-weight: 500; color: #fff; }
.role-badge    { font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 500; }
.role-gs       { background: #c7d9f0; color: var(--primary); }
.role-amt      { background: #fde68a; color: #92400e; }
.avatar        { width: 30px; height: 30px; border-radius: 50%;
                 display: flex; align-items: center; justify-content: center;
                 font-size: 11px; font-weight: 600; flex-shrink: 0; }
.avatar-gs  { background: #c7d9f0; color: var(--primary); }
.avatar-amt { background: #fde68a; color: #92400e; }

/* ----- Navigation ----- */
.main-nav { background: var(--surface); border-bottom: 1px solid var(--border);
            display: flex; overflow-x: auto; padding: 0 12px; }
.nav-btn  { background: none; border: none; border-bottom: 2px solid transparent;
            padding: 10px 14px; font-size: 13px; cursor: pointer; color: var(--muted);
            white-space: nowrap; font-family: inherit; }
.nav-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.nav-btn:hover  { color: var(--text); }
.notif-badge    { background: var(--danger); color: #fff; border-radius: 10px;
                  padding: 0 5px; font-size: 10px; margin-left: 4px; }

/* ----- Content ----- */
.content { padding: 16px; max-width: 1100px; }
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ----- Cards ----- */
.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
        box-shadow: var(--shadow); }
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.card-header-row { display: flex; align-items: center; justify-content: space-between;
                   flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

/* ----- Forms ----- */
.field { display: flex; flex-direction: column; gap: 3px; }
label  { font-size: 11px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  width: 100%; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 9px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 64px; }
.field-grid { display: grid; gap: 10px; margin-bottom: 10px; }
.field-grid.two   { grid-template-columns: 1fr 1fr; }
.field-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.check-wrap { display: flex; align-items: center; gap: 7px; padding: 7px 0; }
.check-wrap input[type=checkbox] { width: auto; margin: 0; cursor: pointer; }
.check-wrap label { font-size: 13px; color: var(--text); margin: 0; cursor: pointer; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px;
       font-size: 12px; font-family: inherit; border: 1px solid var(--border);
       border-radius: 6px; cursor: pointer; background: var(--surface);
       color: var(--text); text-decoration: none; }
.btn:hover      { background: var(--bg); }
.btn-primary    { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: #0f2a45; }
.btn-ok         { background: var(--ok-l); color: var(--ok); border-color: #86efac; }
.btn-no         { background: var(--danger-l); color: var(--danger); border-color: #fca5a5; }
.btn-ris        { background: var(--info-l); color: var(--info); border-color: #93c5fd; }
.btn-block      { width: 100%; justify-content: center; }
.btn-row        { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.btn-icon       { background: none; border: 1px solid var(--border); border-radius: 6px;
                  padding: 4px 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.btn-icon:hover { background: var(--bg); }
.btn-icon.danger { color: var(--danger); }

/* ----- Badges & Flags ----- */
.badge         { display: inline-block; padding: 2px 7px; border-radius: 20px;
                 font-size: 10px; font-weight: 600; }
.badge-info    { background: var(--info-l);   color: var(--info);   }
.badge-warn    { background: var(--warn-l);   color: var(--warn);   }
.badge-ok      { background: var(--ok-l);     color: var(--ok);     }
.badge-muted   { background: #f3f4f6;         color: var(--muted);  }
.badge-danger  { background: var(--danger-l); color: var(--danger); }
.flag          { display: inline-flex; align-items: center; gap: 3px;
                 font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.flag-pres     { background: var(--warn-l); color: var(--warn); }
.flag-dringend { background: var(--danger-l); color: var(--danger); }
.flag-pres-sm  { font-size: 10px; color: var(--warn); }

/* ----- TOP-Zeilen ----- */
.top-row     { display: grid; grid-template-columns: 24px 1fr auto;
               gap: 8px; align-items: start; padding: 10px 0;
               border-bottom: 1px solid var(--border); }
.top-row:last-child { border-bottom: none; }
.top-num     { font-size: 13px; font-weight: 600; color: var(--muted); text-align: right; padding-top: 2px; }
.top-title   { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.top-meta    { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.top-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top-panel   { display: none; background: var(--bg); border-radius: 6px;
               padding: 10px 12px; margin-top: 8px; }
.top-panel.open { display: block; }

/* ----- Sitzungszeilen ----- */
.sitzung-row { display: flex; align-items: center; gap: 12px;
               padding: 10px 0; border-bottom: 1px solid var(--border); }
.sitzung-row:last-child { border-bottom: none; }
.sitz-icon   { width: 36px; height: 36px; background: var(--info-l);
               border-radius: 8px; display: flex; align-items: center;
               justify-content: center; font-size: 18px; flex-shrink: 0; }
.sitz-body   { flex: 1; min-width: 0; }
.sitz-title  { font-size: 13px; font-weight: 600; }
.sitz-meta   { font-size: 11px; color: var(--muted); }

/* ----- Workflow ----- */
.wf-step   { display: flex; align-items: flex-start; gap: 10px;
             padding: 8px 0; border-bottom: 1px solid var(--border); }
.wf-step:last-child { border-bottom: none; }
.wf-circle { width: 26px; height: 26px; border-radius: 50%;
             display: flex; align-items: center; justify-content: center;
             font-size: 12px; flex-shrink: 0; margin-top: 1px; }
.wf-done   { background: var(--ok-l);   color: var(--ok);   }
.wf-active { background: var(--info-l); color: var(--info); }
.wf-open   { background: #f3f4f6;       color: var(--muted);}
.wf-body   { flex: 1; }
.wf-label  { font-size: 13px; font-weight: 500; }
.wf-detail { font-size: 11px; color: var(--muted); }

/* ----- Tagesordnung Vorschau ----- */
.to-header   { text-align: center; padding: 8px 0 12px; }
.to-city     { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.to-gremium  { font-size: 17px; font-weight: 600; margin: 4px 0; }
.to-meta     { font-size: 12px; color: var(--muted); }
.to-section-label { font-size: 10px; font-weight: 600; text-transform: uppercase;
                    letter-spacing: .06em; color: var(--muted); margin: 8px 0 4px; }
.to-row      { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.to-row:last-child { border-bottom: none; }
.to-draft    { opacity: .5; }
.to-num      { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 22px; }
.to-sub      { font-size: 11px; color: var(--muted); margin-top: 1px; }
hr           { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

/* ----- Benachrichtigungen ----- */
.notif-row   { display: flex; align-items: flex-start; gap: 10px;
               padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--bg); margin: 0 -4px; padding: 9px 4px; }
.notif-dot   { width: 8px; height: 8px; border-radius: 50%;
               background: var(--info); flex-shrink: 0; margin-top: 5px; }
.notif-dot.read { background: var(--border); }
.notif-title { font-size: 13px; font-weight: 500; display: flex;
               align-items: baseline; gap: 8px; margin-bottom: 2px; }
.notif-date  { font-size: 10px; color: var(--muted); margin-left: auto; font-weight: 400; }
.notif-text  { font-size: 12px; color: var(--muted); }
.notif-row.read .notif-title { font-weight: 400; }

/* ----- Metriken ----- */
.summary-grid  { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px; }
.metric        { background: var(--surface); border: 1px solid var(--border);
                 border-radius: var(--radius); padding: 10px; text-align: center; }
.metric-num    { font-size: 22px; font-weight: 600; }
.metric-num.info { color: var(--info); }
.metric-num.warn { color: var(--warn); }
.metric-num.ok   { color: var(--ok);   }
.metric-label  { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* ----- Diverses ----- */
.filter-row  { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.info-note   { background: var(--info-l); border: 1px solid #93c5fd; border-radius: 6px;
               padding: 8px 12px; font-size: 12px; color: #1e40af; margin-bottom: 10px; }
.alert       { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-danger { background: var(--danger-l); color: var(--danger); border: 1px solid #fca5a5; }
.loading     { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.empty       { text-align: center; padding: 20px; color: var(--muted); font-size: 13px; }
.toast       { position: fixed; bottom: 20px; right: 20px; background: #1a1d23;
               color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 13px;
               opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 999;
               max-width: 280px; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.toast.show  { opacity: 1; }

/* ----- Login ----- */
.login-body  { background: var(--bg); display: flex; align-items: center;
               justify-content: center; min-height: 100vh; }
.login-wrap  { background: var(--surface); border: 1px solid var(--border);
               border-radius: var(--radius); padding: 32px 28px; width: 360px;
               box-shadow: var(--shadow); text-align: center; }
.login-logo  { margin-bottom: 12px; }
.login-title { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.login-sub   { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.login-form  { text-align: left; }
.login-form .field { margin-bottom: 12px; }
.login-hint  { font-size: 11px; color: var(--muted); margin-top: 14px;
               background: var(--warn-l); border-radius: 6px; padding: 8px; text-align: left; }
.login-hint code { font-family: monospace; font-size: 11px; }

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2,1fr); }
  .content { padding: 10px; }
}
