/* =============================================================================
   Adressvalidierung Dashboard — Styles
   ============================================================================= */

:root {
    --bg: #f5f5f5;
    --card-bg: #ffffff;
    --border: #e0e0e0;
    --text: #333333;
    --text-muted: #888888;
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ea580c;
    --changed-bg: #fef3c7;
    --changed-border: #f59e0b;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
    padding-bottom: 2px;
}

.nav-logout { color: var(--danger) !important; }

/* --- Container --- */
.container {
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
}

/* --- Header Row --- */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 0.75rem; }

/* --- Status Tabs --- */
.status-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.tab {
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.9rem;
}

.tab.active {
    background: var(--primary);
    color: white;
}

.badge {
    display: inline-block;
    min-width: 20px;
    text-align: center;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.75rem;
    margin-left: 4px;
}

.tab.active .badge { background: rgba(255,255,255,0.3); }

/* --- Order Cards --- */
.order-list { display: flex; flex-direction: column; gap: 1rem; }

.order-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

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

.order-date { color: var(--text-muted); font-size: 0.85rem; }

/* --- Confidence Badge --- */
.confidence-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.confidence-badge.high { background: #dcfce7; color: var(--success); }
.confidence-badge.medium { background: #fff7ed; color: var(--warning); }
.confidence-badge.low { background: #fef2f2; color: var(--danger); }

/* --- Error Tags --- */
.error-tag {
    display: inline-block;
    padding: 2px 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    font-size: 0.75rem;
    color: #475569;
    margin-left: 4px;
}

/* --- Address Comparison --- */
.address-comparison {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.address-col {
    flex: 1;
    padding: 0.75rem;
    border-radius: 6px;
    background: #fafafa;
}

.address-col h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.address-col.suggested { background: #f0fdf4; }

.addr-line {
    font-size: 0.95rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.addr-line.changed {
    background: var(--changed-bg);
    border-left: 3px solid var(--changed-border);
    padding-left: 8px;
    font-weight: 600;
}

.arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    align-self: center;
    flex-shrink: 0;
}

/* --- Error Details --- */
.error-details {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.error-item { padding: 2px 0; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: #94a3b8; color: white; }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.8rem; }

.btn:hover { opacity: 0.9; }

.order-actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Forms --- */
.bulk-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.input-small {
    width: 70px;
    padding: 0.3rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
}

.inline-form { display: inline; }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
}

.stat-number { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }

/* --- Data Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.data-table th, .data-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Settings --- */
.settings-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.settings-info code {
    background: #dbeafe;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.85rem;
}

.toggle { cursor: pointer; }
.toggle input { margin-right: 4px; }

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.pagination a {
    color: var(--primary);
    text-decoration: none;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Login --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.login-card h1 { text-align: center; margin-bottom: 0.25rem; }
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 1.5rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.3rem; font-size: 0.9rem; }
.form-group input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

.btn-full { width: 100%; margin-top: 0.5rem; padding: 0.65rem; font-size: 1rem; }

.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: center;
}
