:root {
    --primary: #1a1a1a;
    --primary-hover: #333;
    --bg: #ffffff;
    --bg-secondary: #f5f5f5;
    --sidebar-bg: #fafafa;
    --card-bg: #ffffff;
    --text: #111111;
    --text-muted: #666666;
    --border: #e0e0e0;
    --input-bg: #ffffff;
    --sidebar-width: 260px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* Layout */
.app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

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

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.sidebar-nav-section {
    margin-bottom: 1.5rem;
}

.sidebar-nav-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.sidebar-nav-link {
    display: block;
    padding: 0.625rem 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: background-color 0.15s ease;
}

.sidebar-nav-link:hover {
    background-color: var(--border);
}

.sidebar-nav-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-all;
}

.sidebar-logout {
    display: block;
    width: 100%;
    padding: 0.625rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.sidebar-logout:hover {
    background-color: var(--bg-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    max-width: 100%;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.breadcrumb-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumb-link:hover {
    color: var(--text);
}

.breadcrumb-separator {
    color: var(--border);
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

/* Login Page */
.login-page body {
    display: block;
    background: var(--bg-secondary);
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background: var(--primary-hover);
}

.btn-inline {
    width: auto;
    padding: 0.75rem 1.5rem;
}

.btn-small {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}

.btn-link:hover {
    color: var(--text);
}

/* Login Footer */
.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Header with Actions */
.header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

/* Teams Grid */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.team-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: border-color 0.15s ease;
}

.team-card:hover {
    border-color: var(--primary);
}

.team-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 1rem;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s ease;
}

.project-card:hover {
    border-color: var(--primary);
}

.project-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.project-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Table */
.table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.data-table th {
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.data-table th:first-child {
    border-radius: 0.75rem 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 0.75rem 0 0;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

.issue-title {
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.issue-title:hover {
    color: var(--primary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-active {
    background: #dcfce7;
    color: #166534;
}

.badge-resolved {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-ignored {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-error,
.badge-fatal {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Issue Detail */
.issue-container {
    max-width: 1200px;
}

.issue-details-section {
    margin-bottom: 2rem;
}

.detail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    font-weight: 500;
    font-size: 0.875rem;
}

.description-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Events */
.events-section {
    margin-top: 2rem;
}

.events-section > h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.event-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.event-header {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.event-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.event-id {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.event-time {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.sdk-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
}

.event-content {
    padding: 1.5rem;
}

.event-top-raw {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-user {
    font-family: ui-monospace, monospace;
    font-size: 0.875rem;
    background: var(--bg-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

.event-message {
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Exceptions */
.exception-section {
    margin-bottom: 1.5rem;
}

.exception-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.exception-item {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.exception-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.exception-type {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: #991b1b;
}

.exception-value {
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.exception-handled {
    font-size: 0.7rem;
}

/* Stack Trace */
.stacktrace {
    margin-top: 1rem;
}

.stacktrace h5 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.stack-frame {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.stack-frame.in-app {
    border-left: 3px solid var(--primary);
}

.frame-header {
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.frame-function {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: var(--text);
}

.frame-module {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.frame-location {
    padding: 0.5rem 1rem;
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.frame-context {
    background: var(--bg-secondary);
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    overflow-x: auto;
}

.context-line {
    padding: 0.125rem 1rem;
    white-space: pre;
}

.context-line.pre-context,
.context-line.post-context {
    color: var(--text-muted);
}

.context-line.current-line {
    background: rgba(26, 26, 26, 0.1);
    color: var(--text);
}

/* Event Breadcrumbs */
.breadcrumbs-section {
    margin-bottom: 1.5rem;
}

.breadcrumbs-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.breadcrumbs-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
}

.breadcrumb-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.breadcrumb-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.breadcrumb-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    min-width: 80px;
    text-align: center;
    border: 1px solid var(--border);
}

.breadcrumb-message {
    color: var(--text);
    font-size: 0.875rem;
}

/* Context Sections */
.meta-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.meta-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.contexts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.context-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
}

.context-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    text-transform: capitalize;
    font-size: 0.875rem;
}

.context-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.context-key {
    color: var(--text-muted);
}

.context-val {
    color: var(--text);
}

.request-details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
}

.request-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.request-url {
    font-family: ui-monospace, monospace;
    color: var(--text);
    word-break: break-all;
}

.modules-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.module-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.module-name {
    color: var(--text);
    font-family: ui-monospace, monospace;
}

.module-version {
    color: var(--text-muted);
    font-family: ui-monospace, monospace;
}

.no-events {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
}

.actions {
    display: flex;
    gap: 0.75rem;
}

/* Status Management */
.status-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dropdown {
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 120px;
}

.status-dropdown:hover {
    border-color: var(--primary);
}

.status-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}
