/* ============================================
   LIVI Dashboard - Shared Styles
   Dark Fintech Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #1a1a24;
  --bg-card-hover: #22222e;
  --bg-sidebar: #0d0d14;
  --bg-rightbar: #0f0f18;
  --border-color: #2a2a3a;
  
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  
  --text-primary: #ffffff;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --sidebar-width: 220px;
  --rightbar-width: 280px;
  --header-height: 56px;
  --border-radius: 10px;
  
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
}

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

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-size: 14px;
}

/* ============================================
   Layout
   ============================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Linke Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
}

.sidebar-logo svg { width: 26px; height: 26px; fill: var(--accent-blue); }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }

.nav-section { margin-bottom: 20px; }

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-item:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.nav-item.active { background: rgba(59, 130, 246, 0.12); color: var(--accent-blue); }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent-blue);
  border-radius: 0 3px 3px 0;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.nav-item .nav-arrow { margin-left: auto; width: 14px; height: 14px; transition: transform 0.2s; }
.nav-item.open .nav-arrow { transform: rotate(90deg); }

.nav-sub { display: none; padding-left: 38px; margin-top: -4px; margin-bottom: 8px; }
.nav-sub.open { display: block; }

.nav-sub-item {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.nav-sub-item:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.nav-sub-item.active { color: var(--accent-cyan); background: rgba(6, 182, 212, 0.1); }

/* Sidebar Footer */
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border-color); }

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.user-info:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem; flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }

.user-name {
  font-size: 0.8rem; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--rightbar-width);
  min-height: 100vh;
  background: var(--bg-primary);
}

/* Rechte Sidebar */
.right-sidebar {
  width: var(--rightbar-width);
  background: var(--bg-rightbar);
  border-left: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}

.right-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.right-sidebar-header .time {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.right-sidebar-header .date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.right-sidebar-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.right-sidebar-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

/* Quick Actions */
.quick-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 6px;
}

.quick-action:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.quick-action-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.quick-action-icon svg { width: 16px; height: 16px; }
.quick-action-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.quick-action-icon.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.quick-action-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.quick-action-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

.quick-action-text { font-size: 0.8rem; font-weight: 500; }
.quick-action-desc { font-size: 0.7rem; color: var(--text-muted); }

/* Notification Items */
.notification-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child { border-bottom: none; }

.notification-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.notification-dot.blue { background: var(--accent-blue); }
.notification-dot.green { background: var(--success); }
.notification-dot.yellow { background: var(--warning); }
.notification-dot.red { background: var(--error); }

.notification-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.notification-time { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Mini Weather */
.weather-widget {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.weather-temp {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.weather-city {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.weather-icon { font-size: 1.5rem; margin-bottom: 4px; }

/* Header */
.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Mobile menu toggle */
.header-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 12px 16px;
  margin-right: 12px;
  font-size: 24px;
  border-radius: 8px;
}
.header-menu-btn:hover { background: var(--bg-hover); }

@media (max-width: 768px) {
  .header-menu-btn { display: block; }
}

.header-left { display: flex; align-items: center; gap: 16px; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 0.8rem;
}

.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text-secondary); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.header-search {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  gap: 8px;
  transition: border-color 0.2s;
}

.header-search:focus-within { border-color: var(--accent-blue); }

.header-search input {
  background: none; border: none; outline: none;
  color: var(--text-primary); width: 180px; font-size: 0.8rem;
}

.header-search input::placeholder { color: var(--text-muted); }
.header-search svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.header-icon {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--bg-card);
  color: var(--text-secondary); cursor: pointer;
  position: relative; transition: all 0.2s;
}

.header-icon:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.header-icon .badge {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--error);
  border-radius: 50%;
  border: 1.5px solid var(--bg-secondary);
}

/* Page Content */
.page-content { padding: 24px; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
}

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

.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.card-subtitle { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.stat-card:hover { border-color: var(--accent-blue); box-shadow: var(--shadow-glow); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.error::before { background: var(--error); }

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  font-weight: 600;
}

.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; margin-bottom: 4px; }
.stat-change { font-size: 0.75rem; color: var(--text-secondary); }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--error); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer; border: none;
  transition: all 0.2s; text-decoration: none;
}

.btn-primary { background: var(--accent-gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

.btn-secondary { background: var(--bg-card-hover); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }

/* Tables */
.table-container { overflow-x: auto; border-radius: var(--border-radius); border: 1px solid var(--border-color); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-color); }
th { background: var(--bg-secondary); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Badges */
.badge-status {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.7rem; font-weight: 500;
}

.badge-status.green { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-status.yellow { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge-status.red { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-status.gray { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.mb-6 { margin-bottom: 24px; }
.mt-6 { margin-top: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

a.card { text-decoration: none; color: inherit; display: block; transition: all 0.2s; }
a.card:hover { border-color: var(--accent-blue); transform: translateY(-2px); box-shadow: var(--shadow-glow); }

/* Responsive */
@media (max-width: 1200px) { .right-sidebar { display: none; } .main-content { margin-right: 0; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .header-search { display: none; }
}
