/* === SEO Dashboard - fullsite.pl === */
:root {
    --navy: #1C2B4A;
    --navy-light: #2a3d63;
    --orange: #F26522;
    --orange-hover: #e05510;
    --bg: #F7F6F3;
    --white: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --border: #E0DDD8;
    --green: #22C55E;
    --yellow: #EAB308;
    --red: #EF4444;
    --sidebar-w: 250px;
}

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === LOGIN PAGE === */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
}
.login-box {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box h1 {
    color: var(--navy);
    font-size: 24px;
    margin-bottom: 8px;
}
.login-box .subtitle {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 13px;
}
.login-box .logo-text {
    color: var(--orange);
    font-weight: 700;
}

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--navy);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(242,101,34,0.1);
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-group .help-text { font-size: 12px; color: var(--text-light); margin-top: 4px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-primary {
    background: var(--orange);
    color: var(--white);
}
.btn-primary:hover { background: var(--orange-hover); }
.btn-secondary {
    background: var(--navy);
    color: var(--white);
}
.btn-secondary:hover { background: var(--navy-light); }
.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--navy); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-success { background: var(--green); color: var(--white); }

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* === LAYOUT === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-w);
    background: var(--navy);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
}
.sidebar-header h2 span { color: var(--orange); }
.sidebar-header .sidebar-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-nav a:hover {
    color: var(--white);
    background: rgba(255,255,255,0.05);
}
.sidebar-nav a.active {
    color: var(--white);
    background: rgba(242,101,34,0.15);
    border-right: 3px solid var(--orange);
}
.sidebar-nav a .nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-footer a {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    text-decoration: none;
}
.sidebar-footer a:hover { color: var(--white); }

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 0;
}
.topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar h1 { font-size: 20px; color: var(--navy); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.content-area { padding: 30px; }

/* === CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid var(--border);
}
.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.stat-card .stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    margin: 4px 0;
}
.stat-card .stat-change {
    font-size: 12px;
    font-weight: 600;
}
.stat-card .stat-change.up { color: var(--green); }
.stat-card .stat-change.down { color: var(--red); }

.card {
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 { font-size: 15px; color: var(--navy); }
.card-body { padding: 20px; }

/* === TABLES === */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
}
thead th {
    background: #F8F7F4;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
tbody tr:nth-child(even) { background: #FAFAF8; }
tbody tr:hover { background: #F0EFE9; }

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: #DCFCE7; color: #166534; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: #F3F4F6; color: #4B5563; }

/* === TABS === */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    gap: 0;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    font-family: inherit;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active {
    color: var(--orange);
    border-bottom-color: var(--orange);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === ONBOARDING STEPS === */
.steps-bar {
    display: flex;
    margin-bottom: 30px;
    gap: 0;
}
.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 12px 8px;
}
.step-item::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border);
}
.step-item:first-child::before { left: 50%; }
.step-item:last-child::before { right: 50%; }
.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    position: relative;
    z-index: 2;
}
.step-item.active .step-num {
    background: var(--orange);
    color: var(--white);
}
.step-item.done .step-num {
    background: var(--green);
    color: var(--white);
}
.step-label {
    display: block;
    font-size: 11px;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: 500;
}
.step-item.active .step-label { color: var(--navy); font-weight: 600; }

/* === POSITION INDICATORS === */
.pos-up { color: var(--green); }
.pos-down { color: var(--red); }
.pos-same { color: var(--text-light); }

/* === CONNECTION TEST === */
.conn-test {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 8px;
}
.conn-test.success { background: #DCFCE7; color: #166534; }
.conn-test.fail { background: #FEE2E2; color: #991B1B; }
.conn-test.loading { background: #F3F4F6; color: #4B5563; }

/* === SPARKLINE === */
.sparkline-container { display: inline-block; vertical-align: middle; }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--navy); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* === LOADING === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .content-area { padding: 16px; }
}

/* === CHART CONTAINER === */
.chart-container {
    position: relative;
    height: 300px;
    margin: 16px 0;
}

/* === LOG/PROGRESS === */
.progress-log {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
    line-height: 1.8;
}
.progress-log .log-line { padding: 2px 0; }
.progress-log .log-ok { color: var(--green); }
.progress-log .log-err { color: var(--red); }
.progress-log .log-warn { color: var(--yellow); }
.progress-log .log-info { color: #60A5FA; }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; color: var(--navy); }
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* === GRID HELPERS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-right { text-align: right; }
