:root {
    --ink: #172033;
    --coral: #f26b5e;
    --sage: #8faf9b;
    --cream: #f7f4ee;
    --paper: #fffefa;
    --muted: #758092;
    --line: #e8e4dc;
    --shadow: 0 18px 45px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1, h2, h3, h4, .brand { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: -.035em; }
a { color: inherit; }
.app-shell { min-height: 100vh; }
.sidebar {
    background: var(--ink); color: white; position: fixed; inset: 0 auto 0 0; width: 260px;
    display: flex; flex-direction: column; padding: 28px 20px; z-index: 1040;
}
.brand { display: block; padding: 0 12px 36px; }
.brand img { display: block; width: 185px; filter: brightness(0) invert(1); }
.sidebar-nav { display: grid; gap: 8px; }
.sidebar-nav a { display: flex; gap: 14px; align-items: center; padding: 13px 16px; border-radius: 14px; color: #bac2cf; text-decoration: none; font-weight: 600; }
.sidebar-nav a:hover, .sidebar-nav a.active { color: white; background: rgba(255,255,255,.09); }
.sidebar-nav a.active i { color: var(--coral); }
.sidebar-user { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.12); display: flex; gap: 12px; align-items: center; }
.sidebar-user strong, .sidebar-user a, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: var(--sage); font-size: .74rem; }
.product-by { display: block; color: #6f7887; font-size: .65rem; text-align: center; padding-top: 14px; }
.sidebar-user a { color: #aab3c2; font-size: .82rem; text-decoration: none; }
.avatar { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; background: var(--coral); border-radius: 14px; font-weight: 800; }
.main-content { margin-left: 260px; padding: 42px; min-height: 100vh; }
.mobile-bar { display: none; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 5px; font-weight: 800; }
.page-heading p { margin: 0; color: var(--muted); }
.card-crm { background: var(--paper); border: 1px solid rgba(23,32,51,.04); border-radius: 22px; box-shadow: var(--shadow); }
.metric { padding: 24px; height: 100%; position: relative; overflow: hidden; }
.metric .metric-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(242,107,94,.13); color: var(--coral); margin-bottom: 22px; }
.metric strong { display: block; font: 800 2.1rem/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.metric span { color: var(--muted); font-size: .92rem; }
.metric.sage .metric-icon { background: rgba(143,175,155,.18); color: #628b73; }
.btn { border-radius: 12px; font-weight: 700; padding: .68rem 1.05rem; }
.btn-primary { --bs-btn-bg: var(--coral); --bs-btn-border-color: var(--coral); --bs-btn-hover-bg: #dd5b50; --bs-btn-hover-border-color: #dd5b50; }
.btn-dark { --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); }
.btn-icon { border: 0; background: transparent; color: inherit; width: 42px; height: 42px; border-radius: 12px; }
.table-card { overflow: hidden; }
.table { margin: 0; --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 16px 20px; border-bottom-color: var(--line); vertical-align: middle; }
.table thead th { color: var(--muted); font-size: .77rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.table tbody tr:last-child td { border-bottom: 0; }
.entity-name { font-weight: 700; text-decoration: none; }
.entity-name:hover { color: var(--coral); }
.status { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 700; background: #f0eee8; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.status-customer::before, .status-done::before { background: #6e9b7e; }
.status-prospect::before, .status-open::before { background: var(--coral); }
.form-control, .form-select { border: 1px solid var(--line); border-radius: 12px; padding: .75rem .9rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: var(--sage); box-shadow: 0 0 0 .22rem rgba(143,175,155,.2); }
.form-label { font-weight: 700; font-size: .9rem; }
.panel { padding: 26px; }
.empty-state { text-align: center; padding: 55px 25px; }
.empty-state i { font-size: 2rem; color: var(--sage); margin-bottom: 14px; }
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-brand { background: var(--ink); color: white; padding: 8vw; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 340px; height: 340px; border: 80px solid rgba(242,107,94,.14); border-radius: 50%; right: -120px; bottom: -120px; }
.auth-brand img { width: min(330px, 80%); filter: brightness(0) invert(1); margin-bottom: 45px; }
.auth-brand h1 { font-size: clamp(2rem, 4vw, 4rem); font-weight: 800; max-width: 650px; }
.auth-brand p { color: #b9c0cc; max-width: 510px; font-size: 1.1rem; }
.auth-form { display: grid; place-items: center; padding: 40px; }
.auth-form > div { width: min(430px, 100%); }
.auth-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 22px; background: rgba(143,175,155,.18); color: #628b73; font-size: 1.55rem; }
.section-title { font-size: 1.15rem; font-weight: 800; margin: 0; }
.note { padding: 18px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note p { margin: 6px 0; white-space: pre-line; }
.note small { color: var(--muted); }
.eyebrow { color: var(--coral); font-size: .75rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.progress { height: 8px; background: #ebe7df; border-radius: 99px; }
.progress-bar { background: var(--coral); border-radius: 99px; }
.admin-shell { min-height: 100vh; }
.admin-topbar { background: var(--paper); border-bottom: 1px solid var(--line); padding: 18px 3rem; display: flex; align-items: center; justify-content: space-between; }
.admin-topbar img { width: 180px; }
.admin-topbar a { font-weight: 700; text-decoration: none; }
.search-bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.search-bar input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; }
.search-bar > i { color: var(--sage); }
.search-bar a { color: var(--muted); }
.detail-row { display: flex; gap: 13px; align-items: flex-start; padding: 10px 0; }
.detail-row i { width: 22px; color: var(--sage); margin-top: 3px; }
.detail-row span { overflow-wrap: anywhere; white-space: pre-line; }
.contact-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.contact-row:last-child { border: 0; }
.contact-row .avatar { width: 38px; height: 38px; flex-basis: 38px; font-size: .75rem; background: var(--sage); }
.contact-row strong, .contact-row small { display: block; }
.contact-row small { color: var(--muted); }
.filter-pills { display: inline-flex; background: #eae6de; border-radius: 14px; padding: 4px; }
.filter-pills a { padding: 9px 17px; border-radius: 10px; text-decoration: none; font-size: .86rem; font-weight: 700; color: var(--muted); }
.filter-pills a.active { background: var(--paper); color: var(--ink); box-shadow: 0 3px 12px rgba(23,32,51,.08); }
.task-check { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); background: white; color: transparent; }
.task-check.checked { background: var(--sage); border-color: var(--sage); color: white; }
.pricing-card { padding: clamp(28px,5vw,60px); display: grid; grid-template-columns: 1fr 290px; gap: 60px; max-width: 900px; }
.feature-list { display: grid; gap: 12px; margin-top: 30px; }
.feature-list i { color: var(--sage); margin-right: 8px; }
.price { padding: 28px; background: var(--cream); border-radius: 18px; align-self: center; }
.price strong { display: block; font: 800 3rem/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.price span, .price small { color: var(--muted); }
.price small { display: block; margin-top: 12px; font-size: .75rem; }
.badge-test { display: inline-flex; align-items: center; background: #fff2c8; color: #725a06; padding: 8px 12px; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.subscription-state { display: flex; align-items: center; gap: 11px; margin-top: 22px; padding: 14px; border-radius: 13px; background: rgba(143,175,155,.18); color: #527a62; }
.subscription-state i { font-size: 1.2rem; }
.subscription-state span,.subscription-state b { display: block; }
.subscription-state span { font-size: .78rem; }
.team-row { display: flex; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.team-row .avatar { width: 38px; height: 38px; flex-basis: 38px; background: var(--sage); font-size: .75rem; }
.team-info { flex: 1; min-width: 0; }
.team-info strong,.team-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-info small { color: var(--muted); font-size: .76rem; }
.role-badge { padding: 5px 8px; border-radius: 999px; background: #eeeae2; color: var(--muted); font-size: .67rem; font-weight: 800; }
.role-owner { background: rgba(242,107,94,.14); color: #b34e45; }
.role-admin { background: rgba(143,175,155,.19); color: #547864; }
.pending-invite { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.pending-invite strong,.pending-invite small { display: block; }
.pending-invite small { color: var(--muted); font-size: .72rem; }
.pagination-wrap { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.pagination { --bs-pagination-color: var(--ink); --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--line); --bs-pagination-hover-color: var(--coral); --bs-pagination-focus-box-shadow: none; --bs-pagination-active-bg: var(--ink); --bs-pagination-active-border-color: var(--ink); }
.page-link { min-width: 36px; text-align: center; }
@media(max-width:575.98px){.pagination-wrap{align-items:flex-start;flex-direction:column}.pagination{flex-wrap:wrap}}
.upload-box { min-height: 210px; border: 2px dashed var(--line); border-radius: 18px; display: grid; place-items: center; align-content: center; gap: 8px; cursor: pointer; background: var(--cream); text-align: center; padding: 25px; transition: .2s; }
.upload-box:hover { border-color: var(--sage); background: rgba(143,175,155,.09); }
.upload-box i { font-size: 2rem; color: var(--sage); }
.upload-box span { color: var(--muted); font-size: .8rem; }
.upload-box input { max-width: 100%; margin-top: 12px; font-size: .82rem; }
.contact-photo-thumb { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; object-fit: cover; display: inline-grid; place-items: center; }
.contact-photo-preview { width: 88px; height: 88px; border-radius: 20px; object-fit: cover; border: 1px solid var(--line); }
.csv-columns { display: flex; flex-wrap: wrap; gap: 8px; }
.csv-columns span { background: var(--cream); border-radius: 9px; padding: 7px 10px; font-size: .76rem; font-weight: 700; }
.danger-zone { border: 1px solid rgba(220,53,69,.2); }
.sidebar-user .user-name { color: white; font-weight: 700; text-decoration: none; }
.invoice-page{padding:30px;background:#e9e6df;min-height:100vh}.invoice-toolbar{max-width:900px;margin:0 auto 20px;display:flex;justify-content:space-between}.invoice-sheet{max-width:900px;min-height:1100px;margin:auto;background:white;padding:70px;box-shadow:var(--shadow)}.invoice-sheet header{display:flex;justify-content:space-between;align-items:flex-start}.invoice-sheet header img{width:210px}.invoice-sheet header div{text-align:right}.invoice-sheet header span,.invoice-sheet header strong{display:block}.invoice-addresses{display:grid;grid-template-columns:1fr 1fr;gap:80px;margin:80px 0 50px}.invoice-addresses small,.invoice-addresses strong,.invoice-addresses span{display:block}.invoice-addresses small{color:var(--muted);font-weight:800;margin-bottom:10px}.invoice-addresses span{margin-top:6px;line-height:1.7;color:#555}.invoice-meta{display:flex;gap:50px;margin-bottom:35px}.invoice-meta span,.invoice-meta strong{display:block}.invoice-meta span{color:var(--muted);font-size:.8rem}.invoice-meta strong{color:var(--ink);font-size:1rem}.invoice-sheet table{width:100%;border-collapse:collapse}.invoice-sheet th,.invoice-sheet td{padding:18px 10px;border-bottom:1px solid var(--line);text-align:right}.invoice-sheet th:first-child,.invoice-sheet td:first-child{text-align:left}.invoice-sheet footer{margin-top:80px;color:var(--muted);font-size:.8rem}@media print{.invoice-toolbar{display:none}.invoice-page{padding:0;background:white}.invoice-sheet{box-shadow:none;margin:0;max-width:none}}@media(max-width:700px){.invoice-sheet{padding:30px;min-height:auto}.invoice-addresses{grid-template-columns:1fr;gap:25px;margin:45px 0}.invoice-sheet{overflow-x:auto}}
@media(max-width:767.98px){.pricing-card{grid-template-columns:1fr;gap:24px}}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 22px; }
    .mobile-bar { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 26px; }
    .mobile-bar img { width: 150px; }
    .page-heading { align-items: flex-start; }
}
@media (max-width: 767.98px) {
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand { padding: 42px 28px; min-height: 300px; }
    .auth-brand img { width: 210px; margin-bottom: 25px; }
    .auth-form { padding: 38px 22px; }
    .page-heading { display: block; }
    .page-heading .btn { margin-top: 16px; }
    .table-responsive .table { min-width: 680px; }
}
