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

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a2e; }

.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-container { width: 100%; max-width: 420px; padding: 1rem; }
.auth-card { background: white; border-radius: 12px; padding: 2rem; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-header h1 { font-size: 1.5rem; color: #1a1a2e; }
.auth-header p { color: #6b7280; margin-top: 0.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; color: #374151; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.625rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.btn { display: inline-block; padding: 0.625rem 1.25rem; border-radius: 6px; font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; text-align: center; transition: all 0.15s; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-ghost { background: transparent; color: #6b7280; }
.btn-ghost:hover { color: #374151; }
.btn-full { width: 100%; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }

.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Navigation */
.navbar { background: #1a1a2e; color: white; padding: 0 2rem; display: flex; align-items: center; height: 60px; gap: 2rem; position: sticky; top: 0; z-index: 100; }
.nav-brand a { color: white; text-decoration: none; font-weight: 700; font-size: 1rem; }
.nav-links { display: flex; gap: 1rem; flex: 1; }
.nav-link { color: #9ca3af; text-decoration: none; font-size: 0.875rem; padding: 0.25rem 0.5rem; border-radius: 4px; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,0.1); }
.nav-user { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: #9ca3af; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }

/* Layout */
.main-content { padding: 2rem; max-width: 1400px; margin: 0 auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; margin-top: 0.5rem; }
.header-badges { display: flex; gap: 0.5rem; align-items: center; }
.cards-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 8px rgba(0,0,0,0.06); margin-bottom: 1.5rem; }
.card-alert { border-left: 4px solid #dc2626; }
.card-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header-row h2 { margin: 0; }
.card h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; color: #374151; }

/* Metrics */
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; margin-bottom: 1.5rem; }
.metric-card { background: white; border-radius: 12px; padding: 1.5rem; box-shadow: 0 1px 8px rgba(0,0,0,0.06); text-align: center; }
.metric-card.metric-good { border-top: 3px solid #10b981; }
.metric-card.metric-bad { border-top: 3px solid #dc2626; }
.metric-value { font-size: 2.5rem; font-weight: 700; color: #1a1a2e; }
.metric-label { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }
.metric-target { font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem; }

/* Badges */
.status-badge { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 20px; font-size: 0.75rem; font-weight: 500; text-transform: capitalize; }
.status-open { background: #dbeafe; color: #1d4ed8; }
.status-in_progress { background: #fef3c7; color: #d97706; }
.status-waiting_on_submitter { background: #ede9fe; color: #7c3aed; }
.status-resolved { background: #d1fae5; color: #065f46; }
.status-closed { background: #f3f4f6; color: #6b7280; }
.priority-badge { display: inline-block; padding: 0.25rem 0.625rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.priority-critical { background: #fee2e2; color: #dc2626; }
.priority-high { background: #ffedd5; color: #ea580c; }
.priority-medium { background: #fef3c7; color: #d97706; }
.priority-low { background: #f0fdf4; color: #16a34a; }
.badge-sla-breach { background: #dc2626; color: white; padding: 0.25rem 0.625rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th { text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #f3f4f6; color: #6b7280; font-weight: 500; font-size: 0.75rem; text-transform: uppercase; }
.table td { padding: 0.75rem 1rem; border-bottom: 1px solid #f3f4f6; }
.table tbody tr:hover { background: #f9fafb; }
.row-breached { background: #fff5f5 !important; }
.text-muted { color: #9ca3af; font-size: 0.875rem; }
.text-center { text-align: center; }

/* Status breakdown */
.status-breakdown { display: flex; flex-direction: column; gap: 0.75rem; }
.status-item { display: flex; justify-content: space-between; align-items: center; }
.status-count { font-weight: 600; font-size: 1.1rem; }

/* Filters */
.filters-form { margin-bottom: 0; }
.filters-row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.filters-row select, .filters-row input { padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; }

/* Detail layout */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
.detail-main { min-width: 0; }
.detail-sidebar { display: flex; flex-direction: column; gap: 0; }
.ticket-description { white-space: pre-wrap; color: #374151; line-height: 1.6; }
.info-list { display: flex; flex-direction: column; gap: 0.75rem; }
.info-item { display: flex; justify-content: space-between; font-size: 0.875rem; }
.info-label { color: #6b7280; }

/* Notes */
.notes-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.note { padding: 1rem; border-radius: 8px; }
.note-internal { background: #fffbeb; border-left: 3px solid #f59e0b; }
.note-public { background: #f0fdf4; border-left: 3px solid #10b981; }
.note-header { display: flex; justify-content: space-between; margin-bottom: 0.5rem; }
.note-author { font-weight: 600; font-size: 0.875rem; }
.note-meta { font-size: 0.75rem; color: #6b7280; }
.note-content { font-size: 0.875rem; color: #374151; margin: 0; white-space: pre-wrap; }
.add-note-form { border-top: 1px solid #f3f4f6; padding-top: 1.5rem; margin-top: 1rem; }
.add-note-form h3 { font-size: 0.875rem; font-weight: 600; margin-bottom: 1rem; }
.add-note-form textarea { width: 100%; padding: 0.625rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.875rem; resize: vertical; }
.note-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: #374151; cursor: pointer; }

/* Submission form */
.radio-group { display: flex; gap: 1.5rem; margin-top: 0.375rem; }
.radio-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; cursor: pointer; }

/* Confirmation */
.confirmation-details { background: #f9fafb; border-radius: 8px; padding: 1rem; margin: 1rem 0; }
.conf-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid #f3f4f6; font-size: 0.875rem; }
.conf-item:last-child { border-bottom: none; }
.conf-label { color: #6b7280; }
.conf-value { font-weight: 500; text-align: right; max-width: 60%; }

/* Period selector */
.period-selector { display: flex; gap: 0.5rem; }
.period-btn { padding: 0.375rem 1rem; border-radius: 6px; font-size: 0.875rem; text-decoration: none; color: #6b7280; background: white; border: 1px solid #d1d5db; }
.period-btn:hover { background: #f3f4f6; }
.period-btn.active { background: #2563eb; color: white; border-color: #2563eb; }

/* Progress bar */
.progress-bar-wrap { display: inline-block; width: 80px; height: 6px; background: #f3f4f6; border-radius: 3px; vertical-align: middle; margin-right: 0.5rem; }
.progress-bar { height: 100%; border-radius: 3px; }
