/* Webpay CRM — фирменный стиль (тёмно-синий + бирюза) */
:root {
    --c-bg: #f5f7fb;
    --c-card: #ffffff;
    --c-text: #0f172a;
    --c-muted: #64748b;
    --c-border: #e2e8f0;
    --c-primary: #0b3d91;
    --c-primary-2: #1e5fd9;
    --c-accent: #06b6d4;
    --c-accent-2: #0891b2;
    --c-success: #10b981;
    --c-warning: #f59e0b;
    --c-danger: #ef4444;
    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow-md: 0 4px 16px rgba(15,23,42,.08);
}

* { box-sizing: border-box; }

body {
    background: var(--c-bg);
    color: var(--c-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* Navbar */
.sidebar-nav {
    background: linear-gradient(180deg, #0b3d91 0%, #1e3a8a 100%);
    box-shadow: var(--shadow-sm);
    padding: .6rem 0;
    color: #fff;
}
.sidebar-nav .navbar-brand { color: #fff; letter-spacing: .3px; }
.sidebar-nav .nav-link { color: rgba(255,255,255,.78); display: inline-flex; align-items: center; gap: 6px; padding: .5rem .9rem; border-radius: 8px; }
.sidebar-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-nav .nav-link.active { color: #fff; background: rgba(255,255,255,.16); font-weight: 600; }
.sidebar-nav .nav-link svg { width: 16px; height: 16px; }
.sidebar-nav .navbar-toggler { border-color: rgba(255,255,255,.3); }
.sidebar-nav .dropdown-toggle::after { color: rgba(255,255,255,.6); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--c-accent); color: #fff; font-weight: 700; font-size: 12px;
    margin-right: 6px;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--c-accent); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; text-transform: uppercase;
}

/* Cards & layout */
.card { border: 1px solid var(--c-border); border-radius: 10px; box-shadow: var(--shadow-sm); }
.card-header { background: #fff; border-bottom: 1px solid var(--c-border); font-weight: 600; }
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.page-subtitle { color: var(--c-muted); margin-bottom: 1.4rem; }

.btn-primary { background: var(--c-primary); border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-2); border-color: var(--c-primary-2); }
.btn-accent { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.btn-accent:hover { background: var(--c-accent-2); border-color: var(--c-accent-2); color: #fff; }

a { color: var(--c-primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Stats */
.stat-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eff6ff; color: var(--c-primary-2);
}
.stat-icon.accent { background: #ecfeff; color: var(--c-accent-2); }
.stat-icon.success { background: #ecfdf5; color: #047857; }
.stat-icon.warning { background: #fffbeb; color: #b45309; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--c-muted); font-size: .85rem; margin-top: 4px; }

/* Kanban board */
.kanban {
    display: flex; gap: 12px; overflow-x: auto;
    padding-bottom: 8px;
}
.kanban-col {
    min-width: 260px; max-width: 260px;
    background: #eef2f7; border-radius: 10px; padding: 8px;
    display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.kanban-col-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 8px 10px; font-weight: 600; color: #0f172a;
}
.kanban-col-header .count {
    background: rgba(15,23,42,.1); border-radius: 999px;
    font-size: .7rem; padding: 1px 8px; font-weight: 600;
}
.kanban-col-body { overflow-y: auto; flex: 1; }
.deal-card {
    background: #fff; border-radius: 8px; padding: 10px 12px;
    margin-bottom: 8px; box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--c-primary);
    cursor: pointer; transition: box-shadow .15s, transform .15s;
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.deal-card .title { font-weight: 600; color: var(--c-text); margin-bottom: 4px; font-size: .92rem; }
.deal-card .meta { color: var(--c-muted); font-size: .78rem; display: flex; gap: 10px; flex-wrap: wrap; }
.deal-card .meta span { display: inline-flex; align-items: center; gap: 3px; }
.deal-card .meta svg { width: 12px; height: 12px; }

/* Stage badge */
.stage-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 999px;
    font-size: .75rem; font-weight: 600; color: #fff;
    white-space: nowrap;
}

/* Login */
.login-wrap {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0b3d91 0%, #06b6d4 100%);
    padding: 16px;
}
.login-card {
    background: #fff; border-radius: 14px;
    width: 100%; max-width: 400px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.login-card .sub { color: var(--c-muted); margin-bottom: 24px; font-size: .9rem; }
.login-card .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; margin-bottom: 14px; }

/* Forms */
.form-label { font-weight: 500; font-size: .85rem; color: #374151; }
.form-control, .form-select { border-color: var(--c-border); }
.form-control:focus, .form-select:focus {
    border-color: var(--c-primary-2);
    box-shadow: 0 0 0 .2rem rgba(30,95,217,.15);
}

/* Tables */
.table { background: #fff; border-radius: 10px; overflow: hidden; }
.table thead th { background: #f8fafc; color: var(--c-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; }
.table td { vertical-align: middle; }

/* Timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: ''; position: absolute; left: 8px; top: 4px; bottom: 0;
    width: 2px; background: var(--c-border);
}
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item::before {
    content: ''; position: absolute; left: -19px; top: 5px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--c-primary-2); border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--c-border);
}
.timeline-item .ts { color: var(--c-muted); font-size: .78rem; }
.timeline-item .who { font-weight: 600; }

/* Task */
.task-item { padding: 12px; border-bottom: 1px solid var(--c-border); }
.task-item:last-child { border-bottom: 0; }
.task-item.done { opacity: .55; }
.task-item.done .title { text-decoration: line-through; }
.priority-high { color: var(--c-danger); }
.priority-normal { color: var(--c-muted); }
.priority-low { color: #94a3b8; }

/* Misc */
.empty {
    text-align: center; padding: 40px 20px; color: var(--c-muted);
}
.empty svg { width: 48px; height: 48px; opacity: .4; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .kanban-col { min-width: 240px; max-width: 240px; }
}
