/* PaymentSync v2.1 - Style */

/* ========== DARK THEME (default) ========== */
:root, [data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --mbank: #10b981;
    --santander: #ef4444;
    --input-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.05);
    --table-border: rgba(255, 255, 255, 0.05);
}

/* ========== LIGHT THEME ========== */
[data-theme="light"] {
    --bg-primary: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: rgba(0, 0, 0, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --input-bg: rgba(255, 255, 255, 0.9);
    --hover-bg: rgba(0, 0, 0, 0.03);
    --table-border: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] body {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 50%, #cbd5e1 100%);
}

[data-theme="light"] .logo h1 {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #1e293b;
    background-clip: unset;
    color: #1e293b;
}

[data-theme="light"] .logo p {
    color: #475569;
}

[data-theme="light"] .nav {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .nav a:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Theme button in nav */
.theme-btn {
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}
.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
[data-theme="light"] .theme-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .card,
[data-theme="light"] .stat-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dropzone {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .dropzone:hover,
[data-theme="light"] .dropzone.dragover {
    background: rgba(99, 102, 241, 0.05);
}

[data-theme="light"] tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] td {
    border-bottom-color: var(--table-border);
}

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select {
    background: var(--input-bg);
    border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .month-group {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .month-header {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .month-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .btn-ghost {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

[data-theme="light"] .export-card {
    background: rgba(0, 0, 0, 0.02);
}

/* Theme button is now in header nav - see .theme-btn */

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.nav a {
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.nav a.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.primary { background: rgba(99, 102, 241, 0.2); color: var(--accent-primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 20px;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.dropzone-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 15px;
}

.dropzone h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.dropzone p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

tr.new-account {
    background: rgba(239, 68, 68, 0.1);
}

tr.unknown-client {
    background: rgba(245, 158, 11, 0.1);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-primary { background: rgba(99, 102, 241, 0.2); color: var(--accent-primary); }
.badge-mbank { background: rgba(16, 185, 129, 0.2); color: var(--mbank); }
.badge-santander { background: rgba(239, 68, 68, 0.2); color: var(--santander); }
.badge-erste { background: rgba(0, 102, 179, 0.2); color: #0066b3; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"],
select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

input:focus, select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

.id-input {
    width: 80px;
    padding: 6px 10px;
    text-align: center;
}

/* Month Groups */
.month-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.month-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    flex-wrap: wrap;
    gap: 10px;
}

.month-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.month-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.month-content {
    display: none;
}

.month-content.active {
    display: block;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Export Cards */
.export-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.export-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.export-card h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.export-card .amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    margin: 15px 0;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-info {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-primary);
}

/* Empty State */
.empty-state {
    padding: 60px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 15px;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .form-group input {
    width: 100%;
}

.login-box .btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* Utilities */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: monospace; font-size: 12px; }
.font-bold { font-weight: 700; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==== DARK THEME SELECT / FILTER ==== */

/* ==== DARK THEME SELECT / FILTER (MATCH UI) ==== */

select,
input[type="text"] {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* hover */
select:hover,
input[type="text"]:hover {
    border-color: var(--accent-primary);
}

/* focus */
select:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.25);
}
