/* ============================================
   OCC COMPANY PAGES — UNIFIED GLASS DARK THEME
   Единый стиль для всех страниц руководителя:
   Dashboard, CRM, Finances, Team Control, Leads
   ============================================ */

/* ---- Override narrow containers ---- */
.dash-v2,
.crm-container,
.fin-container,
.tc-container,
.leads-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 80px;
}

/* ---- Page headers — unified ---- */
.dash-top,
.crm-header,
.fin-header,
.tc-header,
.leads-header {
    margin-bottom: 28px;
}

.crm-header h1,
.fin-header h1,
.tc-header h1,
.leads-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.crm-header p,
.fin-header p,
.tc-header p,
.leads-header p {
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}

/* ---- Stats rows — wider, bigger ---- */
.stats-row,
.tc-stats,
.fin-stats {
    display: grid;
    gap: 14px;
    margin-bottom: 24px;
}

.stats-row { grid-template-columns: repeat(4, 1fr); }
.tc-stats { grid-template-columns: repeat(4, 1fr); }
.fin-stats { grid-template-columns: repeat(3, 1fr); }

.stat,
.tc-stat,
.fin-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.stat:hover,
.tc-stat:hover,
.fin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* ---- Glass cards — bigger, more spacious ---- */
.glass-card,
.section-card,
.emp-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.glass-card:hover,
.section-card:hover {
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.glass-card-header,
.section-hdr {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.glass-card-body,
.section-body {
    padding: 20px 22px;
}

/* ---- Tabs — unified style ---- */
.crm-tabs,
.fin-tabs,
.tc-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 5px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.crm-tab,
.fin-tab,
.tc-tab {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    background: none;
}

.crm-tab.active,
.fin-tab.active,
.tc-tab.active {
    background: rgba(102,126,234,0.15);
    color: #667eea;
    box-shadow: 0 2px 10px rgba(102,126,234,0.15);
}

.crm-tab:hover:not(.active),
.fin-tab:hover:not(.active),
.tc-tab:hover:not(.active) {
    color: #bbb;
    background: rgba(255,255,255,0.03);
}

/* ---- Quick grid — bigger icons ---- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.qg-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    text-decoration: none;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.25s;
}

.qg-item:hover {
    background: rgba(255,255,255,0.06);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    color: #fff;
}

.qg-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* ---- Funnel steps — bigger ---- */
.funnel-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.funnel-step {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 18px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.funnel-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.funnel-step .fs-count {
    font-size: 1.8rem;
    font-weight: 800;
}

.funnel-step .fs-label {
    font-size: 0.72rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ---- Quick form (CRM) ---- */
.quick-form {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
}

.qf-input,
.qf-select {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    padding: 12px 16px;
    font-size: 0.9rem;
}

.qf-input:focus,
.qf-select:focus {
    border-color: rgba(102,126,234,0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.qf-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    background: rgba(16,185,129,0.15);
    color: #10b981;
    transition: all 0.2s;
}

.qf-btn:hover {
    background: rgba(16,185,129,0.25);
    box-shadow: 0 4px 15px rgba(16,185,129,0.2);
}

/* ---- Employee cards (Team Control) — bigger ---- */
.emp-card {
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 20px;
}

.emp-card:hover {
    border-color: rgba(102,126,234,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.emp-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 1.2rem;
}

.emp-name {
    font-size: 1.05rem;
}

.emp-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.emp-metric {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.emp-metric .em-val {
    font-size: 1.2rem;
    font-weight: 800;
}

/* ---- Tables — glass style ---- */
table,
.pnl-table,
.ops-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table th,
.pnl-table th,
.ops-table th {
    background: rgba(255,255,255,0.03);
    color: #888;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

table td,
.pnl-table td,
.ops-table td {
    padding: 14px 16px;
    color: #fff;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

table tr:hover td,
.pnl-table tr:hover td,
.ops-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

table tr:last-child td {
    border-bottom: none;
}

/* ---- Forms inside pages ---- */
.fin-container input,
.fin-container select,
.tc-container input,
.tc-container select,
.crm-container input:not(.qf-input),
.crm-container select:not(.qf-select) {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: #fff;
    padding: 10px 14px;
    font-size: 0.88rem;
    transition: border-color 0.2s;
}

.fin-container input:focus,
.fin-container select:focus,
.tc-container input:focus,
.tc-container select:focus {
    border-color: rgba(102,126,234,0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* ---- Buttons inside pages ---- */
.fin-container button:not(.fin-tab),
.tc-container button:not(.tc-tab) {
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

/* ---- Alert cards — unified ---- */
.alert-card,
.tc-alert,
.cash-gap-alert {
    border-radius: 18px;
    padding: 16px;
}

/* ---- Source cards (CRM analytics) ---- */
.source-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
}

/* ---- Lead rows ---- */
.lead-row,
.lead-pending-row {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.lead-row:hover,
.lead-pending-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
}

/* ---- Scrollbar ---- */
.crm-tabs::-webkit-scrollbar,
.fin-tabs::-webkit-scrollbar,
.tc-tabs::-webkit-scrollbar,
.funnel-row::-webkit-scrollbar {
    height: 4px;
}

.crm-tabs::-webkit-scrollbar-track,
.fin-tabs::-webkit-scrollbar-track,
.tc-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.crm-tabs::-webkit-scrollbar-thumb,
.fin-tabs::-webkit-scrollbar-thumb,
.tc-tabs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .dash-v2,
    .crm-container,
    .fin-container,
    .tc-container {
        padding: 16px 12px 60px;
    }

    .stats-row,
    .tc-stats { grid-template-columns: repeat(2, 1fr); }
    .fin-stats { grid-template-columns: 1fr 1fr; }
    .quick-grid { grid-template-columns: repeat(3, 1fr); }
    .emp-metrics { grid-template-columns: repeat(2, 1fr); }
    .funnel-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-row,
    .tc-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .fin-stats { grid-template-columns: 1fr; }
    .funnel-row { grid-template-columns: 1fr 1fr; }
}
