@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --surface2: #f0f2f6;
    --border: #e3e8ef;
    --border-strong: #cdd5e0;
    --accent: #2563eb;
    --accent-light: #eff4ff;
    --accent-hover: #1d4ed8;
    --accent2: #0ea5e9;
    --accent2-light: #f0f9ff;
    --accent3: #ef4444;
    --accent3-light: #fef2f2;
    --accent-green: #16a34a;
    --accent-green-light: #f0fdf4;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --text-placeholder: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 10px rgba(0,0,0,0.04);
    --sidebar-w: 256px;
    --radius: 10px;
    --radius-lg: 14px;
  }

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

  body {
    font-family: 'Geist', 'DM Mono', monospace;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* ─── SIDEBAR ─── */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
  }

  .sidebar::before {
    content: '';
    position: absolute;
    top: -60px; left: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(37,99,235,0.05) 0%, transparent 70%);
    pointer-events: none;
  }

  .logo {
    padding: 24px 20px 22px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .logo-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Geist', sans-serif;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.4px;
    color: var(--text);
  }

  .logo-badge .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
    animation: pulse 2.4s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
    50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(37,99,235,0.07); }
  }

  .logo-sub {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-top: 3px;
    padding-left: 15px;
    font-family: 'Geist Mono', 'DM Mono', monospace;
  }

  .nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar { display: none; }

  .nav-section-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 14px 10px 6px;
    font-weight: 500;
    font-family: 'Geist Mono', monospace;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.12s ease;
    position: relative;
    margin-bottom: 1px;
  }

  .nav-item:hover {
    background: var(--surface2);
    color: var(--text);
  }

  .nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 500;
  }

  .nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 6px; bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--accent);
  }

  .nav-icon {
    width: 17px; height: 17px;
    flex-shrink: 0;
    opacity: 0.6;
  }

  .nav-item.active .nav-icon { opacity: 1; }
  .nav-item:hover .nav-icon { opacity: 0.85; }

  .nav-badge {
    margin-left: auto;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    font-family: 'Geist Mono', monospace;
  }

  .nav-badge.soon {
    background: var(--surface2);
    color: var(--text-dim);
    font-weight: 400;
  }

  .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }

  .user-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geist', sans-serif;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(37,99,235,0.25);
  }

  .user-info { flex: 1; min-width: 0; }
  .user-name { font-size: 12.5px; color: var(--text); font-weight: 500; }
  .user-role { font-size: 11px; color: var(--text-muted); }

  /* ─── MAIN ─── */
  .main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .topbar-title {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: -0.3px;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .search-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 13px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    color: var(--text);
    width: 220px;
    outline: none;
    transition: all 0.15s;
  }

  .search-input::placeholder { color: var(--text-placeholder); }

  .search-input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  }

  .topbar-date {
    font-size: 12px;
    color: var(--text-muted);
    padding: 7px 13px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Geist Mono', monospace;
  }

  .content {
    padding: 32px;
  }

  /* ─── WELCOME ─── */
  .welcome-block {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
    border: none;
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
  }

  .welcome-block::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
  }

  .welcome-block::after {
    content: 'SEO';
    position: absolute;
    right: 40px; top: 50%;
    transform: translateY(-50%);
    font-family: 'Geist', sans-serif;
    font-weight: 800;
    font-size: 110px;
    color: rgba(255,255,255,0.06);
    line-height: 1;
    letter-spacing: -4px;
    pointer-events: none;
  }

  .welcome-tag {
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    margin-bottom: 10px;
    font-family: 'Geist Mono', monospace;
  }

  .welcome-title {
    font-family: 'Geist', sans-serif;
    font-weight: 700;
    font-size: 30px;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
    color: #fff;
  }

  .welcome-title span { color: rgba(255,255,255,0.75); }

  .welcome-desc {
    font-size: 13.5px;
    color: rgba(255,255,255,0.65);
    line-height: 1.7;
    max-width: 480px;
  }

  /* ─── STATS ROW ─── */
  .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 28px;
  }

  .stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: default;
    box-shadow: var(--shadow-sm);
  }

  .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .stat-label {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-family: 'Geist Mono', monospace;
  }

  .stat-value {
    font-family: 'Geist', sans-serif;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 5px;
    color: var(--text);
  }

  .stat-value.green { color: var(--accent-green); }
  .stat-value.teal { color: var(--accent2); }
  .stat-value.red { color: var(--accent3); }
  .stat-value.blue { color: var(--accent); }

  .stat-delta {
    font-size: 12px;
    color: var(--text-muted);
  }

  .stat-delta.up { color: var(--accent-green); }
  .stat-delta.down { color: var(--accent3); }

  /* ─── TOOLS GRID ─── */
  .section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
  }

  .section-title {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.2px;
  }

  .section-count {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'Geist Mono', monospace;
  }

  .tools-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
  }

  .tool-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    box-shadow: var(--shadow-sm);
  }

  .tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
  }

  .tool-card:hover .tool-arrow { opacity: 1; transform: translate(0,0); }

  .tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .tool-card:hover::before { opacity: 1; }

  .tool-card[data-color="green"]::before { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
  .tool-card[data-color="teal"]::before { background: linear-gradient(90deg, transparent, var(--accent2), transparent); }
  .tool-card[data-color="red"]::before { background: linear-gradient(90deg, transparent, var(--accent3), transparent); }

  .tool-icon-wrap {
    width: 40px; height: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 19px;
  }

  .tool-icon-wrap.green { background: var(--accent-light); }
  .tool-icon-wrap.teal  { background: var(--accent2-light); }
  .tool-icon-wrap.red   { background: var(--accent3-light); }

  .tool-name {
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 14.5px;
    margin-bottom: 5px;
    color: var(--text);
    letter-spacing: -0.2px;
  }

  .tool-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
  }

  .tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .tool-tag {
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: 'Geist Mono', monospace;
  }

  .tool-tag.green { border-color: rgba(22,163,74,0.25); color: var(--accent-green); background: var(--accent-green-light); }
  .tool-tag.teal  { border-color: rgba(14,165,233,0.25); color: var(--accent2); background: var(--accent2-light); }
  .tool-tag.soon  { color: var(--text-dim); background: var(--surface2); }

  .tool-arrow {
    font-size: 17px;
    color: var(--accent);
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: all 0.18s ease;
  }

  /* ─── PANELS ─── */
  .bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
  }

  .panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
  }

  .panel-action {
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.5px;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: 500;
    transition: color 0.12s;
  }

  .panel-action:hover { color: var(--accent-hover); }

  .activity-list { padding: 4px 0; }

  .activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    transition: background 0.12s;
  }

  .activity-item:hover { background: var(--surface2); }

  .activity-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .activity-dot.green { background: var(--accent-green); box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
  .activity-dot.teal  { background: var(--accent2); box-shadow: 0 0 0 3px rgba(14,165,233,0.12); }
  .activity-dot.red   { background: var(--accent3); box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

  .activity-text { flex: 1; font-size: 12.5px; color: var(--text-muted); }
  .activity-text strong { color: var(--text); font-weight: 500; }
  .activity-time { font-size: 11px; color: var(--text-dim); font-family: 'Geist Mono', monospace; }

  .tip-list { padding: 4px 0; }

  .tip-item {
    padding: 12px 20px;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
  }

  .tip-item:last-child { border-bottom: none; }
  .tip-item:hover { background: var(--surface2); }

  .tip-item .tip-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 4px;
    font-weight: 600;
    font-family: 'Geist Mono', monospace;
  }

  /* ─── BUTTONS (ogólne) ─── */
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
  }

  .btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(37,99,235,0.25);
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 10px rgba(37,99,235,0.3);
    transform: translateY(-1px);
  }

  .btn-secondary {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
  }

  .btn-secondary:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
  }

  /* ─── TABLES ─── */
  .projects-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
  }

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

  .projects-table th {
    padding: 11px 18px;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
    background: var(--surface2);
    font-family: 'Geist Mono', monospace;
  }

  .projects-table td {
    padding: 13px 18px;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .projects-table tr:last-child td { border-bottom: none; }
  .projects-table tr:hover td { background: var(--surface2); }

  .project-name { font-weight: 500; color: var(--text); font-size: 13.5px; }
  .project-domain { font-family: 'Geist Mono', monospace; font-size: 11.5px; color: var(--text-dim); }

  .proj-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Geist Mono', monospace;
  }

  .proj-status.active { background: var(--accent-green-light); color: var(--accent-green); border: 1px solid rgba(22,163,74,0.2); }
  .proj-status.draft  { background: var(--surface2); color: var(--text-dim); border: 1px solid var(--border); }
  .proj-status.done   { background: var(--accent2-light); color: var(--accent2); border: 1px solid rgba(14,165,233,0.2); }

  .td-actions { display: flex; gap: 6px; align-items: center; }

  .btn-row-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: 'Geist Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all 0.12s;
  }

  .btn-row-action:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
  .btn-row-action.danger:hover { border-color: rgba(239,68,68,0.4); color: var(--accent3); background: var(--accent3-light); }

  .projects-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    color: var(--text);
    width: 240px;
    outline: none;
    transition: all 0.15s;
  }

  .projects-search::placeholder { color: var(--text-placeholder); }
  .projects-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

  .projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* ─── SCROLLBAR ─── */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

  /* ─── ANIMATIONS ─── */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .welcome-block { animation: fadeUp 0.45s ease 0.05s both; }
  .stats-row     { animation: fadeUp 0.45s ease 0.12s both; }
  .tools-grid    { animation: fadeUp 0.45s ease 0.2s both; }
  .bottom-grid   { animation: fadeUp 0.45s ease 0.28s both; }