/* MotoDoc - Base Styles (Gemeinsame Komponenten) */

:root {
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --blue-light: #dbeafe;
    --red: #ef4444;
    --red-light: #fee2e2;
    --green-light: #d1fae5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Topbar */
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blue);
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
    color: var(--blue-dark);
}

.topbar-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-label {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Page Container */
.page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue);
}

.btn-primary:hover {
    background: var(--blue-dark);
    text-decoration: none;
}

.btn-outline {
    background: var(--white);
    color: var(--blue);
    border-color: var(--blue);
}

.btn-outline:hover {
    background: var(--blue-light);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    text-decoration: none;
}

.btn-danger {
    background: var(--red-light);
    color: var(--red);
    border-color: var(--red);
}

.btn-danger:hover {
    background: var(--red);
    color: var(--white);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.w-full {
    width: 100%;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.card h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.card-meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

/* Grid Layout */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
}

/* Forms */
.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.25rem;
}

.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: var(--white);
    color: var(--gray-900);
    outline: none;
}

.input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
}

textarea.input {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

/* Alerts */
.alert {
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: var(--red-light);
    color: var(--red);
    border: 1px solid var(--red);
}

.alert-success {
    background: var(--green-light);
    color: #065f46;
    border: 1px solid #10b981;
}

/* Tables */
.table-wrapper {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
}

.table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-700);
}

.table tbody tr {
    border-bottom: 1px solid var(--gray-200);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Footer */
.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: auto;
}

/* Responsive Base */
@media (max-width: 768px) {
    .topbar {
        padding: 0.75rem 1rem;
    }
    
    .topbar-subtitle {
        display: none;
    }
    
    .page {
        padding: 1.5rem 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .page-header-actions {
        width: 100%;
    }
    
    .page-header-actions .btn {
        flex: 1;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 1rem;
    }
    
    .btn {
        font-size: 0.8125rem;
    }
    
    .form {
        gap: 0.875rem;
    }
}