/* Executive Mobile Cockpit CSS - Exzellent Leben */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #0F172A;
  --bg-card: #1E293B;
  --bg-card-hover: #26354A;
  --bg-card-elevated: #334155;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  
  --accent-gold: #F59E0B;
  --accent-gold-dark: #D97706;
  --accent-emerald: #10B981;
  --accent-cyan: #38BDF8;
  --accent-rose: #F43F5E;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.3);
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(245, 158, 11, 0.15);

  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bottom-nav-height: 72px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
}

.app-container {
  width: 100%;
  max-width: 540px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-main);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #FFF;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-btn {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s, transform 0.2s;
}

.sync-btn:active {
  transform: scale(0.95);
  background: var(--accent-gold);
  color: #000;
}

.logout-btn {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background-color 0.2s, transform 0.2s;
}

.logout-btn:active {
  transform: scale(0.95);
  background: var(--accent-rose);
  color: #FFF;
}

.month-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.month-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.month-btn:active {
  background: var(--accent-gold);
  color: #000;
}

.month-display {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.ziel-val {
  font-weight: 600;
  display: block;
}

.ziel-ok {
  color: #10B981 !important;
  font-weight: 700;
}

.ziel-miss {
  color: #F43F5E !important;
  font-weight: 700;
}

.ziel-badge-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

.ziel-badge-miss {
  background: rgba(244, 63, 94, 0.2);
  color: #F43F5E;
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

.sync-btn.spinning .sync-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.portfolio-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.pill-item {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pill-item strong {
  color: var(--text-main);
}

.status-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.read-only-tag {
  font-size: 0.65rem;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
  border: 1px solid var(--border-gold);
  font-weight: 600;
}

/* Content Area */
.content-area {
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tab-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:active {
  transform: scale(0.985);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Hero KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-card);
}

.kpi-card.full-width {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid var(--border-gold);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.02em;
}

.kpi-value.gold { color: var(--accent-gold); }
.kpi-value.emerald { color: var(--accent-emerald); }
.kpi-value.cyan { color: var(--accent-cyan); }

.kpi-subtext {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-gold-dark), var(--accent-gold));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.emerald {
  background: linear-gradient(90deg, #059669, var(--accent-emerald));
}

/* Highlight Box */
.highlight-box {
  background: rgba(245, 158, 11, 0.06);
  border-left: 4px solid var(--accent-gold);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.highlight-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.highlight-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Responsive Table Container & Compact Layout for Mobile */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.kpi-grid.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.kpi-grid.grid-3 .kpi-card {
  padding: 10px 8px;
}

.kpi-grid.grid-3 .kpi-value {
  font-size: 1.25rem;
}

.card-table {
  padding: 14px 10px;
}

/* Table styling for mobile */
.mobile-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 0.8rem;
}

.mobile-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

.mobile-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

/* Compact Table formatting for small mobile screens */
.mobile-table.compact-table {
  font-size: 0.72rem;
  width: 100%;
  table-layout: auto;
}

.mobile-table.compact-table th {
  padding: 6px 3px;
  font-size: 0.65rem;
  white-space: nowrap;
}

.mobile-table.compact-table td {
  padding: 8px 3px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.mobile-table.compact-table tr {
  cursor: pointer;
  transition: background-color 0.15s;
}

.mobile-table.compact-table tr:active {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 540px) {
  .card-table {
    padding: 10px 4px;
  }
  .content-area {
    padding: 10px 6px;
  }
  .mobile-table.compact-table th {
    padding: 5px 2px;
    font-size: 0.62rem;
  }
  .mobile-table.compact-table td {
    padding: 6px 2px;
    font-size: 0.68rem;
    line-height: 1.25;
  }
}



.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--accent-emerald); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--accent-gold); }
.badge-info { background: rgba(56, 189, 248, 0.2); color: var(--accent-cyan); }

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 540px;
  height: var(--bottom-nav-height);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-item .nav-icon {
  font-size: 20px;
  transition: transform 0.2s ease;
}

.nav-item.active {
  color: var(--accent-gold);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.15);
}

/* PIN Lock Screen Overlay */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  gap: 24px;
}

.pin-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFF;
}

.pin-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.pin-dots {
  display: flex;
  gap: 16px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  transition: background-color 0.2s;
}

.pin-dot.filled {
  background-color: var(--accent-gold);
  box-shadow: 0 0 12px var(--accent-gold);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 280px;
}

.pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: #FFF;
  font-size: 1.4rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.pin-key:active {
  background: var(--accent-gold);
  color: #000;
}

/* Detail Drawer Modal */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
}

.drawer-backdrop.active {
  display: flex;
}

.drawer-content {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-card);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 20px 20px 32px;
  max-height: 85vh;
  overflow-y: auto;
  border-top: 1px solid var(--border-gold);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.drawer-handle {
  width: 40px;
  height: 5px;
  background: var(--text-dim);
  border-radius: 3px;
  margin: 0 auto 16px;
}

/* Sync Time Bar */
.sync-time-bar {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  padding: 6px;
}

/* Trend Badges */
.trend-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.trend-badge.up {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.trend-badge.down {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Pipeline Object Cards inside Modal */
.pipeline-obj-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pipeline-obj-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #FFF;
}
.pipeline-obj-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

/* PIN Lock Overlay */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pin-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pin-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.pin-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #FFF;
}
.pin-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 20px;
}
.pin-dots {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.pin-dots .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-gold);
  background: transparent;
  transition: all 0.2s;
}
.pin-dots .dot.filled {
  background: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
}
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 20px;
}
.pin-btn {
  aspect-ratio: 1.2;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: #FFF;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-btn:active {
  background: var(--accent-cyan);
  color: #000;
}
.pin-btn.pin-action {
  font-size: 0.95rem;
  color: var(--accent-gold);
}
.pin-logout-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 10px;
}

