:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #475569;
    --secondary-hover: #334155;
    --bg-dark: #0f172a;
    --bg-panel: rgba(30, 41, 59, 0.6);
    --bg-input: rgba(15, 23, 42, 0.4);
    --border: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(139, 92, 246, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --radius: 8px;
    --transition: 0.2s ease;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(circle at top right, #1e1b4b, #0f172a);
}

.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

.sidebar {
    width: 300px;
    background: rgba(15, 23, 42, 0.6);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

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

.template-selector label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.template-selector select {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    outline: none;
}

.reports-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    padding: 1rem;
}

.report-item {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    background: var(--bg-panel);
    border: 1px solid transparent;
}

.report-item:hover,
.report-item.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--border-focus);
}

.report-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
}

#incident-title {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    font-weight: 600;
    font-family: inherit;
    width: 400px;
    outline: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

#incident-title:focus {
    border-bottom-color: var(--border-focus);
}

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

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

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

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-ghost:hover {
    background: rgba(139, 92, 246, 0.1);
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.report-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-bottom: 4rem;
}

.form-section {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.form-section.row-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.form-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    width: 100%;
    flex: 100%;
}

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

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

input[type="text"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

textarea {
    resize: vertical;
}

.highlight {
    color: var(--primary);
    font-weight: 600;
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.list-item {
    display: flex;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius);
    align-items: flex-start;
}

.list-item input[type="time"] {
    width: auto;
}

.list-item input[type="text"] {
    flex: 1;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .sidebar,
    .header-actions,
    .btn-ghost,
    .template-selector {
        display: none;
    }

    .app-container,
    .main-content,
    .scroll-area,
    .report-form {
        display: block;
        height: auto;
        overflow: visible;
    }

    .form-section {
        background: transparent;
        border: none;
        padding: 0 0 1rem 0;
    }

    input,
    textarea,
    select {
        background: transparent;
        border: none;
        color: black;
        border-bottom: 1px solid #ddd;
        border-radius: 0;
    }

    #incident-title {
        color: black;
    }

    ::-webkit-input-placeholder {
        color: transparent;
    }
}