/* SIT-FileSync Web Dashboard — Design-System
   Navy + Red Accent, passend zum WPF-Design */

:root {
    --navy-dark: #1a2332;
    --navy: #243447;
    --navy-light: #2d4156;
    --red-accent: #c0392b;
    --red-hover: #e74c3c;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --gray-900: #212529;
    --success: #27ae60;
    --error: #c0392b;
    --warning: #f39c12;
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --border-radius: 6px;
}

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

body {
    font-family: var(--font-family);
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
}

/* Layout */
.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: var(--navy-dark);
    color: var(--white);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    background: var(--red-accent);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    font-size: 14px;
    opacity: 0.8;
}

.header-link,
.header-logout {
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.header-link:hover,
.header-logout:hover {
    opacity: 1;
}

.content-wrapper {
    display: flex;
    flex: 1;
}

.sidebar {
    width: 220px;
    background: var(--navy);
    padding: 16px 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--navy-light);
    color: var(--white);
}

.nav-item.active {
    background: var(--navy-light);
    color: var(--white);
    border-left-color: var(--red-accent);
}

.main-content {
    flex: 1;
    padding: 32px;
    max-width: 1200px;
}

.footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 24px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
}

/* Dashboard */
h1 {
    color: var(--navy-dark);
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 600;
}

h2 {
    color: var(--navy);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.status-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.status-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.status-ok {
    background: #e8f5e9;
    color: var(--success);
}

.status-error {
    background: #fce4e4;
    color: var(--error);
}

.source-list, .target-list {
    list-style: none;
    padding: 0;
}

.source-list li, .target-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.source-path {
    flex: 1;
    word-break: break-all;
}

.source-badge, .status-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.badge-oneway { background: #e3f2fd; color: #1565c0; }
.badge-twoway { background: #fff3e0; color: #e65100; }
.badge-ok { background: #e8f5e9; color: var(--success); }
.badge-error { background: #fce4e4; color: var(--error); }

.muted-text { color: var(--gray-500); font-style: italic; }
.error-text { color: var(--error); }

/* History Table */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.history-table th {
    background: var(--navy);
    color: var(--white);
    padding: 10px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
}

.history-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.history-table .row-error {
    background: #fef2f2;
}

/* Config */
.config-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.config-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.config-row label {
    min-width: 180px;
    font-size: 14px;
    color: var(--gray-700);
}

.input-path {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
}

.input-small {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
}

.input-field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    min-width: auto !important;
}

.config-actions {
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--red-accent);
    color: var(--white);
}

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

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

.btn-danger:hover {
    background: var(--error);
    color: var(--white);
}

.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: var(--success);
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #fce4e4;
    color: var(--error);
    border: 1px solid #f5c6c6;
}

/* Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 100%;
}

.login-card h1 {
    text-align: center;
    color: var(--navy-dark);
}

.login-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--gray-700);
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        padding: 0;
        overflow-x: auto;
    }

    .nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }

    .nav-item.active {
        border-bottom-color: var(--red-accent);
    }

    .main-content {
        padding: 16px;
    }

    .config-row {
        flex-direction: column;
        align-items: stretch;
    }

    .config-row label {
        min-width: auto;
    }
}
