/* ═══════════════════════════════════════════════════════════════════
   MyComBox ShowCase — Backoffice CSS
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bo-primary: #4F46E5;
    --bo-primary-dark: #4338CA;
    --bo-primary-light: #EEF2FF;
    --bo-secondary: #0B1220;
    --bo-secondary-dark: #0F172A;
    --bo-accent: #F59E0B;
    --bo-bg: #FAFAF7;
    --bo-card: #FFFFFF;
    --bo-border: #E5E7EB;
    --bo-text: #0B1220;
    --bo-text-muted: #6B7280;
    --bo-success: #10B981;
    --bo-danger: #EF4444;
    --bo-warning: #F59E0B;
    --bo-info: #3B82F6;
    --bo-sidebar-w: 260px;
    --bo-header-h: 68px;
    --bo-radius: 16px;
}
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bo-bg); color: var(--bo-text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .bo-sidebar-header h2, .login-logo h1 { font-family: 'Fraunces', serif; letter-spacing: -0.015em; }
a { color: var(--bo-primary); text-decoration: none; transition: color .2s; }
a:hover { text-decoration: underline; color: var(--bo-primary-dark); }

/* ── LOGIN PAGE ──────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(900px 500px at 12% -20%, rgba(79,70,229,.12), transparent 60%),
                radial-gradient(700px 400px at 110% 10%, rgba(245,158,11,.08), transparent 60%),
                var(--bo-bg);
}
.login-card {
    background: white;
    border-radius: var(--bo-radius);
    padding: 52px 46px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 40px 80px -12px rgba(11,18,32,.1), 0 6px 12px rgba(11,18,32,.04);
    border: 1px solid var(--bo-border);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 1.9rem; font-weight: 700; color: var(--bo-secondary); margin-top: 16px; letter-spacing: -0.02em; }
.login-logo h1 span { color: var(--bo-primary); }
.login-logo p { font-size: .88rem; color: var(--bo-text-muted); margin-top: 6px; }
.login-error { background: #FEF2F2; color: var(--bo-danger); border: 1px solid #FECACA; padding: 10px 14px; border-radius: 10px; font-size: .85rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

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

/* Sidebar */
.bo-sidebar { width: var(--bo-sidebar-w); background: var(--bo-secondary-dark); color: white; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform .3s; }
.bo-sidebar-header { padding: 20px 22px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; }
.bo-sidebar-header h2 { font-size: 1.05rem; font-weight: 700; }
.bo-sidebar-header h2 span { color: var(--bo-primary); }
.bo-sidebar-header .role-badge { font-size: .65rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.7); }
.bo-sidebar nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.bo-nav-section { padding: 8px 22px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.35); font-weight: 600; }
.bo-nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 22px; color: rgba(255,255,255,.65); font-size: .88rem; font-weight: 500; transition: all .15s; cursor: pointer; text-decoration: none; border: none; background: none; width: 100%; text-align: left; }
.bo-nav-item:hover { color: white; background: rgba(255,255,255,.05); text-decoration: none; }
.bo-nav-item.active { color: white; background: rgba(255,255,255,.08); border-right: 3px solid var(--bo-primary); }
.bo-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.bo-nav-badge { margin-left: auto; background: var(--bo-danger); color: white; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; min-width: 18px; text-align: center; }
.bo-sidebar-footer { padding: 14px 22px; border-top: 1px solid rgba(255,255,255,.08); }

/* Main content */
.bo-main { flex: 1; margin-left: var(--bo-sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.bo-header {
    height: var(--bo-header-h);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--bo-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.bo-header-left { display: flex; align-items: center; gap: 12px; }
.bo-header-left h1 { font-size: 1.2rem; font-weight: 700; color: var(--bo-secondary); }
.bo-header-right { display: flex; align-items: center; gap: 12px; }
.bo-header-user { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 500; }
.bo-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--bo-primary), var(--bo-accent)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .82rem; }
.bo-btn-logout { display: flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--bo-border); background: white; color: var(--bo-text-muted); font-size: .8rem; cursor: pointer; transition: all .2s; }
.bo-btn-logout:hover { border-color: var(--bo-danger); color: var(--bo-danger); }
.bo-mobile-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--bo-text); }

/* Page content */
.bo-content { flex: 1; padding: 28px 32px 48px; }

/* ── STAT CARDS ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
    background: var(--bo-card);
    border-radius: var(--bo-radius);
    padding: 22px 24px;
    border: 1px solid var(--bo-border);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform .22s cubic-bezier(.4,0,.2,1), box-shadow .22s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 2px 4px rgba(11,18,32,.04), 0 1px 2px rgba(11,18,32,.02);
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(11,18,32,.06), 0 2px 4px rgba(11,18,32,.04);
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.reads { background: rgba(59,130,246,.1); color: var(--bo-info); }
.stat-icon.prospects { background: rgba(16,185,129,.1); color: var(--bo-success); }
.stat-icon.contacts { background: rgba(245,158,11,.1); color: var(--bo-warning); }
.stat-icon.visitors { background: rgba(139,92,246,.1); color: #8B5CF6; }
.stat-icon.danger { background: rgba(239,68,68,.1); color: var(--bo-danger); }
.stat-info h3 { font-size: 1.7rem; font-weight: 800; color: var(--bo-text); line-height: 1; }
.stat-info p { font-size: .78rem; color: var(--bo-text-muted); margin-top: 4px; font-weight: 500; }

/* ── DATA TABLE ──────────────────────────────────────────────── */
.bo-section {
    background: var(--bo-card);
    border-radius: var(--bo-radius);
    border: 1px solid var(--bo-border);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(11,18,32,.04), 0 1px 2px rgba(11,18,32,.02);
}
.bo-section-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid var(--bo-border); }
.bo-section-header h2 { font-size: 1.05rem; font-weight: 700; color: var(--bo-secondary); display: flex; align-items: center; gap: 8px; }
.bo-section-body { padding: 20px 24px; }
.bo-table-wrap { overflow-x: auto; }
.bo-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.bo-table thead th { text-align: left; padding: 10px 14px; background: #F9FAFB; color: var(--bo-text-muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--bo-border); white-space: nowrap; }
.bo-table tbody td { padding: 12px 14px; border-bottom: 1px solid #F3F4F6; vertical-align: middle; }
.bo-table tbody tr:hover { background: #FAFBFD; }
.bo-table tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ──────────────────────────────────────────────────── */
.bo-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.bo-badge.admin { background: rgba(232,80,26,.1); color: var(--bo-primary); }
.bo-badge.client { background: rgba(59,130,246,.1); color: var(--bo-info); }
.bo-badge.public { background: rgba(16,185,129,.1); color: var(--bo-success); }
.bo-badge.private { background: rgba(245,158,11,.1); color: var(--bo-warning); }
.bo-badge.locked { background: rgba(239,68,68,.1); color: var(--bo-danger); }
.bo-badge.tag { background: rgba(139,92,246,.08); color: #7C3AED; border: 1px solid rgba(139,92,246,.15); }

/* ── BUTTONS ─────────────────────────────────────────────────── */
.bo-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 10px; font-size: .85rem; font-weight: 600; cursor: pointer; border: none; transition: all .2s cubic-bezier(.4,0,.2,1); text-decoration: none; }
.bo-btn:hover { text-decoration: none; }
.bo-btn-primary { background: var(--bo-primary); color: white !important; box-shadow: 0 2px 4px rgba(79,70,229,.15); }
.bo-btn-primary:hover { background: var(--bo-primary-dark); color: white !important; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(79,70,229,.25); }
.bo-btn-outline { background: white; border: 1px solid var(--bo-border); color: var(--bo-text) !important; }
.bo-btn-outline:hover { border-color: var(--bo-primary); color: var(--bo-primary) !important; }
.bo-btn-danger { background: var(--bo-danger); color: white !important; }
.bo-btn-danger:hover { background: #DC2626; color: white !important; transform: translateY(-1px); }
.bo-btn-success { background: var(--bo-success); color: white !important; }
.bo-btn-success:hover { background: #059669; color: white !important; transform: translateY(-1px); }
.bo-btn-sm { padding: 5px 12px; font-size: .78rem; border-radius: 8px; }
.bo-btn-icon { width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; }

/* ── FORMS ────────────────────────────────────────────────────── */
.bo-form-group { margin-bottom: 16px; }
.bo-form-group label { display: block; font-size: .78rem; font-weight: 600; color: var(--bo-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.bo-input { width: 100%; border: 1.5px solid var(--bo-border); border-radius: 10px; padding: 10px 14px; font-size: .88rem; font-family: inherit; color: var(--bo-text); background: #FAFAFA; transition: all .2s ease; outline: none; }
.bo-input:focus { border-color: var(--bo-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); background: white; }
.bo-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.bo-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bo-form-help { font-size: .75rem; color: var(--bo-text-muted); margin-top: 4px; }

/* ── MODAL ────────────────────────────────────────────────────── */
.bo-modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .3s; }
.bo-modal-backdrop.active { opacity: 1; pointer-events: all; }
.bo-modal { background: white; border-radius: 20px; width: 100%; max-width: 600px; box-shadow: 0 24px 80px rgba(0,0,0,.25); overflow: hidden; transform: translateY(20px) scale(.97); transition: transform .35s cubic-bezier(.34,1.56,.64,1); max-height: 90vh; overflow-y: auto; }
.bo-modal-backdrop.active .bo-modal { transform: translateY(0) scale(1); }
.bo-modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 18px; background: linear-gradient(135deg, var(--bo-secondary), var(--bo-secondary-dark)); color: white; }
.bo-modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.bo-modal-header p { font-size: .8rem; opacity: .7; margin-top: 2px; }
.bo-modal-body { padding: 24px 26px 28px; }
.bo-modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 0 26px 22px; }

/* ── CHARTS ──────────────────────────────────────────────────── */
.chart-container { width: 100%; height: 250px; position: relative; }

/* ── EMPTY STATE ─────────────────────────────────────────────── */
.bo-empty { text-align: center; padding: 48px 20px; color: var(--bo-text-muted); }
.bo-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.bo-empty p { font-size: .9rem; }

/* ── CLIENT CARD (admin view) ────────────────────────────────── */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.client-card {
    background: var(--bo-card);
    border-radius: var(--bo-radius);
    border: 1px solid var(--bo-border);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    box-shadow: 0 2px 4px rgba(11,18,32,.04), 0 1px 2px rgba(11,18,32,.02);
}
.client-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -8px rgba(11,18,32,.12);
}
.client-card-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--bo-border); }
.client-card-logo { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #F9FAFB; padding: 4px; border: 1px solid var(--bo-border); }
.client-card-logo-placeholder { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, var(--bo-primary), var(--bo-accent)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; border: 1px solid var(--bo-border); }
.client-card-info h3 { font-size: .95rem; font-weight: 700; }
.client-card-info p { font-size: .78rem; color: var(--bo-text-muted); }
.client-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.client-card-stat { text-align: center; padding: 14px 10px; border-right: 1px solid var(--bo-border); }
.client-card-stat:last-child { border-right: none; }
.client-card-stat strong { display: block; font-size: 1.2rem; font-weight: 800; color: var(--bo-text); }
.client-card-stat span { font-size: .7rem; color: var(--bo-text-muted); font-weight: 500; }
.client-card-actions { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--bo-border); }
.client-card-actions .bo-btn { flex: 1; justify-content: center; }

/* ── TAG INPUT ───────────────────────────────────────────────── */
.tag-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1.5px solid var(--bo-border); border-radius: 10px; background: #FAFAFA; min-height: 42px; transition: border-color .2s; }
.tag-input-wrap:focus-within { border-color: var(--bo-primary); background: white; }
.tag-chip { display: flex; align-items: center; gap: 4px; background: rgba(139,92,246,.1); color: #7C3AED; border: 1px solid rgba(139,92,246,.2); padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 500; }
.tag-chip button { background: none; border: none; color: inherit; cursor: pointer; font-size: .9rem; line-height: 1; opacity: .6; }
.tag-chip button:hover { opacity: 1; }
.tag-input-field { border: none; outline: none; background: transparent; font-family: inherit; font-size: .85rem; min-width: 80px; flex: 1; padding: 2px; }

/* ── UPLOAD AREA ─────────────────────────────────────────────── */
.upload-zone { border: 2px dashed var(--bo-border); border-radius: var(--bo-radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: all .2s; background: #FAFAFA; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--bo-primary); background: rgba(232,80,26,.03); }
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-zone p { color: var(--bo-text-muted); font-size: .88rem; }
.upload-zone .upload-formats { font-size: .75rem; color: #aaa; margin-top: 4px; }
.upload-progress { margin-top: 16px; }
.upload-progress-bar { height: 6px; background: var(--bo-border); border-radius: 3px; overflow: hidden; }
.upload-progress-bar div { height: 100%; background: var(--bo-primary); border-radius: 3px; transition: width .3s; }

.bo-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.bo-grid-2to1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .bo-grid-2col { grid-template-columns: 1fr; }
    .bo-grid-2to1 { grid-template-columns: 1fr; }
    .bo-sidebar { transform: translateX(-100%); }
    .bo-sidebar.open { transform: translateX(0); }
    .bo-main { margin-left: 0; }
    .bo-mobile-toggle { display: block; }
    .bo-content { padding: 20px 16px 40px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .bo-form-row { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .stat-grid { grid-template-columns: 1fr; }
    .bo-header { padding: 0 16px; }
    .bo-header-left h1 { font-size: 1rem; }
}
