/* =========================================================
   ANIMUR Responsive Compact UI
   Ziel:
   - Desktop: Hauptnavigation und Kernbereiche ohne unnötiges Scrollen
   - Tablet/Mobile: kompakter, vollständig responsiv
   ========================================================= */

:root{
  --animur-gap: clamp(8px, 1vw, 16px);
  --animur-radius: clamp(12px, 1.1vw, 18px);
}

/* Grundlayout kompakter */
html,body{
  min-height:100%;
}

body{
  overflow-x:hidden;
}

main,
.main,
.app-main,
.dashboard,
.dashboard-shell,
.content,
.content-wrap,
.container{
  max-width:none !important;
}

main,
.main,
.app-main,
.dashboard,
.dashboard-shell{
  padding-top:clamp(10px,1.3vw,20px) !important;
}

/* Header deutlich kompakter */
header,
.header,
.topbar,
.app-header{
  min-height:auto !important;
  padding-top:clamp(8px,1vw,14px) !important;
  padding-bottom:clamp(8px,1vw,14px) !important;
}

header img,
.header img,
.topbar img,
.app-header img{
  max-height:44px !important;
  width:auto !important;
}

/* Große Start-/Hero-Fläche verkleinern */
.hero,
.hero-card,
.dashboard-hero,
.master-hero,
.welcome-card,
.intro-card{
  padding:clamp(16px,2vw,28px) !important;
  min-height:0 !important;
  margin-bottom:var(--animur-gap) !important;
}

.hero h1,
.hero-card h1,
.dashboard-hero h1,
.master-hero h1,
.welcome-card h1,
.intro-card h1{
  font-size:clamp(30px,3.2vw,52px) !important;
  line-height:1.02 !important;
  margin-top:4px !important;
  margin-bottom:clamp(8px,1vw,14px) !important;
}

.hero p,
.hero-card p,
.dashboard-hero p,
.master-hero p,
.welcome-card p,
.intro-card p{
  font-size:clamp(15px,1.25vw,20px) !important;
  line-height:1.35 !important;
  margin-bottom:0 !important;
}

/* Core/Version-Karte kompakter */
.version-card,
.core-card,
.status-card,
.release-card{
  min-height:0 !important;
  padding:clamp(16px,2vw,26px) !important;
}

.version-card strong,
.core-card strong,
.status-card strong,
.release-card strong{
  font-size:clamp(34px,3.5vw,54px) !important;
  line-height:1 !important;
}

/* KPI-/Statistik-Karten kompakter */
.stats,
.stats-grid,
.metrics,
.metric-grid,
.summary-grid,
.kpi-grid{
  gap:var(--animur-gap) !important;
  margin-top:var(--animur-gap) !important;
  margin-bottom:var(--animur-gap) !important;
}

.stat-card,
.metric-card,
.summary-card,
.kpi-card{
  min-height:0 !important;
  padding:clamp(14px,1.5vw,22px) !important;
}

.stat-card h2,
.stat-card h3,
.metric-card h2,
.metric-card h3,
.summary-card h2,
.summary-card h3,
.kpi-card h2,
.kpi-card h3{
  margin:4px 0 0 !important;
  line-height:1.05 !important;
}

/* Navigation immer sichtbar und kompakt */
nav,
.nav,
.tabs,
.tabbar,
.tab-bar,
.main-tabs{
  min-height:auto !important;
}

.tabs,
.tabbar,
.tab-bar,
.main-tabs{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:clamp(4px,.7vw,10px) !important;
  margin-top:clamp(8px,1vw,14px) !important;
  margin-bottom:clamp(8px,1vw,14px) !important;
}

.tabs button,
.tabbar button,
.tab-bar button,
.main-tabs button,
.tabs a,
.tabbar a,
.tab-bar a,
.main-tabs a{
  min-height:40px !important;
  padding:8px 14px !important;
  font-size:clamp(14px,1vw,17px) !important;
  white-space:nowrap !important;
}

/* Tabellen/Listen etwas dichter */
table th,
table td{
  padding-top:8px !important;
  padding-bottom:8px !important;
}

section{
  margin-top:clamp(8px,1vw,14px) !important;
}

/* Die nachträglich eingebauten Master-Schalter kompakter */
#animur-platform-button,
#animur-security-button{
  padding:9px 14px !important;
  font-size:15px !important;
  min-height:42px !important;
}

/* Desktop: die beiden Floating-Aktionen platzsparend nebeneinander */
@media (min-width: 900px){
  #animur-platform-button{
    right:170px !important;
    bottom:16px !important;
  }

  #animur-security-button{
    right:16px !important;
    bottom:16px !important;
  }

  /* häufige 2-Spalten-Hero-Layouts kompakter */
  .hero-grid,
  .dashboard-top,
  .overview-top,
  .master-overview{
    gap:var(--animur-gap) !important;
  }
}

/* Kleinere Desktop-/Laptop-Höhen zusätzlich verdichten */
@media (min-width: 900px) and (max-height: 850px){
  header,
  .header,
  .topbar,
  .app-header{
    padding-top:7px !important;
    padding-bottom:7px !important;
  }

  .hero,
  .hero-card,
  .dashboard-hero,
  .master-hero,
  .welcome-card,
  .intro-card{
    padding:14px 20px !important;
  }

  .hero h1,
  .hero-card h1,
  .dashboard-hero h1,
  .master-hero h1{
    font-size:38px !important;
  }

  .stat-card,
  .metric-card,
  .summary-card,
  .kpi-card{
    padding:12px 16px !important;
  }

  .tabs,
  .tabbar,
  .tab-bar,
  .main-tabs{
    margin-top:6px !important;
    margin-bottom:6px !important;
  }
}

/* Tablet */
@media (max-width: 899px){
  .stats,
  .stats-grid,
  .metrics,
  .metric-grid,
  .summary-grid,
  .kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .tabs,
  .tabbar,
  .tab-bar,
  .main-tabs{
    width:100% !important;
  }

  .tabs button,
  .tabbar button,
  .tab-bar button,
  .main-tabs button,
  .tabs a,
  .tabbar a,
  .tab-bar a,
  .main-tabs a{
    flex:1 1 auto !important;
    text-align:center !important;
  }

  #animur-platform-button,
  #animur-security-button{
    position:static !important;
    margin:8px 8px 0 0 !important;
    display:inline-flex !important;
  }
}

/* Handy */
@media (max-width: 600px){
  body{
    font-size:15px !important;
  }

  header,
  .header,
  .topbar,
  .app-header{
    padding-left:12px !important;
    padding-right:12px !important;
  }

  main,
  .main,
  .app-main,
  .dashboard,
  .dashboard-shell,
  .content,
  .content-wrap,
  .container{
    padding-left:10px !important;
    padding-right:10px !important;
  }

  .hero,
  .hero-card,
  .dashboard-hero,
  .master-hero,
  .welcome-card,
  .intro-card,
  .version-card,
  .core-card,
  .status-card,
  .release-card{
    padding:14px !important;
    border-radius:14px !important;
  }

  .hero h1,
  .hero-card h1,
  .dashboard-hero h1,
  .master-hero h1{
    font-size:30px !important;
  }

  .hero p,
  .hero-card p,
  .dashboard-hero p,
  .master-hero p{
    font-size:15px !important;
  }

  .stats,
  .stats-grid,
  .metrics,
  .metric-grid,
  .summary-grid,
  .kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
  }

  .stat-card,
  .metric-card,
  .summary-card,
  .kpi-card{
    padding:11px 12px !important;
  }

  .tabs,
  .tabbar,
  .tab-bar,
  .main-tabs{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:5px !important;
  }

  .tabs button,
  .tabbar button,
  .tab-bar button,
  .main-tabs button,
  .tabs a,
  .tabbar a,
  .tab-bar a,
  .main-tabs a{
    width:100% !important;
    min-width:0 !important;
    padding:8px 6px !important;
    font-size:13px !important;
    white-space:normal !important;
    line-height:1.15 !important;
  }

  button,
  input,
  select,
  textarea{
    max-width:100%;
  }

  #animur-platform-button,
  #animur-security-button{
    width:calc(50% - 6px) !important;
    margin:8px 4px 0 0 !important;
    justify-content:center !important;
    font-size:14px !important;
    padding:8px 10px !important;
  }

  /* Modale Verwaltung an Mobilbreite anpassen */
  #animur-platform-overlay,
  #animur-security-overlay{
    padding:8px !important;
  }

  #animur-platform-panel,
  #animur-security-panel{
    width:100% !important;
    max-height:96vh !important;
    border-radius:12px !important;
  }

  .ap-head,
  .animur-sec-head{
    padding:12px 14px !important;
  }

  .ap-body,
  .animur-sec-body{
    padding:12px !important;
  }

  .ap-grid{
    grid-template-columns:1fr !important;
    gap:10px !important;
  }

  .ap-card{
    padding:12px !important;
    margin-bottom:10px !important;
  }

  .ap-fields,
  .animur-sec-grid{
    grid-template-columns:1fr !important;
    gap:9px !important;
  }
}

/* Sehr kleine Handys */
@media (max-width: 380px){
  .tabs,
  .tabbar,
  .tab-bar,
  .main-tabs{
    grid-template-columns:1fr !important;
  }

  .stats,
  .stats-grid,
  .metrics,
  .metric-grid,
  .summary-grid,
  .kpi-grid{
    grid-template-columns:1fr 1fr !important;
  }

  #animur-platform-button,
  #animur-security-button{
    width:100% !important;
    margin-right:0 !important;
  }
}
