* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #1a1a2e; min-height: 100vh; }

.hidden { display: none !important; }
.error { color: #e74c3c; margin-top: 8px; font-size: 14px; }

/* Login */
.screen { min-height: 100vh; }
#login-screen { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.login-box { background: white; border-radius: 12px; padding: 40px; width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-box h1 { color: #1a1a2e; font-size: 28px; margin-bottom: 4px; letter-spacing: 2px; }
.login-box p { color: #666; margin-bottom: 24px; font-size: 14px; }
.login-box input { width: 100%; padding: 12px 16px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 15px; margin-bottom: 12px; transition: border-color 0.2s; }
.login-box input:focus { outline: none; border-color: #0f3460; }
.login-box button { width: 100%; padding: 12px; background: #0f3460; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.login-box button:hover { background: #1a1a2e; }

/* Header */
header { background: #1a1a2e; color: white; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
header h1 { font-size: 20px; letter-spacing: 2px; }
.header-right { display: flex; align-items: center; gap: 12px; }
#user-name { font-weight: 500; }
.badge { background: #e94560; padding: 2px 10px; border-radius: 12px; font-size: 12px; text-transform: uppercase; }
.btn-sm { padding: 6px 14px; background: rgba(255,255,255,0.1); color: white; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-sm:hover { background: rgba(255,255,255,0.2); }

/* Nav */
nav { background: white; padding: 0 24px; display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
nav a { padding: 14px 20px; text-decoration: none; color: #666; font-weight: 500; border-bottom: 3px solid transparent; transition: all 0.2s; }
nav a:hover { color: #1a1a2e; }
nav a.active { color: #0f3460; border-bottom-color: #0f3460; }

/* Stats Bar */
.stats-bar { display: flex; gap: 0; background: white; padding: 12px 24px; border-bottom: 1px solid #e0e0e0; }
.stat { flex: 1; text-align: center; padding: 8px; }
.stat-num { display: block; font-size: 24px; font-weight: 700; color: #1a1a2e; }
.stat-label { font-size: 12px; color: #888; text-transform: uppercase; }

/* Content */
main { padding: 24px; max-width: 1200px; margin: 0 auto; }

/* Ticket Cards */
.ticket-card { background: white; border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-left: 4px solid #ccc; cursor: pointer; transition: box-shadow 0.2s, transform 0.1s; }
.ticket-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); transform: translateY(-1px); }
.ticket-card.prio-hoch { border-left-color: #e74c3c; }
.ticket-card.prio-normal { border-left-color: #3498db; }
.ticket-card.prio-niedrig { border-left-color: #95a5a6; }
.ticket-card .tc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.ticket-card .tc-title { font-weight: 600; font-size: 15px; color: #1a1a2e; flex: 1; }
.ticket-card .tc-nr { font-size: 12px; color: #888; font-family: monospace; }
.ticket-card .tc-meta { display: flex; gap: 12px; font-size: 13px; color: #666; flex-wrap: wrap; }
.ticket-card .tc-meta span { display: inline-flex; align-items: center; gap: 4px; }
.ticket-card .tc-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Status Badges */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-neu { background: #dbeafe; color: #1e40af; }
.status-offen { background: #fef3c7; color: #92400e; }
.status-in_arbeit { background: #d1fae5; color: #065f46; }
.status-warte_freigabe { background: #fde68a; color: #78350f; }
.status-eskaliert { background: #fecaca; color: #991b1b; }
.status-erledigt { background: #e5e7eb; color: #374151; }
.status-archiviert { background: #f3f4f6; color: #6b7280; }

/* Buttons */
.btn { padding: 6px 14px; border: none; border-radius: 6px; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s; }
.btn-primary { background: #0f3460; color: white; }
.btn-primary:hover { background: #1a1a2e; }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #047857; }
.btn-warning { background: #d97706; color: white; }
.btn-warning:hover { background: #b45309; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline { background: transparent; color: #666; border: 1px solid #d1d5db; }
.btn-outline:hover { background: #f3f4f6; }

/* Kanban Board */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.board-col { background: #f8f9fa; border-radius: 10px; padding: 12px; min-height: 200px; }
.board-col h3 { font-size: 14px; text-transform: uppercase; color: #666; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e0e0e0; }
.board-col .ticket-card { border-left-width: 3px; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; z-index: 100; overflow-y: auto; }
.modal-content { background: white; border-radius: 12px; width: 100%; max-width: 720px; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); position: relative; }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 24px; cursor: pointer; color: #666; }
.modal-close:hover { color: #1a1a2e; }

/* Ticket Detail */
.td-header { margin-bottom: 20px; }
.td-header h2 { font-size: 18px; margin-bottom: 8px; }
.td-header .td-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; color: #666; }
.td-section { margin-bottom: 20px; }
.td-section h3 { font-size: 14px; color: #888; text-transform: uppercase; margin-bottom: 8px; }
.td-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.td-verlauf { list-style: none; }
.td-verlauf li { padding: 8px 0; border-bottom: 1px solid #f0f0f0; font-size: 14px; }
.td-verlauf li .v-date { color: #888; font-size: 12px; }

/* Create Ticket Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: 8px; font-size: 14px; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #0f3460; }
.form-group textarea { min-height: 80px; resize: vertical; }

/* Stats View */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stats-card { background: white; border-radius: 10px; padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.stats-card .sc-num { font-size: 36px; font-weight: 700; color: #0f3460; }
.stats-card .sc-label { font-size: 14px; color: #666; margin-top: 4px; }

/* Responsive */
@media (max-width: 768px) {
  header { padding: 10px 16px; }
  header h1 { font-size: 16px; }
  nav { overflow-x: auto; padding: 0 8px; }
  nav a { padding: 12px 14px; font-size: 14px; white-space: nowrap; }
  main { padding: 16px; }
  .stats-bar { flex-wrap: wrap; }
  .stat { min-width: 33%; }
  .board { grid-template-columns: 1fr; }
  .modal-overlay { padding: 16px; }
  .td-actions { flex-direction: column; }
  .td-actions .btn { width: 100%; text-align: center; }
}

/* Loading */
.loading { text-align: center; padding: 40px; color: #888; }
.loading::after { content: ''; display: inline-block; width: 20px; height: 20px; border: 3px solid #e0e0e0; border-top-color: #0f3460; border-radius: 50%; animation: spin 0.8s linear infinite; margin-left: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Empty State */
.empty { text-align: center; padding: 60px 20px; color: #888; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
