/* =========================================================
   SaaSManager – stiluri principale
   ========================================================= */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-soft: #eef0ff;
    --bg: #f5f6fa;
    --surface: #ffffff;
    --border: #e6e8ef;
    --border-strong: #d9dce5;
    --text: #111827;
    --text-2: #374151;
    --muted: #6b7280;
    --success: #16a34a;
    --success-soft: #e7f7ec;
    --danger: #dc2626;
    --danger-soft: #fde8e8;
    --orange: #f97316;
    --orange-soft: #fff1e6;
    --blue: #2563eb;
    --blue-soft: #e8efff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --topbar-h: 60px;
    --sidebar-w: 210px;
    --aside-w: 340px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

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

a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
small { font-size: 12px; color: var(--muted); display: block; }
button, input, select, textarea { font: inherit; color: inherit; }

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger) !important; }
.nowrap { white-space: nowrap; }
.t-center { text-align: center !important; }

/* ---------- Butoane ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 18px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-light { background: #f3f4f6; border-color: var(--border); color: var(--text); }
.btn-light:hover { background: #e9eaee; }
.btn-block { width: 100%; }

.icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; padding: 0;
    background: transparent; border: 0; border-radius: var(--radius-sm);
    color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: #f3f4f6; }
.icon-btn.bordered { border: 1px solid var(--border-strong); background: var(--surface); }
.icon-btn.sm { width: 34px; height: 32px; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 24px;
    height: var(--topbar-h); padding: 0 24px;
    background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; width: calc(var(--sidebar-w) - 24px); font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.brand-logo { width: 30px; height: 30px; }
.menu-toggle { display: none; }

.global-search {
    flex: 1; max-width: 670px;
    display: flex; align-items: center; gap: 10px;
    height: 38px; padding: 0 8px 0 14px;
    background: #f3f4f6; border-radius: var(--radius-sm); color: var(--muted);
}
.global-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--text); }
.global-search kbd {
    font-family: inherit; font-size: 12px; padding: 2px 7px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.dot-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
    color: #fff; background: var(--danger); border-radius: 999px; border: 2px solid var(--surface);
    box-sizing: content-box;
}
.user-menu { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-menu .icon { width: 18px; height: 18px; color: var(--muted); }
.avatar {
    display: inline-grid; place-items: center; width: 36px; height: 36px;
    border-radius: 50%; background: #6366f1; color: #fff; font-weight: 600; font-size: 13px;
}
.user-info strong { display: block; font-size: 13px; }
.user-info small { font-size: 12px; }

/* ---------- Layout ---------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--aside-w);
    gap: 24px;
    min-height: calc(100vh - var(--topbar-h));
    padding-right: 16px;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: sticky; top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    display: flex; flex-direction: column; justify-content: space-between;
    padding: 18px 10px;
    background: var(--surface); border-right: 1px solid var(--border);
    overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    color: var(--text-2); font-weight: 500;
}
.nav-link:hover { background: #f5f5fb; }
.nav-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
    font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
    color: #fff; background: #ef4444; border-radius: 999px;
}

.plan-card {
    margin: 16px 2px 0; padding: 16px 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
}
.plan-card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.plan-card-title .crown { color: #f59e0b; }
.plan-card p { margin: 8px 0 10px; color: var(--text-2); }
.progress { height: 6px; margin-bottom: 14px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }

/* ---------- Main ---------- */
.main { padding: 24px 0 32px; min-width: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.page-head p { font-size: 15px; margin-top: 2px; }
.date-range {
    display: inline-flex; align-items: center; gap: 12px;
    height: 40px; padding: 0 14px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    cursor: pointer; white-space: nowrap;
}
.date-range .icon { width: 18px; height: 18px; color: var(--text-2); }

/* Statistici */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    display: flex; gap: 14px; padding: 18px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-icon {
    display: grid; place-items: center; flex-shrink: 0;
    width: 52px; height: 52px; border-radius: 12px;
}
.stat-icon .icon { width: 26px; height: 26px; }
.stat-icon.purple { background: var(--primary-soft); color: var(--primary); }
.stat-icon.blue   { background: var(--blue-soft); color: var(--blue); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.orange { background: var(--orange-soft); color: var(--orange); }
.stat-label { font-size: 12.5px; color: var(--text-2); }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 8px; white-space: nowrap; }
.stat-trend { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.stat-trend .icon { width: 15px; height: 15px; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); font-size: 13px; }

/* Card generic */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 20px 0; }
.card-head h2 { font-size: 20px; font-weight: 700; }
.card-head p { margin-top: 4px; }

/* Filtre */
.filters { display: flex; gap: 10px; padding: 20px 16px 16px; }
.input-icon {
    display: flex; align-items: center; gap: 8px;
    flex: 1.3; min-width: 0; height: 38px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--muted);
}
.input-icon input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); }
.input-icon:focus-within { border-color: var(--primary); }

.select { position: relative; flex: 1; min-width: 0; }
.select select {
    width: 100%; height: 38px; padding: 0 34px 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); appearance: none; -webkit-appearance: none; cursor: pointer; outline: none;
}
.select select:focus { border-color: var(--primary); }
.select .icon { position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); pointer-events: none; color: var(--text-2); }
.view-toggle { margin-left: 90px; }

/* Tabel */
.table-wrap { overflow-x: auto; padding: 0 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    padding: 12px 12px; text-align: left; white-space: nowrap;
    font-size: 12px; font-weight: 600; color: var(--text-2);
    background: #f7f8fb;
}
.table th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.table th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.table td { padding: 11px 12px; border-bottom: 1px solid #f0f1f5; vertical-align: middle; font-size: 13px; }
.table tbody tr:hover td { background: #fafbff; }
.table td small { margin-top: 2px; }
.cell-main { display: block; color: var(--text-2); }
.empty { text-align: center; padding: 40px !important; color: var(--muted); }

.store-cell { display: flex; align-items: center; gap: 12px; }
.store-cell strong { display: block; font-size: 13.5px; }
.logo {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 9px;
    background: var(--c); color: #fff; font-weight: 800; font-size: 16px;
}
.logo.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 7px; }

.licenses { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.licenses .icon { width: 16px; height: 16px; }

.badge {
    display: inline-block; padding: 3px 8px; border-radius: 6px;
    font-size: 12px; font-weight: 500; white-space: nowrap;
}
.plan-basic      { background: var(--blue-soft); color: #1d4ed8; }
.plan-pro        { background: #ece9fe; color: #5b21b6; }
.plan-enterprise { background: #fef3c7; color: #92400e; }
.status-activ    { background: var(--success-soft); color: var(--success); }
.status-restant  { background: var(--danger-soft); color: var(--danger); }

.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px 20px; }
.pagination { display: flex; gap: 6px; }
.page-btn {
    display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px;
    border: 1px solid var(--border-strong); border-radius: 7px; font-size: 13px; background: var(--surface);
}
.page-btn .icon { width: 16px; height: 16px; }
.page-btn:hover { border-color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { pointer-events: none; opacity: .45; }

/* ---------- Aside dreapta ---------- */
.aside { padding: 16px 0 32px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { padding: 16px 18px 20px; }
.panel[hidden] { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { font-size: 18px; font-weight: 700; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-size: 13px; color: var(--text-2); }
.field b { color: var(--danger); font-weight: 500; }
.field input, .field textarea {
    width: 100%; height: 38px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); outline: none;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.field input::placeholder, .field textarea::placeholder { color: #9ca3af; }
.field .invalid { border-color: var(--danger) !important; }
.inline { display: flex; align-items: center; gap: 12px; }
.inline input { width: 124px; flex-shrink: 0; }
.inline small { font-size: 11.5px; }
.link-sm { display: inline-flex; align-items: center; gap: 4px; align-self: flex-end; font-size: 12px; color: var(--primary); font-weight: 500; }
.link-sm .icon { width: 14px; height: 14px; }

.estimate {
    display: flex; align-items: center; gap: 10px; padding: 11px 12px;
    background: var(--primary-soft); border: 1px solid #dcdffd; border-radius: var(--radius-sm);
    color: var(--primary); font-size: 13px; font-weight: 500;
}
.estimate .icon { width: 18px; height: 18px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

.reminders { padding: 16px 18px 8px; }
.reminders ul { list-style: none; margin: 0; padding: 0; }
.reminders li {
    display: grid; grid-template-columns: 26px 1fr 1.1fr auto; align-items: center; gap: 12px;
    padding: 10px 0; border-top: 1px solid #f0f1f5; font-size: 13px;
}
.r-name { font-weight: 600; font-size: 12.5px; }
.r-date { color: var(--text-2); font-size: 12.5px; }
.r-amount { white-space: nowrap; font-size: 12.5px; }

/* Toast */
.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 50;
    padding: 12px 18px; border-radius: var(--radius-sm);
    background: #111827; color: #fff; font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .2);
    opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s;
}
.toast.show { opacity: 1; transform: none; }

.sidebar-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .view-toggle { margin-left: 0; }
}

@media (max-width: 1440px) {
    .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .aside { grid-column: 2; padding-top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
}

@media (max-width: 900px) {
    .app { grid-template-columns: minmax(0, 1fr); padding: 0 16px; gap: 0; }
    .aside { grid-column: 1; grid-template-columns: 1fr; }
    .menu-toggle { display: inline-flex; }
    .brand { width: auto; }
    .global-search, .user-info { display: none; }
    .topbar { padding: 0 16px; gap: 12px; }
    .sidebar {
        position: fixed; left: 0; top: var(--topbar-h); z-index: 40; width: 260px;
        transform: translateX(-100%); transition: transform .2s;
    }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop {
        display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 35; background: rgba(17, 24, 39, .35);
    }
    .filters { flex-wrap: wrap; }
    .input-icon { flex-basis: 100%; }
    .page-head { flex-direction: column; }
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .card-head { flex-direction: column; }
    .table-foot { flex-direction: column; }
    .select { flex-basis: calc(50% - 5px); }
}

/* Ajustări densitate */
.stat-card { padding: 16px 14px; gap: 12px; }
.stat-icon { width: 46px; height: 46px; }
.stat-value { font-size: 22px; }
.stat-trend { font-size: 11.5px; white-space: nowrap; }
.store-cell strong, .cell-main { white-space: nowrap; }
.app { gap: 20px; }
.table th, .table td { padding-left: 10px; padding-right: 10px; }
.table-wrap { padding: 0 8px; }

/* =========================================================
   Pagina Magazine
   ========================================================= */
.app.no-aside { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); padding-right: 24px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 15px; }

a.stat-card { transition: border-color .15s, box-shadow .15s; }
a.stat-card:hover { border-color: #c7cbf7; box-shadow: 0 4px 12px rgba(79, 70, 229, .08); }
.stat-icon.gray { background: #f1f2f5; color: #6b7280; }
.status-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--success); }
.stat-trend.neutral { color: var(--muted); }
.stat-trend.down { font-size: 12px; }

.no-aside .filters { padding-top: 16px; }
.no-aside .filters .input-icon { flex: 1.25; }
.view-switch { display: flex; gap: 8px; margin-left: auto; padding-left: 40px; }
.view-switch .icon-btn.active { background: var(--primary-soft); border-color: #c7cbf7; color: var(--primary); }

.status-suspendat { background: #f1f2f5; color: #4b5563; }

/* Meniu acțiuni rând */
.row-menu { position: relative; display: inline-block; }
.dropdown {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20;
    min-width: 180px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, .14); text-align: left;
}
.dropdown[hidden] { display: none; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.dropdown a:hover { background: #f5f5fb; }
.dropdown a .icon { width: 16px; height: 16px; color: var(--muted); }
.dropdown a.danger, .dropdown a.danger .icon { color: var(--danger); }
.dropdown.up { top: auto; bottom: calc(100% + 6px); }

/* Vizualizare carduri */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 0 16px; }
.store-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.store-card:hover { border-color: #c7cbf7; }
.store-card header { display: flex; align-items: center; gap: 12px; }
.store-card-title { flex: 1; min-width: 0; }
.store-card-title strong { display: block; }
.store-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 12px 0; border-top: 1px solid #f0f1f5; border-bottom: 1px solid #f0f1f5; }
.store-card dt { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.store-card dd { margin: 0; font-size: 13px; }
.store-card footer { display: flex; align-items: center; justify-content: space-between; }

.page-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* =========================================================
   Pagina Clienți
   ========================================================= */
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.status-inactiv { background: var(--orange-soft); color: #c2410c; }
.no-aside .filters .input-icon.wide { flex: 2; }
.avatar-circle {
    display: inline-grid; place-items: center; flex-shrink: 0;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--c); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
.store-cell > strong { white-space: nowrap; font-size: 13.5px; }
.link-plain:hover { color: var(--primary); text-decoration: underline; }
.modal-dialog.modal-md { width: min(560px, 100%); }

/* =========================================================
   Pagina Licențe
   ========================================================= */
.small { font-size: 12.5px; }
.t-right { text-align: right; }

/* Layout: titlul paginii deasupra coloanei principale și a celei din dreapta */
.app.aside-sm { --aside-w: 264px; }
.filters .input-icon.wide { flex: 2.2; }
.app.with-head .sidebar { grid-row: 1 / span 2; }
.app.with-head > .page-head { grid-column: 2 / -1; margin: 0; padding-top: 24px; }
.app.with-head > .main { padding-top: 0; }
.app.with-head > .aside { padding-top: 0; }

.status-expira  { background: var(--orange-soft); color: #c2410c; }
.status-expirat { background: var(--danger-soft); color: var(--danger); }

.page-gap { display: inline-grid; place-items: center; min-width: 20px; color: var(--muted); }

/* Cheie licență */
.key-chip {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px; padding: 0 8px 0 10px;
    border: 1px solid var(--border-strong); border-radius: 7px; background: var(--surface);
    font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; color: var(--text-2);
    cursor: pointer; white-space: nowrap;
}
.key-chip .icon { width: 15px; height: 15px; color: var(--muted); }
.key-chip:hover { border-color: var(--primary); color: var(--primary); }
.key-chip:hover .icon { color: var(--primary); }
.key-chip.full { justify-content: space-between; width: 100%; }
.key-field { display: flex; gap: 8px; }
.key-field input {
    flex: 1; min-width: 0; height: 38px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: #f7f8fb; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: .03em;
}

.license-preview {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    padding: 12px 14px; background: var(--primary-soft); border-radius: 10px; color: var(--primary);
}
.license-preview span { display: block; font-size: 12px; font-weight: 500; }
.license-preview strong { font-size: 15px; }

/* Coloana din dreapta */
.side-card { padding: 16px 18px 18px; }
.side-card .panel-head { align-items: flex-start; }
.side-card .form { gap: 12px; }
.side-card .field > label { font-size: 13px; }
.select.with-icon select { padding-left: 38px; }
.select .icon.lead { left: 12px; right: auto; color: var(--muted); }

.plan-list { list-style: none; margin: 0 0 14px; padding: 0; }
.plan-list li { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid #f0f1f5; }
.plan-list li:first-child { border-top: 0; padding-top: 4px; }
.plan-list strong { font-size: 12px; white-space: nowrap; }
.plan-list small { font-size: 11px; margin-top: 3px; }
.plan-name { font-weight: 700; font-size: 13.5px; }
.plan-name:hover { text-decoration: underline; }
.plan-text-basic { color: #1d4ed8; }
.plan-text-pro { color: #6d28d9; }
.plan-text-enterprise { color: #c2410c; }
.btn-outline-primary { color: var(--primary); background: var(--surface); border-color: var(--border-strong); }
.btn-outline-primary:hover { background: var(--primary-soft); }

/* =========================================================
   Pagina Plăți
   ========================================================= */
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; }
.stat-trend.warn { color: #c2410c; }
.modal-icon.green { background: var(--success-soft); color: var(--success); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.btn-sm .icon { width: 16px; height: 16px; }

.pay-incasata  { background: var(--success-soft); color: var(--success); }
.pay-asteptare { background: #fef3c7; color: #b45309; }
.pay-esuata    { background: var(--danger-soft); color: var(--danger); }
.pay-restanta  { background: #fee2e2; color: #991b1b; font-weight: 600; }

/* Metode de plată */
.pay-method { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); }
.card-dots { letter-spacing: 1px; }
.brand-mark { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-mark.visa { font-weight: 900; font-style: italic; font-size: 14px; color: #1a1f71; letter-spacing: -.02em; }
.brand-mark.mc { width: 26px; height: 17px; }
.brand-mark.paypal { font-weight: 800; font-style: italic; font-size: 13.5px; color: #009cde; }
.brand-mark.paypal b { color: #003087; }
.brand-icon { width: 18px; height: 18px; color: var(--text-2); }

/* Filtre suplimentare */
.filters-wrap { flex-wrap: wrap; }
.period-select { flex: 1.35; }
.btn-filter { height: 38px; font-weight: 500; }
.btn-filter.active { background: var(--primary-soft); border-color: #c7cbf7; color: var(--primary); }
.more-filters {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    flex-basis: 100%; padding: 12px; background: #f7f8fb; border-radius: var(--radius-sm);
}
.more-filters[hidden] { display: none; }
.more-filters .select { flex: 1 1 180px; }
.input-icon.amount { flex: 0 1 150px; background: var(--surface); font-size: 12.5px; }
.input-icon.amount input { text-align: right; }

/* Selecție multiplă */
.col-check { width: 36px; }
.check { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }
.bulk-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: 0 16px 12px; padding: 8px 12px;
    background: var(--primary-soft); border: 1px solid #dcdffd; border-radius: var(--radius-sm);
    color: var(--primary); font-size: 13px;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar > span { margin-right: auto; }
.table tbody tr.selected td { background: #f5f5ff; }
.amount { font-weight: 600; }

/* Coloana din dreapta */
.method-list { list-style: none; margin: 0; padding: 0; }
.method-list a { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.method-list a:hover { background: #f5f5fb; }
.method-logo {
    display: grid; place-items: center; width: 52px; height: 32px; flex-shrink: 0;
    background: #f7f8fb; border: 1px solid var(--border); border-radius: 7px;
}
.summary-card h2 { font-size: 15px; font-weight: 700; }
.big-amount { font-size: 22px; font-weight: 800; margin: 6px 0 2px; letter-spacing: -.02em; }
.warn-text { color: #c2410c; font-size: 13px; }
.summary-card .text-danger { font-size: 13px; }
.summary-card .btn { margin-top: 12px; font-weight: 500; }
.btn-soft-orange { background: var(--orange-soft); color: #c2410c; }
.btn-soft-orange:hover { background: #ffe4cc; }
.btn-soft-red { background: var(--danger-soft); color: var(--danger); }
.btn-soft-red:hover { background: #fbd5d5; }
.export-list { display: flex; flex-direction: column; gap: 8px; }
.export-list a {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px;
    border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-2);
}
.export-list a .icon { width: 30px; height: 30px; padding: 6px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); }
.export-list a:hover { border-color: #c7cbf7; color: var(--primary); }

/* =========================================================
   Pagina Facturare
   ========================================================= */
.inv-platita  { background: var(--success-soft); color: var(--success); }
.inv-emisa    { background: var(--blue-soft); color: #1d4ed8; }
.inv-esuata   { background: #fef3c7; color: #b45309; }
.inv-restanta { background: #fee2e2; color: #991b1b; font-weight: 600; }
.inv-ciorna   { background: #f1f2f5; color: #4b5563; }
#invoices-table th, #invoices-table td { padding-left: 8px; padding-right: 8px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; font-weight: 500; }
.field-row.cols-3 { grid-template-columns: 1.2fr 1fr 1fr; }

.draft-list { list-style: none; margin: 0 0 12px; padding: 0; }
.draft-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #f0f1f5; }
.draft-list li:first-child { border-top: 0; }
.draft-list li > div { flex: 1; min-width: 0; }
.draft-list strong { display: block; font-size: 13px; }
.draft-list small { font-size: 11.5px; }

.settings-list { margin: 0 0 12px; }
.settings-list div { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-top: 1px solid #f0f1f5; font-size: 12.5px; }
.settings-list div:first-child { border-top: 0; }
.settings-list dt { color: var(--muted); }
.settings-list dd { margin: 0; font-weight: 600; text-align: right; }

/* Editor linii factură */
.lines-editor { border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.lines-head, .line-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 110px 100px 34px; gap: 8px; align-items: center; }
.lines-head { padding: 0 2px 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.line-row { padding: 4px 0; }
.line-row input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none; }
.line-row input:focus { border-color: var(--primary); }
.line-row input.invalid { border-color: var(--danger); }
.line-total { font-size: 13px; white-space: nowrap; }
.add-line { margin-top: 8px; align-self: flex-start; background: none; border: 0; cursor: pointer; padding: 4px 2px; }
.inv-form-totals, .inv-totals { margin-left: auto; width: min(280px, 100%); }
.inv-form-totals p, .inv-totals p { display: flex; justify-content: space-between; margin: 0; padding: 5px 0; font-size: 13px; color: var(--text-2); }
.inv-form-totals .grand, .inv-totals .grand { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 9px; font-size: 15px; color: var(--text); }
.inv-form-totals .grand strong, .inv-totals .grand strong { font-size: 17px; }

/* Previzualizare factură */
.modal-dialog.modal-invoice { width: min(760px, 100%); background: #eef0f4; }
.invoice-toolbar {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border); border-radius: 14px 14px 0 0;
}
.invoice-toolbar strong { margin-right: auto; }
.invoice-doc {
    margin: 16px; padding: 32px 36px; overflow-y: auto;
    background: #fff; color: #111827; border-radius: 6px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    font-size: 12.5px;
}
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 20px; border-bottom: 2px solid var(--primary); }
.inv-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.inv-title { text-align: right; }
.inv-title h2 { font-size: 22px; letter-spacing: .08em; color: var(--primary); }
.inv-title p { margin: 4px 0 8px; font-size: 13px; }
.inv-stamp { display: inline-block; padding: 3px 10px; border: 1.5px solid currentColor; border-radius: 6px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.inv-stamp.s-platita { color: var(--success); }
.inv-stamp.s-emisa { color: #1d4ed8; }
.inv-stamp.s-esuata { color: #b45309; }
.inv-stamp.s-restanta { color: var(--danger); }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr auto; gap: 20px; padding: 20px 0; }
.inv-parties h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.inv-parties p { margin: 3px 0 0; color: #374151; }
.inv-dates p { display: flex; flex-direction: column; margin: 0 0 8px; }
.inv-dates span { font-size: 11px; color: var(--muted); }
.inv-lines { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.inv-lines th { text-align: left; padding: 8px; background: #f3f4f8; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #4b5563; }
.inv-lines td { padding: 10px 8px; border-bottom: 1px solid #eceef3; }
.inv-lines .t-right { text-align: right; }
.inv-foot { margin-top: 24px; padding-top: 12px; border-top: 1px solid #eceef3; color: var(--muted); font-size: 11.5px; text-align: center; }

/* Print: doar factura */
@media print {
    body.print-invoice > *:not(#invoice-preview-modal) { display: none !important; }
    body.print-invoice #invoice-preview-modal { position: static; display: block; padding: 0; }
    body.print-invoice .modal-backdrop, body.print-invoice .invoice-toolbar { display: none; }
    body.print-invoice .modal-dialog { width: 100%; max-height: none; box-shadow: none; background: #fff; animation: none; }
    body.print-invoice .invoice-doc { margin: 0; padding: 0; box-shadow: none; overflow: visible; }
    @page { margin: 16mm; }
}

@media (max-width: 720px) {
    .field-row.cols-3 { grid-template-columns: 1fr; }
    .lines-head { display: none; }
    .line-row { grid-template-columns: 1fr 1fr 34px; }
    .line-row input[name="line_desc[]"] { grid-column: 1 / -1; }
    .line-row .line-total { grid-column: 1 / 3; }
    .invoice-doc { padding: 20px; margin: 10px; }
    .inv-parties { grid-template-columns: 1fr; }
}

@media (max-width: 1440px) {
    .app.with-head > .aside { padding-bottom: 32px; }
}
@media (max-width: 900px) {
    .app.with-head > .page-head { grid-column: 1 / -1; }
}
.card-head .link-sm { align-self: center; font-size: 13px; }

/* =========================================================
   Modal
   ========================================================= */
body.modal-open { overflow: hidden; }

.modal {
    position: fixed; inset: 0; z-index: 60;
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(17, 24, 39, .45); backdrop-filter: blur(1px);
    animation: fade-in .15s ease-out;
}
.modal-dialog {
    position: relative; display: flex; flex-direction: column;
    width: min(690px, 100%); max-height: calc(100vh - 48px);
    background: var(--surface); border-radius: 14px;
    box-shadow: 0 24px 60px rgba(16, 24, 40, .28);
    animation: modal-in .18s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.modal-head {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 22px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 20px; font-weight: 700; }
.modal-head p { font-size: 13.5px; margin-top: 2px; }
.modal-icon {
    display: grid; place-items: center; flex-shrink: 0;
    width: 46px; height: 46px; border-radius: 12px;
    background: var(--primary-soft); color: var(--primary);
}
.modal-icon .icon { width: 24px; height: 24px; }
.modal-close { align-self: flex-start; margin-left: auto; margin-top: -6px; margin-right: -8px; }

.modal-body { overflow-y: auto; padding: 18px 22px 20px; gap: 18px; }
.modal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
.modal-main { display: flex; flex-direction: column; gap: 18px; }

.form-section { display: flex; flex-direction: column; gap: 12px; }
.form-section h3 { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin: 0 0 2px; }
.step {
    display: inline-grid; place-items: center; width: 26px; height: 26px;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }

/* Stepper licențe */
.stepper {
    display: flex; flex-shrink: 0; height: 38px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden;
}
.stepper button {
    display: grid; place-items: center; width: 38px;
    border: 0; background: var(--surface); color: var(--text-2); cursor: pointer;
}
.stepper button:hover { background: #f3f4f6; }
.stepper button .icon { width: 16px; height: 16px; }
.field .stepper input {
    width: 84px; height: 100%; border: 0; border-radius: 0; text-align: center;
    border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong);
    -moz-appearance: textfield;
}
.field .stepper input:focus { box-shadow: none; background: #fafbff; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper:focus-within { border-color: var(--primary); }

/* Rezumat */
.summary {
    position: sticky; top: 0;
    display: flex; flex-direction: column; gap: 12px;
    padding: 16px 14px; background: #f7f8fb; border-radius: var(--radius);
}
.summary h3 { font-size: 16px; font-weight: 700; margin: 0; }
.summary-store {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    background: var(--surface); border-radius: 10px;
}
.summary-store strong { display: block; font-size: 13px; word-break: break-word; }
.summary-store small { font-size: 11.5px; word-break: break-word; }
.summary-logo {
    display: grid; place-items: center; flex-shrink: 0;
    width: 50px; height: 50px; border-radius: 10px;
    background: var(--primary-soft); color: var(--primary); font-size: 20px; font-weight: 800;
}
.summary-logo .icon { width: 26px; height: 26px; }
.summary-rows { margin: 0; }
.summary-rows div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 2px; border-top: 1px solid var(--border); }
.summary-rows div:first-child { border-top: 0; }
.summary-rows dt { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.summary-rows dt .icon { width: 18px; height: 18px; color: var(--text-2); }
.summary-rows dd { margin: 0; font-weight: 700; font-size: 13px; }
.summary-total { padding: 12px; background: var(--primary-soft); border-radius: 10px; color: var(--primary); }
.summary-total span { font-size: 13px; font-weight: 500; }
.summary-total strong { display: block; font-size: 20px; font-weight: 800; margin-top: 2px; }
.summary-total small { color: #6366f1; margin-top: 4px; }
.summary-total small[hidden] { display: none; }
.summary-note {
    display: flex; gap: 8px; margin: 0; padding: 10px;
    background: #eef4ff; border: 1px solid #d6e2fb; border-radius: 8px;
    font-size: 11.5px; line-height: 1.45; color: var(--text-2);
}
.summary-note .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--text-2); }

.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal-actions .btn { min-width: 150px; height: 40px; }

@media (max-width: 720px) {
    .modal { padding: 0; align-items: flex-end; }
    .modal-dialog { max-height: 94vh; border-radius: 14px 14px 0 0; }
    .modal-grid { grid-template-columns: 1fr; }
    .summary { position: static; }
    .field-row { grid-template-columns: 1fr; }
    .modal-actions .btn { flex: 1; min-width: 0; }
}

@media (max-width: 1200px) {
    .no-aside .filters { flex-wrap: wrap; }
    .no-aside .filters .select { flex: 1 1 160px; }
    .view-switch { padding-left: 0; }
}
@media (max-width: 900px) {
    .app.no-aside { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
    .store-grid { padding: 0 12px; }
}
.aside-sm .view-switch { padding-left: 0; }
.col-date { min-width: 104px; }
.stat-trend.wrap { white-space: normal; line-height: 1.35; align-items: flex-start; }
.inv-dates p[hidden] { display: none; }

/* =========================================================
   Pagina Rapoarte
   ========================================================= */
.head-select { flex: 0 0 250px; }
.head-select select { height: 42px; }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tab {
    padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
    background: none; color: var(--text-2); font-weight: 500; white-space: nowrap; cursor: pointer;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

[data-tab-panels] { display: flex; flex-direction: column; gap: 18px; }
[data-tab-panels] > .stats { margin-bottom: 0; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 18px; }
.report-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
[data-tab-panels].filtered .report-grid, [data-tab-panels].filtered .report-grid-3 { grid-template-columns: minmax(0, 1fr); }
[data-tab-panels] [hidden] { display: none !important; }

.chart-card { padding: 18px 20px; }
.chart-card h2 { font-size: 16px; font-weight: 700; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.sm-select select { height: 34px; font-size: 13px; }
.chart { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-svg .grid { stroke: #eef0f4; stroke-width: 1; }
.chart-svg .axis { fill: var(--muted); font-size: 10px; }
.chart-svg .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .dot { fill: var(--primary); stroke: var(--surface); stroke-width: 2; opacity: 0; transition: opacity .1s; }
.chart-svg .dot.last, .chart-svg .dot.on { opacity: 1; }
.chart-svg .dot.on { r: 5; }
.chart-svg .crosshair { stroke: #c7cbf7; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .hit { fill: transparent; cursor: crosshair; }
.chart-svg .bar { fill: var(--primary); opacity: .85; }
.chart-svg .hit:hover + text, .chart-svg .bar:hover { opacity: 1; }

.chart-tooltip {
    position: fixed; z-index: 70; pointer-events: none;
    padding: 6px 10px; border-radius: 7px; background: #111827; color: #fff;
    font-size: 12px; font-weight: 500; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
    transform: translate(-50%, calc(-100% - 12px));
}
.chart-tooltip[hidden] { display: none; }

.chart-table { margin-top: 10px; font-size: 12.5px; }
.chart-table summary { cursor: pointer; color: var(--primary); font-weight: 500; width: max-content; }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.chart-table th, .chart-table td { padding: 6px 8px; border-bottom: 1px solid #f0f1f5; text-align: left; }
.chart-table th { color: var(--muted); font-weight: 500; }

.hbars { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hbars li { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(0, 1.2fr) auto; align-items: center; gap: 12px; font-size: 13px; }
.hbars a { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars a:hover { color: var(--primary); }
.hbar-track { height: 14px; background: #f1f2f6; border-radius: 4px; overflow: hidden; }
.hbar { display: block; height: 100%; background: var(--primary); border-radius: 4px; opacity: .85; }
.hbars strong { font-size: 12.5px; white-space: nowrap; }

.donut-wrap { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.donut-svg { width: 136px; height: 136px; flex-shrink: 0; }
.donut-svg .seg { cursor: pointer; transition: stroke-width .12s; }
.donut-svg .seg:hover { stroke-width: 23; }
.donut-value { font-size: 24px; font-weight: 800; fill: var(--text); }
.donut-label { font-size: 10px; fill: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.legend a { color: var(--text-2); }
.legend a:hover { color: var(--primary); }
.legend strong { font-size: 12.5px; white-space: nowrap; }
.legend .muted { font-weight: 400; }
.swatch { width: 10px; height: 10px; border-radius: 50%; }

.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12.5px; }
.trend .icon { width: 14px; height: 14px; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.btn-soft-primary { background: var(--primary-soft); color: var(--primary); }
.btn-soft-primary:hover { background: #e0e3ff; }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 24px; text-align: center; }
.empty-state p { max-width: 460px; }
.small-note { margin-top: 12px; }

.insights { display: flex; flex-direction: column; gap: 10px; }
.insight { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: #f7f8fb; }
.insight strong { display: block; font-size: 13px; }
.insight p { margin: 3px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.4; }
.insight .btn { margin-top: 8px; }
.insight-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; }
.insight-icon .icon { width: 17px; height: 17px; }
.insight.good .insight-icon { background: var(--success-soft); color: var(--success); }
.insight.bad .insight-icon { background: var(--danger-soft); color: var(--danger); }
.insight.info .insight-icon { background: var(--blue-soft); color: var(--blue); }
.insight.warn .insight-icon { background: var(--orange-soft); color: var(--orange); }

@media (max-width: 1300px) {
    .report-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .report-grid, .report-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Print pentru pagini întregi (ex: Rapoarte → Exportă PDF) */
@media print {
    body:not(.print-invoice) .topbar, body:not(.print-invoice) .sidebar,
    body:not(.print-invoice) .no-print, body:not(.print-invoice) .toast { display: none !important; }
    body:not(.print-invoice) .app { display: block; padding: 0; }
    body:not(.print-invoice) { background: #fff; }
    body:not(.print-invoice) .card { box-shadow: none; break-inside: avoid; }
}
.chart-svg .crosshair[hidden] { display: none; }

/* =========================================================
   Pagina Notificări
   ========================================================= */
.dot-ind { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot-ind.red { background: var(--danger); }
.dot-ind.orange { background: var(--orange); }
.dot-ind.green { background: var(--success); }

.notif-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 12px; }
.inline-tabs { margin: 0; flex: 1; min-width: 0; }
.inline-tabs .tab { font-size: 13.5px; padding: 10px 12px; }
.notif-sort .select { width: 190px; }

.notif-main { display: flex; align-items: flex-start; gap: 12px; }
.notif-title { display: block; font-weight: 500; color: var(--text); font-size: 13.5px; }
a.notif-title:hover { color: var(--primary); }
.notif-row.unread .notif-title { font-weight: 700; }
.notif-row.unread td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.notif-row small { max-width: 460px; }
.sev-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px; }
.sev-icon .icon { width: 17px; height: 17px; }
.sev-critic  { background: var(--danger-soft); color: var(--danger); }
.sev-warning { background: var(--orange-soft); color: var(--orange); }
.sev-info    { background: var(--blue-soft); color: var(--blue); }
.sev-success { background: var(--success-soft); color: var(--success); }
.type-facturare { background: #fde8e8; color: #b91c1c; }
.type-licente   { background: #fff1e6; color: #c2410c; }
.type-plati     { background: var(--success-soft); color: #15803d; }
.type-clienti   { background: var(--blue-soft); color: #1d4ed8; }
.type-sistem    { background: #ece9fe; color: #5b21b6; }
.avatar-circle.sm { width: 26px; height: 26px; font-size: 10.5px; }

/* Comutatoare (switch) */
.switch {
    appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative; cursor: pointer;
    width: 38px; height: 22px; margin: 0; border-radius: 999px; background: #d9dce5; transition: background .15s;
}
.switch::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s;
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(16px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.toggle-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.toggle-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.toggle-icon .icon { width: 16px; height: 16px; }
.toggle-text { flex: 1; min-width: 0; }
.toggle-text strong { display: block; font-size: 13px; font-weight: 600; }
.toggle-text small { font-size: 11.5px; }

.recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.recent-list li { display: flex; gap: 10px; align-items: flex-start; }
.recent-list .swatch { margin-top: 5px; flex-shrink: 0; }
.recent-list a, .recent-list strong { font-size: 13px; font-weight: 600; color: var(--text); }
.recent-list a:hover { color: var(--primary); }
.sev-dot-critic { background: var(--danger); }
.sev-dot-warning { background: var(--orange); }
.sev-dot-info { background: var(--blue); }
.sev-dot-success { background: var(--success); }

@media (max-width: 900px) {
    .notif-bar { flex-direction: column; align-items: stretch; }
    .notif-sort .select { width: 100%; }
}

/* =========================================================
   Pagina Setări
   ========================================================= */
.maintenance-banner {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 16px; background: #fef3c7; color: #92400e; font-size: 13px; font-weight: 500;
}
.maintenance-banner .icon { width: 16px; height: 16px; }
.maintenance-banner a { text-decoration: underline; font-weight: 600; }

.settings-tabs .tab { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; }
.settings-tabs .tab .icon { width: 17px; height: 17px; }

.alert { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; }
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; }
.alert.success { background: var(--success-soft); color: #15803d; }
.alert.error { background: var(--danger-soft); color: #b91c1c; }
.alert.warn { background: #fef3c7; color: #92400e; font-weight: 400; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.set-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.set-head { display: flex; align-items: flex-start; gap: 14px; }
.set-head > div { flex: 1; min-width: 0; }
.set-head h2, .card-title { font-size: 16.5px; font-weight: 700; }
.set-icon { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); }
.set-icon .icon { width: 22px; height: 22px; }
.set-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
fieldset.field-row { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.form { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset:disabled input { background: #f7f8fb; cursor: not-allowed; }
.field input[readonly] { background: #f9fafb; color: var(--text-2); }
.field-error { color: var(--danger); font-size: 12px; }
.field-label { font-size: 13px; color: var(--text-2); }
.field select.invalid { border-color: var(--danger); }
.sub-title { font-size: 14px; font-weight: 700; margin: 6px 0 0; }
.card-pad { padding: 18px 20px 6px; }
.modal-dialog.modal-sm { width: min(460px, 100%); }
.modal-icon.red { background: var(--danger-soft); color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-danger-outline { background: var(--surface); color: var(--danger); border-color: #f5b5b5; }
.btn-danger-outline:hover { background: var(--danger-soft); }

/* Logo & culori */
.brand-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; }
.logo-box { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 6px; }
.logo-preview { display: grid; place-items: center; height: 118px; background: #fafbfc; }
.logo-preview .logo-img, .logo-preview img { width: 76px; height: 76px; object-fit: contain; }
.logo-change { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px; border-top: 1px solid var(--border); background: #f7f8fb; font-size: 13px; cursor: pointer; }
.logo-change:hover { color: var(--primary); }
.logo-change .icon { width: 16px; height: 16px; }
.check-inline { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text-2); cursor: pointer; }
.brand-fields { display: flex; flex-direction: column; gap: 12px; }
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type=color] { width: 42px; height: 38px; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex-shrink: 0; }
.color-field input[type=text] { flex: 1; min-width: 0; }
.favicon-row { display: flex; align-items: center; gap: 10px; }
.favicon-preview { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 8px; }
.favicon-preview .logo-img, .favicon-preview img { width: 24px; height: 24px; object-fit: contain; }
.file-btn { cursor: pointer; }
.pref-row { justify-content: space-between; padding: 9px 0; border-top: 1px solid #f0f1f5; }
.pref-row:first-child { border-top: 0; }

/* Coloana din dreapta */
.system-overall { display: flex; align-items: center; gap: 8px; margin: -4px 0 10px; font-size: 13px; font-weight: 500; }
.system-overall.ok { color: var(--success); }
.system-overall.warn { color: #c2410c; }
.status-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.status-list li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.status-list small { font-size: 11.5px; text-align: right; }
.st-ok { color: var(--success); }
.st-warn { color: #c2410c; }
.st-error { color: var(--danger); }
.account-card { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.account-card strong { display: block; }
.account-card small { font-size: 11.5px; }
.account-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.quick-list { display: flex; flex-direction: column; gap: 6px; }
.quick-list a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.quick-list a:hover { border-color: #c7cbf7; color: var(--primary); }
.quick-list a .icon { width: 17px; height: 17px; }
.quick-list a .chev { margin-left: auto; width: 15px; height: 15px; color: var(--muted); }
.quick-list a.danger { color: var(--danger); }
.danger-card { background: #fff7f7; border-color: #fbd5d5; }
.danger-card h2 { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 15px; font-weight: 700; }
.danger-card h2 .icon { width: 18px; height: 18px; }
.danger-card p { margin: 4px 0 12px; }

/* Aspect */
.preset-list { display: flex; flex-wrap: wrap; gap: 10px; }
.preset { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; }
.preset.active { box-shadow: 0 0 0 2px var(--c); }
.theme-preview { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: grid; grid-template-columns: 150px 1fr; min-height: 150px; }
.tp-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 8px; border-right: 1px solid var(--border); font-size: 12.5px; }
.tp-nav span { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--text-2); }
.tp-nav .icon { width: 15px; height: 15px; }
.tp-nav .tp-active { background: color-mix(in srgb, var(--p) 10%, white); color: var(--p); font-weight: 600; }
.tp-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px; }
.tp-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--p); color: #fff; font-weight: 600; font-size: 12.5px; }
.tp-btn .icon { width: 15px; height: 15px; }
.tp-bar { width: 100%; height: 6px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.tp-bar span { display: block; width: 62%; height: 100%; background: var(--p); }
.tp-badge { padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--s) 18%, white); color: color-mix(in srgb, var(--s) 70%, black); font-size: 12px; font-weight: 600; }

/* Securitate, utilizatori, integrări, plan */
.session-list { list-style: none; margin: 0; padding: 0; }
.session-list li { display: flex; align-items: center; gap: 12px; }
.session-list li > div { flex: 1; }
.session-list strong { display: block; font-size: 13px; }
.role-admin { background: var(--primary-soft); color: var(--primary); }
.role-finance { background: var(--success-soft); color: #15803d; }
.role-support { background: var(--blue-soft); color: #1d4ed8; }
.role-viewer { background: #f1f2f5; color: #4b5563; }
.roles-card { margin-top: 18px; }
.roles-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.role-item p { margin: 6px 0 0; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.integration { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.integration-text { flex: 1; min-width: 0; }
.integration-text strong { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.integration-text small { font-size: 12px; }
.usage-row { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13.5px; }
.plan-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.plan-option { position: relative; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.plan-option.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-option h3 { margin: 0; font-size: 17px; }
.plan-price { margin: 0; color: var(--muted); }
.plan-price strong { font-size: 26px; color: var(--text); }
.plan-option ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan-option li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.plan-option li .icon { width: 15px; height: 15px; color: var(--success); }
.plan-current { position: absolute; top: 16px; right: 16px; }

@media (max-width: 1200px) {
    .settings-grid, .plan-cards { grid-template-columns: minmax(0, 1fr); }
    .roles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .brand-grid, .integration-grid, .roles-grid, .theme-preview { grid-template-columns: minmax(0, 1fr); }
    .integration { flex-wrap: wrap; }
}

/* =========================================================
   Meniu lateral: grupuri restrângibile (CRM & Vânzări, Clienți & CRM)
   ========================================================= */
.nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.nav-group-head {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 6px 12px 6px 14px; border: 0; border-left: 3px solid var(--primary);
    background: none; color: var(--primary); font-size: 12px; font-weight: 700;
    letter-spacing: .03em; text-transform: uppercase; cursor: pointer; text-align: left;
}
.nav-group-head:hover { background: #f5f5fb; }
.nav-group-head .nav-chev { width: 16px; height: 16px; transition: transform .15s; }
.nav-group.collapsed .nav-chev { transform: rotate(-90deg); }
.nav-group-items { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-group.collapsed .nav-group-items { display: none; }
.nav-link.sub { padding: 7px 16px 7px 22px; font-size: 13.5px; }
.nav-link.sub .icon { width: 18px; height: 18px; }

.breadcrumb { margin: 0 0 2px; font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .03em; }

/* Meniu mai compact, ca să încapă și grupurile CRM fără derulare */
.sidebar { padding: 14px 10px; }
.nav { gap: 2px; }
.nav-link { padding: 8px 16px; }
.nav-link.sub { padding: 6px 12px 6px 22px; gap: 10px; font-size: 13px; white-space: nowrap; }
.nav-link.sub span { overflow: hidden; text-overflow: ellipsis; }
.nav-group { margin-top: 8px; padding-top: 8px; }
.plan-card { margin-top: 12px; padding: 12px; }
.plan-card p { margin: 6px 0 8px; }
.plan-card .progress { margin-bottom: 10px; }

/* =========================================================
   Pagina Oferte (pipeline Kanban)
   ========================================================= */
.stats.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.offers-main { padding-bottom: 24px; }
.owner-select { flex: 0 0 190px; }
.owner-select select { height: 42px; }
.view-toggle-group { display: flex; gap: 6px; }
.view-toggle-group .btn { height: 42px; }
.page-actions > .row-menu .icon-btn { width: 42px; height: 42px; }
.role-sales { background: var(--orange-soft); color: #c2410c; }
.roles-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.kanban {
    display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px;
    align-items: start; overflow-x: auto; padding-bottom: 8px;
}
.kanban-col {
    display: flex; flex-direction: column; gap: 10px; min-width: 0;
    padding: 8px; border-radius: 12px; background: color-mix(in srgb, var(--sc) 5%, white);
    border: 1px solid color-mix(in srgb, var(--sc) 14%, white);
}
.kanban-head {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
    padding: 10px 12px; border-radius: 9px; background: color-mix(in srgb, var(--sc) 14%, white);
}
.kanban-head h2 { font-size: 15px; font-weight: 700; color: color-mix(in srgb, var(--sc) 75%, black); }
.kanban-head strong { font-size: 13.5px; }
.kanban-count {
    display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px;
    border-radius: 999px; background: var(--surface); font-size: 12.5px; font-weight: 700;
}
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 60px; border-radius: 9px; transition: background .12s; }
.kanban-cards.drag-over { background: color-mix(in srgb, var(--sc) 12%, white); outline: 2px dashed color-mix(in srgb, var(--sc) 45%, white); outline-offset: 2px; }
.kanban-empty { margin: 0; padding: 18px 8px; text-align: center; font-size: 12px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 9px; }
.kanban-empty[hidden] { display: none; }
.kanban-add {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    padding: 9px; border: 0; border-radius: 9px; background: var(--primary-soft); color: var(--primary);
    font-size: 13px; font-weight: 500; cursor: pointer;
}
.kanban-add .icon { width: 16px; height: 16px; }
.kanban-add:hover { background: #e0e3ff; }

.offer-card {
    position: relative; padding: 10px 10px 10px 13px; border-radius: 9px; background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow); cursor: grab;
}
.offer-card::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sc); }
.offer-card:hover { border-color: color-mix(in srgb, var(--sc) 40%, white); }
.offer-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.offer-card.dragging { opacity: .45; cursor: grabbing; }
.offer-card.saving { opacity: .7; }
.offer-top { display: flex; align-items: flex-start; gap: 8px; }
.offer-top .logo { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
.offer-name { flex: 1; min-width: 0; }
.offer-name strong { display: block; font-size: 12.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.offer-name small { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-menu-btn { width: 26px; height: 26px; flex-shrink: 0; }
.card-menu-btn .icon { width: 16px; height: 16px; }
.offer-state { display: grid; place-items: center; flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; margin-top: 3px; color: #fff; }
.offer-state .icon { width: 12px; height: 12px; stroke-width: 3; }
.offer-state.won { background: var(--success); }
.offer-state.lost { background: var(--surface); color: var(--danger); border: 1.5px solid #fbb; }
.offer-title { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); }
.offer-value { margin: 8px 0 6px; font-size: 13.5px; font-weight: 700; }
.offer-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.offer-date { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.offer-date .icon { width: 13px; height: 13px; }
.offer-date.late { color: var(--danger); font-weight: 500; }
.avatar-circle.xs { width: 24px; height: 24px; font-size: 9.5px; }
.stage-badge { background: color-mix(in srgb, var(--sc) 12%, white); color: color-mix(in srgb, var(--sc) 80%, black); }
.dropdown a .swatch { width: 10px; height: 10px; }

@media (max-width: 1400px) {
    .stats.stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .stats.stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-actions .head-select, .page-actions .owner-select { flex: 1 1 100%; }
}

.offers-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.offers-head > .page-actions { flex: 0 1 auto; justify-content: flex-end; }
.offers-head .head-select { flex: 0 0 252px; }
.offer-people { display: inline-flex; align-items: center; gap: 5px; }
.offer-state { margin-top: 0; }
.offer-name strong { font-size: 12.5px; }

/* =========================================================
   Pagina Follow-up
   ========================================================= */
.fu-board-card { padding: 16px; margin-bottom: 18px; }
.fu-board-card .card-title { margin-bottom: 12px; }
.fu-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.fu-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px; border-radius: 11px; background: color-mix(in srgb, var(--sc) 5%, white); }
.fu-col-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 10px 9px 12px; border-radius: 8px; border-left: 3px solid var(--sc);
    background: color-mix(in srgb, var(--sc) 12%, white);
}
.fu-col-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: color-mix(in srgb, var(--sc) 80%, black); }
.fu-cards { display: flex; flex-direction: column; gap: 8px; min-height: 50px; border-radius: 8px; }
.fu-cards.drag-over { outline: 2px dashed color-mix(in srgb, var(--sc) 50%, white); outline-offset: 2px; background: color-mix(in srgb, var(--sc) 10%, white); }
.fu-card {
    display: flex; gap: 9px; padding: 9px; border-radius: 9px; background: var(--surface);
    border: 1px solid var(--border); border-left: 3px solid var(--sc); box-shadow: var(--shadow); cursor: grab;
}
.fu-card.dragging { opacity: .45; }
.fu-card.saving { opacity: .7; }
.fu-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.fu-card .logo { width: 30px; height: 30px; font-size: 14px; border-radius: 8px; }
.fu-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fu-card-body strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-card-body small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fu-card-body .offer-date { margin-top: 4px; }
.fu-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 4px; }
.offer-state.late-icon { background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.fu-more { text-align: center; font-size: 12.5px; color: var(--primary); font-weight: 500; }
.fu-more:hover { text-decoration: underline; }

.type-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
    background: color-mix(in srgb, var(--tc) 12%, white); color: color-mix(in srgb, var(--tc) 80%, black); font-size: 12px; font-weight: 500;
}
.type-chip .icon { width: 13px; height: 13px; }
.fu-todo     { background: #f1f5f9; color: #475569; }
.fu-progress { background: var(--blue-soft); color: #1d4ed8; }
.fu-done     { background: var(--success-soft); color: var(--success); }
.fu-late     { background: var(--danger-soft); color: var(--danger); font-weight: 600; }

.fu-form-card .form { gap: 11px; }
.fu-form-card.highlight { box-shadow: 0 0 0 2px var(--primary), var(--shadow); transition: box-shadow .3s; }
.fu-type-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fu-type-list a { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.fu-type-list a:hover, .fu-type-list a.active { background: #f5f5fb; color: var(--primary); }
.fu-type-list strong { margin-left: auto; font-size: 13px; }
.fu-type-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--tc); color: #fff; }
.fu-type-icon .icon { width: 15px; height: 15px; }
.fu-today { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.fu-today li { display: flex; align-items: center; gap: 10px; }
.fu-today li > div { flex: 1; min-width: 0; }
.fu-today strong { display: block; font-size: 13px; }
.fu-today small { font-size: 11.5px; }
.fu-time { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.fu-time.late { color: var(--danger); }

@media (max-width: 1300px) {
    .fu-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .fu-board { grid-template-columns: minmax(0, 1fr); }
}

#fu-table th, #fu-table td { padding-left: 7px; padding-right: 7px; }
#fu-table .store-cell .cell-main { white-space: normal; }
.fu-form-card .form-actions .btn { padding: 0 10px; font-size: 13px; white-space: nowrap; }
.fu-form-card .form-actions { grid-template-columns: auto 1fr; }

/* =========================================================
   Pagina Vânzări (oportunități grupate după sarcini)
   ========================================================= */
.sales-head { align-items: center; }
.sales-title { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.split-btn { display: inline-flex; }
.split-btn > .btn { border-radius: var(--radius-sm) 0 0 var(--radius-sm); height: 40px; }
.split-btn .split-toggle { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; height: 40px; padding: 0 10px; border-left: 1px solid rgba(255, 255, 255, .35); }
.split-btn .dropdown { left: 0; right: auto; }
.head-btn { height: 40px; font-weight: 500; }
.head-btn.active { background: var(--primary-soft); border-color: #c7cbf7; color: var(--primary); }
.head-btn .icon:last-child { width: 15px; height: 15px; }
.icon-btn.round { border-radius: 50%; width: 40px; height: 40px; }
.icon-btn.active { border-color: var(--primary); }
.filter-dropdown { min-width: 280px; padding: 12px; }
.dropdown-form { display: flex; flex-direction: column; gap: 10px; }
.dropdown-actions { display: flex; justify-content: space-between; align-items: center; }
.dropdown a .avatar-circle { margin-right: 2px; }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.chip { padding: 3px 9px; border-radius: 999px; background: #eef0f4; color: var(--text-2); font-size: 12px; }

.sales-group { margin-bottom: 16px; overflow: hidden; }
.sales-table th { background: #fafbfc; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 12px 16px; }
.sales-table th:first-child { color: var(--text-2); font-weight: 600; width: 46%; }
.sales-table th:first-child, .sales-table th:last-child { border-radius: 0; }
.sales-table td { padding: 10px 16px; font-size: 13.5px; }
.sales-table th:nth-child(2) { width: 17%; }
.sale-open { display: flex; align-items: center; gap: 14px; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.sale-open:hover strong { color: var(--primary); }
.sale-icon { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; color: var(--text-2); }
.sale-icon .icon { width: 20px; height: 20px; }
.sale-icon.late { color: var(--danger); }
.sale-text { min-width: 0; }
.sale-text strong { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sale-text strong .muted { font-weight: 400; }
.sale-text small { font-size: 12.5px; }
.sale-badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
    background: var(--bg); color: var(--fg); font-size: 12.5px; font-weight: 600;
}
.sale-due { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.sale-due .icon { width: 16px; height: 16px; }
.sale-due.today, .sale-due.tomorrow { color: var(--primary); font-weight: 500; }
.sale-due.overdue { color: var(--danger); font-weight: 600; }
.sales-count { margin: 4px 2px 12px; }
.trash-actions { margin-top: 8px; }

/* Panoul de etape */
.stage-panel { padding: 16px 18px; }
.stage-group { padding: 12px 0; border-top: 1px solid var(--border); }
.stage-group:first-child { border-top: 0; padding-top: 0; }
.stage-group h3 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--text); }
.stage-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stage-group li a, .trash-link { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-radius: 7px; color: var(--primary); font-size: 14px; }
.stage-group li a:hover, .trash-link:hover { background: #f5f5fb; }
.stage-group li a.on, .trash-link.on { background: var(--primary-soft); font-weight: 600; }
.stage-check { display: grid; place-items: center; flex-shrink: 0; width: 18px; height: 18px; border-radius: 4px; background: var(--bg); border: 1px solid rgba(0, 0, 0, .08); color: #fff; }
.stage-check .icon { width: 12px; height: 12px; stroke-width: 3; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .6)); }
.trash-link .icon { width: 17px; height: 17px; }
.stage-hint { margin: 8px 0 0; font-size: 11.5px; }

/* Kanban vânzări */
.sales-kanban { grid-template-columns: repeat(7, minmax(170px, 1fr)); }
.sale-card .sale-open { display: block; }
.sale-task { display: flex; align-items: center; gap: 5px; margin: 0 0 6px; font-size: 11.5px; color: var(--text-2); }
.sale-task .icon { width: 13px; height: 13px; flex-shrink: 0; }
.sale-card .sale-due { font-size: 11.5px; }
.sale-card .sale-due .icon { width: 13px; height: 13px; }

/* Modal */
.sale-grid { grid-template-columns: minmax(0, 1fr) 220px; }
.task-box { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.task-box.next-task { border-color: #c7cbf7; background: var(--primary-soft); }
.task-box[hidden] { display: none; }
.complete-toggle { margin-top: 0; font-size: 13px; color: var(--text); font-weight: 500; }
.complete-toggle[hidden] { display: none; }
.sale-history[hidden] { display: none; }
.history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.history-list li { position: relative; padding-left: 14px; font-size: 12.5px; color: var(--text-2); }
.history-list li::before { content: ''; position: absolute; left: 0; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.history-list small { font-size: 11px; }
[data-new-only][hidden] { display: none; }

@media (max-width: 900px) {
    .sales-table th:nth-child(3), .sales-table td:nth-child(3) { display: none; }
    .sale-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Titlul paginii ocupă doar cât îi trebuie; spațiul rămas merge la conținut (pagini scurte) */
.app.with-head { grid-template-rows: auto 1fr; }
@media (max-width: 900px) { .app.with-head { grid-template-rows: none; } }

/* =========================================================
   Pagina Proiecte
   ========================================================= */
.projects-table th:first-child { width: 44%; }
.projects-table th:nth-child(3) { width: 20%; }
.projects-table .sale-open .avatar-circle { width: 32px; height: 32px; font-size: 11.5px; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.progress-cell { display: inline-flex; align-items: center; gap: 10px; }
.progress.thin { width: 130px; height: 6px; margin: 0; }
.progress.thin.complete span { background: var(--success); }
.progress-count { font-size: 13px; color: var(--text-2); min-width: 32px; }

.steps-head { display: flex; align-items: center; justify-content: space-between; }
.steps-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.step-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 8px; }
.step-row input[type=text] { flex: 1; min-width: 0; height: 32px; padding: 0 8px; border: 0; background: transparent; outline: none; }
.step-row input[type=text]:focus { background: #f7f8fb; border-radius: 6px; }
.step-row.is-done input[type=text] { text-decoration: line-through; color: var(--muted); }
.steps-list:empty::before { content: 'Niciun pas încă. Adaugă pașii necesari pentru a urmări progresul.'; display: block; padding: 10px; font-size: 12.5px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 8px; }
[data-deadline-field][hidden] { display: none; }

@media (max-width: 900px) {
    .progress.thin { width: 70px; }
    .ellipsis { max-width: 200px; }
}

/* Coloane aliniate între grupuri (fiecare grup e un tabel separat) */
.sales-table { table-layout: fixed; }
.sales-table th:nth-child(1) { width: 46%; }
.sales-table th:nth-child(2) { width: 15%; }
.sales-table th:nth-child(3) { width: 16%; }
.sales-table th:nth-child(4) { width: 15%; }
.sales-table th:nth-child(5) { width: 8%; }
.projects-table th:nth-child(1) { width: 42%; }
.projects-table th:nth-child(2) { width: 13%; }
.projects-table th:nth-child(3) { width: 22%; }
.projects-table th:nth-child(4) { width: 15%; }
.sales-table .sale-open, .sales-table .sale-text { min-width: 0; }
.sales-table .ellipsis { max-width: 100%; }
@media (max-width: 900px) { .sales-table { table-layout: auto; } }

/* Meniul lateral: linkurile se derulează, cardul Plan rămâne jos */
.sidebar { overflow: hidden; }
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; margin-right: -6px; padding-right: 6px; }
.sidebar .plan-card { flex-shrink: 0; }

/* =========================================================
   Fișa oportunității (sale.php)
   ========================================================= */
.sale-head { align-items: center; }
.sale-head-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.sale-head-title h1 { font-size: 24px; min-width: 0; }
.sale-head-title h1 .muted { font-weight: 500; }
.ellipsis-1 { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stage-select { position: relative; flex-shrink: 0; }
.stage-select select {
    appearance: none; -webkit-appearance: none; height: 38px; padding: 0 36px 0 14px; border: 0; border-radius: var(--radius-sm);
    background: var(--bg); color: var(--fg); font-weight: 600; cursor: pointer;
}
.stage-select select:disabled { cursor: not-allowed; opacity: .8; }
.stage-select select option, .stage-select select optgroup { background: #fff; color: var(--text); }
.stage-select .icon { position: absolute; right: 10px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--fg); pointer-events: none; }
.modified { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.modified .icon { width: 16px; height: 16px; }
.modified.saving { color: var(--primary); }
.inline-form { display: inline; margin: 0; }

.sale-detail { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.sale-detail.is-locked .sale-fields input, .sale-detail.is-locked .sale-fields select, .sale-detail.is-locked .sale-fields textarea { background: #f7f8fb; }
.sale-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sale-panel { padding: 18px 20px; }
.sale-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sale-panel-head h2 { font-size: 18px; font-weight: 600; }

/* Sarcini */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.task-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid #f0f1f5; }
.task-item:first-child { border-top: 0; }
.task-item > .avatar-circle { width: 40px; height: 40px; font-size: 13px; }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.task-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.task-top strong { font-size: 14px; }
.task-title { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.split-btn.light > .btn { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.split-btn.light .split-toggle { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: 0; padding: 0 8px; height: 32px; }
.split-btn .btn-sm { height: 32px; }
.dropdown-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; font-size: 13px; color: var(--text-2); text-align: left; cursor: pointer; white-space: nowrap; }
.dropdown-btn:hover { background: #f5f5fb; }
.dropdown-btn .icon { width: 16px; height: 16px; color: var(--muted); }
.task-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-bottom: 12px; border: 1px solid #c7cbf7; border-radius: 10px; background: var(--primary-soft); }
.task-form[hidden] { display: none; }
.task-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; }
.task-fields input { height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); min-width: 0; }
.task-fields .select select { height: 36px; }
.task-form-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.task-form-actions .spacer { flex: 1; }
.task-empty { margin: 4px 0 8px; }
.done-tasks { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.done-tasks summary { cursor: pointer; font-size: 13px; color: var(--primary); font-weight: 500; }
.done-tasks ul { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.done-tasks li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.done-tasks li > span:nth-child(2) { flex: 1; min-width: 0; }
.done-tasks .link-sm { background: none; border: 0; cursor: pointer; }

/* Istoric */
.tab-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #eef0f4; font-size: 12px; color: var(--text-2); }
.history-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.history-bar h2 { font-size: 18px; font-weight: 600; margin-right: auto; }
.history-filter { width: 210px; }
.history-filter select { height: 32px; font-size: 13px; }
.tl-day h4 { margin: 18px 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: flex; gap: 14px; padding-bottom: 16px; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; background: #bfdbfe; }
.tl-icon { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: #3b82f6; color: #fff; }
.tl-icon .icon { width: 17px; height: 17px; }
.tl-status .tl-icon { background: #1e3a8a; }
.tl-task .tl-icon { background: var(--success); }
.tl-email .tl-icon { background: #6366f1; }
.tl-note .tl-icon, .tl-call .tl-icon, .tl-meeting .tl-icon { background: #f59e0b; }
.tl-created .tl-icon { background: var(--primary); }
.tl-file .tl-icon { background: #64748b; }
.tl-body { flex: 1; min-width: 0; padding: 7px 0 12px; border-bottom: 1px solid #f0f1f5; }
.tl-head { display: flex; justify-content: space-between; gap: 10px; }
.tl-head strong { font-size: 14px; font-weight: 600; }
.tl-head time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tl-fields { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.tl-text { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2); white-space: normal; }
.tl-item.fresh .tl-body { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--primary-soft); } }
.assoc-title { margin: 16px 0 8px; font-size: 14px; }
.assoc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.assoc-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.assoc-list a { color: var(--primary); font-weight: 500; }

/* Secțiuni câmpuri */
.sale-section { padding: 0; }
.sale-section > summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; list-style: none; }
.sale-section > summary::-webkit-details-marker { display: none; }
.sale-section > summary h2 { font-size: 16px; font-weight: 600; }
.sale-section .sec-chev { width: 18px; height: 18px; color: var(--text-2); transform: rotate(180deg); transition: transform .15s; }
.sale-section:not([open]) .sec-chev { transform: none; }
.sale-fields { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 18px; }
.sale-fields .field input, .sale-fields .field textarea { background: var(--surface); }
.field.saved input, .field.saved textarea, .field.saved select { border-color: var(--success) !important; box-shadow: 0 0 0 3px rgba(22, 163, 74, .12); }
.field.save-error input, .field.save-error textarea, .field.save-error select { border-color: var(--danger) !important; }
.offer-attach { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.upload-drop {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 12px;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.upload-drop:hover, .upload-drop.drag { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.upload-drop .icon { width: 17px; height: 17px; }
.attach-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.attach-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.attach-list li a { flex: 1; min-width: 0; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list .icon { width: 15px; height: 15px; color: var(--muted); }
.autosave-hint { display: flex; align-items: center; gap: 6px; margin: 0 4px; }
.autosave-hint .icon { width: 15px; height: 15px; }

/* Coloana dreaptă */
.sale-side { gap: 0; background: #f7f8fb; border-radius: var(--radius); padding: 4px 16px; }
.side-block { padding: 16px 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.side-block:first-child { border-top: 0; }
.side-block h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.side-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; color: #fff; }
.side-icon .icon { width: 18px; height: 18px; }
.side-icon.green { background: #22c55e; }
.side-icon.orange { background: #f59e0b; }
.side-icon.blue { background: #3b82f6; }
.side-add { margin-left: auto; }
.side-line { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; color: var(--primary); }
.side-line .icon { width: 16px; height: 16px; color: var(--text-2); flex-shrink: 0; }
.side-edit summary { cursor: pointer; }
.side-edit .field { margin-top: 8px; }
.contact-card { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; }
.contact-name { display: flex; align-items: center; gap: 8px; }
.contact-name .icon { width: 17px; height: 17px; color: var(--text-2); }
.contact-name strong { flex: 1; }
.contact-form { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.contact-form[hidden] { display: none; }
.contact-form input { height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px; }
.side-sub { margin: 6px 0 2px; font-size: 13px; font-weight: 500; color: var(--muted); }
.card-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; font-size: 13.5px; color: var(--primary); }
.card-link.current { color: var(--text-2); }
.swatch.sq { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }

@media (max-width: 1400px) {
    .sale-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .sale-side { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
    .sale-side .side-block { border-top: 0; }
}
@media (max-width: 1000px) {
    .sale-detail, .sale-side { grid-template-columns: minmax(0, 1fr); }
    .sale-head { flex-wrap: wrap; }
    .sale-head-title { flex-wrap: wrap; }
    .task-fields, .offer-attach { grid-template-columns: minmax(0, 1fr); }
}

/* Grupurile din Vânzări / Proiecte: meniul "…" nu mai e tăiat de card (colțurile se rotunjesc pe antet) */
.sales-group { overflow: visible; }
.sales-group .sales-table thead th:first-child { border-top-left-radius: var(--radius); }
.sales-group .sales-table thead th:last-child { border-top-right-radius: var(--radius); }
.sales-group .sales-table tbody tr:last-child td { border-bottom: 0; }
.sales-group .sales-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
.sales-group .sales-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.dropdown-label { display: block; padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dropdown-sep { height: 1px; margin: 4px 6px; background: var(--border); }

/* Meniu scos din containerul care l-ar tăia (poziționat în fereastră de JS) */
.dropdown.floating { position: fixed; right: auto; bottom: auto; z-index: 80; max-height: calc(100vh - 16px); overflow-y: auto; }

/* Fișa magazinului (Vezi detalii) */
.logo.lg { width: 46px; height: 46px; font-size: 20px; border-radius: 12px; }
#store-view-modal .modal-head .badge { align-self: center; margin-left: auto; }
#store-view-modal .modal-close { margin-left: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.detail-grid dt, .detail-notes dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.detail-grid dd { margin: 0; font-size: 14px; }
.detail-grid dd small { font-size: 12px; }
.detail-notes { margin-top: 16px; padding: 12px; background: #f7f8fb; border-radius: 8px; }
.detail-notes[hidden] { display: none; }
.detail-notes p { margin: 0; font-size: 13.5px; white-space: pre-line; }
.detail-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid var(--border); }
@media (max-width: 640px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   Dialog de confirmare (înlocuiește window.confirm)
   ========================================================= */
body.confirm-open { overflow: hidden; }
.confirm-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.confirm-modal[hidden] { display: none; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); animation: fade-in .15s ease-out; }
.confirm-dialog {
    position: relative; width: min(420px, 100%); padding: 28px 26px 22px; text-align: center;
    background: var(--surface); border-radius: 16px; box-shadow: 0 24px 64px rgba(15, 23, 42, .3);
    animation: confirm-in .18s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes confirm-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.confirm-icon {
    display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary); box-shadow: 0 0 0 8px color-mix(in srgb, var(--primary-soft) 55%, transparent);
}
.confirm-icon .icon { width: 26px; height: 26px; }
.tone-danger .confirm-icon { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 8px #fef2f2; }
.tone-warning .confirm-icon { background: #fef3c7; color: #d97706; box-shadow: 0 0 0 8px #fffbeb; }
.confirm-dialog h2 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--text); }
.confirm-dialog p { margin: 0 0 22px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions .btn { height: 42px; font-size: 14px; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.confirm-actions .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tone-danger .confirm-actions .btn-danger:focus-visible { outline-color: var(--danger); }
@media (max-width: 480px) {
    .confirm-modal { align-items: end; padding: 0; }
    .confirm-dialog { width: 100%; border-radius: 16px 16px 0 0; padding-bottom: 26px; }
    .confirm-actions { grid-template-columns: minmax(0, 1fr); }
    .confirm-actions [data-confirm-ok] { order: -1; }
}
.confirm-dialog { width: min(440px, 100%); }
.confirm-actions .btn { padding: 0 12px; white-space: nowrap; }

/* Fișa clientului */
.avatar-circle.lg { width: 46px; height: 46px; font-size: 15px; }
#client-view-modal .modal-head .badge { align-self: center; margin-left: auto; }
#client-view-modal .modal-close { margin-left: 8px; }
#client-view-modal .modal-head p { margin: 2px 0 0; }
.client-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.client-kpis div { padding: 10px 12px; border-radius: 10px; background: #f7f8fb; }
.client-kpis span { display: block; font-size: 11.5px; color: var(--muted); }
.client-kpis strong { font-size: 15px; }
.detail-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .client-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   Fișa tehnică a magazinului (store_tech.php)
   ========================================================= */
.tech-head .sale-head-title h1 .muted { font-size: 15px; font-weight: 500; }
.tech-head .sale-head-title .badge { align-self: center; }
.tech-head .breadcrumb { margin-bottom: 0; }
.mono-value { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 19px !important; }
.tech-card { padding: 8px 18px 18px; }
.tech-card .inline-tabs { margin-bottom: 4px; }
.tech-card .tab { display: inline-flex; align-items: center; gap: 7px; }
.tech-card .tab .icon { width: 17px; height: 17px; }
.tech-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 12px; flex-wrap: wrap; }
.tech-bar .input-icon { flex: 0 1 380px; height: 36px; }
.tech-table td { font-size: 13px; }
.tech-table tr.is-retired td { opacity: .55; }
.device-icon { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px; }
.device-icon .icon { width: 18px; height: 18px; }
.dev-pc { background: var(--primary-soft); color: var(--primary); }
.dev-printer { background: var(--blue-soft); color: var(--blue); }
.dev-network { background: var(--success-soft); color: var(--success); }
.dev-other { background: #f1f2f5; color: #475569; }
.ip-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 6px;
    background: var(--surface); font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; color: var(--text); cursor: pointer;
}
.ip-chip .icon { width: 13px; height: 13px; color: var(--muted); }
.ip-chip:hover { border-color: var(--primary); color: var(--primary); }
.ip-chip:hover .icon { color: var(--primary); }
.dev-status-activ { background: var(--success-soft); color: var(--success); }
.dev-status-defect { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.dev-status-retras { background: #f1f2f5; color: #64748b; }
.int-done { background: var(--success-soft); color: var(--success); }
.int-open { background: #fef3c7; color: #b45309; font-weight: 600; }
.int-planned { background: var(--blue-soft); color: #1d4ed8; }
.network-form { padding-top: 14px; gap: 18px; }
.network-form h3 { display: flex; align-items: center; gap: 8px; }
.network-form h3 .icon { width: 18px; height: 18px; color: var(--primary); }
.tech-timeline { margin-top: 6px; }
.tech-timeline .tl-head { align-items: flex-start; }
.tech-timeline .tl-head small { display: block; margin-top: 2px; }
.tl-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tl-side time { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tech-link { vertical-align: middle; margin-right: 4px; }
.tech-link .icon { width: 16px; height: 16px; }
.store-card footer .link-sm { margin-left: auto; margin-right: 10px; }

@media print {
    body:not(.print-invoice) [data-tab-pane] { display: block !important; }
    body:not(.print-invoice) .tech-card .inline-tabs, body:not(.print-invoice) .tech-bar, body:not(.print-invoice) .row-menu,
    body:not(.print-invoice) .network-form .set-actions { display: none !important; }
}
@media (max-width: 900px) {
    .tl-side { flex-wrap: wrap; justify-content: flex-end; }
    .tech-head .sale-head-title { flex-wrap: wrap; }
}
.tech-table th, .tech-table td { padding-left: 8px; padding-right: 8px; }
.tech-table td .cell-main { white-space: normal; }
.tech-table td small { white-space: normal; }
.tech-table td.mono { font-size: 11.5px; }
.tech-table .device-icon { width: 30px; height: 30px; }

/* Butoanele din coloana Acțiuni: pe aceeași linie, aliniate pe centru */
.row-actions { display: inline-flex; align-items: center; justify-content: center; gap: 6px; vertical-align: middle; }
.row-actions .row-menu { display: inline-flex; }
.row-actions .tech-link { margin-right: 0; }

/* =========================================================
   Vederea de azi (today.php)
   ========================================================= */
.today-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.today-stat {
    --tc: var(--primary); --tb: var(--primary-soft);
    display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--border); border-left: 4px solid var(--tc);
    border-radius: var(--radius); background: var(--surface); color: var(--text); transition: box-shadow .15s, border-color .15s;
}
.today-stat:hover { box-shadow: 0 4px 14px rgba(15, 23, 42, .07); }
.today-stat.on { background: var(--tb); border-color: var(--tc); }
.today-stat small { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.today-stat strong { display: block; font-size: 30px; line-height: 1.1; font-weight: 700; margin-top: 4px; }
.today-stat-icon { display: grid; place-items: center; flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; background: var(--tb); color: var(--tc); }
.today-stat.on .today-stat-icon { background: var(--tc); color: #fff; }
.today-stat-icon .icon { width: 22px; height: 22px; }
.today-stat.tone-blue { --tc: #2563eb; --tb: #eff6ff; }
.today-stat.tone-red { --tc: #dc2626; --tb: #fef2f2; }
.today-stat.tone-green { --tc: #16a34a; --tb: #f0fdf4; }
.today-stat.tone-gray { --tc: #64748b; --tb: #f1f5f9; }
.today-stat.tone-red strong { color: #dc2626; }

.today-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.today-bar-left, .today-bar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.today-bar h2 { font-size: 16px; font-weight: 600; margin: 0; }
.suggest-btn { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.suggest-btn .icon { color: #d97706; }
.suggest-btn[aria-expanded="true"] { background: #fef3c7; }
.today-bar-right .link-sm { display: inline-flex; align-items: center; gap: 6px; }
.today-bar-right .link-sm .icon { width: 15px; height: 15px; }
.today-bar-right .link-sm.on { font-weight: 600; text-decoration: underline; }
.today-range { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.today-range > .icon { width: 16px; height: 16px; color: var(--muted); }
.today-range input[type="date"] { height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 6px; font: inherit; font-size: 13px; background: var(--surface); color: var(--text); }

.suggest-box { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; border-color: #fcd34d; background: #fffbeb; }
.suggest-box .modal-icon { background: #fef3c7; color: #d97706; flex-shrink: 0; }
.suggest-box > div { flex: 1; min-width: 0; }
.suggest-box p { margin: 2px 0; font-size: 13.5px; color: var(--text-2); }
.suggest-box[hidden] { display: none; }

.today-table { table-layout: fixed !important; width: 100%; }
.today-table th:first-child { width: auto; }
.today-table th:nth-child(2) { width: 15%; }
.today-table th:nth-child(3) { width: 11%; }
.today-table th:nth-child(4) { width: 13%; }
.today-table th:nth-child(5) { width: 19%; }
.today-table th:last-child { width: 72px; }
.today-table .sale-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.today-table tr.is-done .sale-text strong { text-decoration: line-through; color: var(--muted); }
.today-table tr.is-done .sale-icon { color: var(--success); }
.today-table .sale-due { white-space: normal; }
.module-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.module-link .icon { width: 15px; height: 15px; color: var(--muted); }
.module-link:hover { color: var(--primary); }
.postponed-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 6px; border-radius: 10px; background: #f1f5f9; color: #475569; font-size: 11.5px; vertical-align: middle; }
.postponed-tag .icon { width: 12px; height: 12px; }

.today-side h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 18px 0 8px; }
.today-side h3:first-child { margin-top: 2px; }
.today-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.today-side ul a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; font-size: 13.5px; color: var(--text-2); }
.today-side ul a:hover, .today-side ul a.on { background: var(--primary-soft); color: var(--primary); }
.today-side ul a .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.today-mods a span { flex: 1; }
.today-mods b { min-width: 24px; padding: 1px 7px; border-radius: 10px; background: #f1f5f9; color: var(--muted); font-size: 12px; text-align: center; }
.today-mods b.has { background: #fee2e2; color: #b91c1c; }
.today-recent a { align-items: flex-start; }
.today-recent .swatch { width: 10px; height: 10px; border-radius: 3px; margin-top: 5px; flex-shrink: 0; }
.today-recent strong { display: block; font-size: 13.5px; color: var(--text); font-weight: 500; }
.today-recent small { display: block; font-size: 12px; color: var(--muted); }

@media (max-width: 1200px) {
    .today-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .today-table th:nth-child(3), .today-table td:nth-child(3), .today-table th:nth-child(4), .today-table td:nth-child(4) { display: none; }
    .today-table th:first-child { width: auto; }
    .today-table th:nth-child(2) { width: 30%; }
}
@media (max-width: 560px) {
    .today-stats { gap: 10px; }
    .today-stat { padding: 12px; gap: 10px; }
    .today-stat-icon { width: 36px; height: 36px; }
    .today-stat strong { font-size: 24px; }
    .today-table th:nth-child(2), .today-table td:nth-child(2) { display: none; }
    .today-table th:nth-child(5) { width: 34%; }
    .suggest-box { flex-wrap: wrap; }
    .today-bar-right, .today-range { width: 100%; }
    .today-range { flex-wrap: wrap; }
    .today-range input[type="date"] { flex: 1 1 110px; min-width: 0; }
    .today-range .btn { width: 100%; }
}

/* Vânzări: bannerul cu filtre (ca în MiniCRM) și "Arată toate" pe grupă */
.filter-banner { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #f8f9fc; }
.filter-banner-icon { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; color: var(--text-2); }
.filter-banner-icon .icon { width: 20px; height: 20px; }
.filter-banner > div { flex: 1; min-width: 0; }
.filter-banner p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 14px; font-weight: 500; color: var(--text); }
.filter-banner .link-sm { padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--primary); }
.filter-banner .link-sm:hover { text-decoration: underline; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 9px; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.filter-chip .icon { width: 13px; height: 13px; color: var(--muted); }
.filter-chip .swatch { width: 9px; height: 9px; border-radius: 3px; }
.filter-chip:hover { border-color: var(--danger); color: var(--danger); }
.filter-chip:hover .icon:last-child { color: var(--danger); }
.group-more { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--primary); }
.group-more:hover { background: var(--primary-soft); }
.group-more .icon { width: 15px; height: 15px; }
.icon.flip { transform: rotate(180deg); }
.sale-due.week { color: var(--text); font-weight: 500; }

/* Fișa oportunității: meniul de etape grupat, sarcini cu detalii, fișiere și comentarii */
.stage-menu { flex-shrink: 0; }
.stage-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; max-width: 260px; padding: 0 10px 0 14px; border: 0; border-radius: var(--radius-sm);
    background: var(--bg); color: var(--fg); font: inherit; font-weight: 600; cursor: pointer;
}
.stage-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-btn .icon { width: 16px; height: 16px; flex-shrink: 0; padding-left: 8px; box-sizing: content-box; border-left: 1px solid color-mix(in srgb, var(--fg) 35%, transparent); }
.stage-btn:disabled { cursor: not-allowed; opacity: .8; }
.stage-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.stage-menu .stage-dropdown { left: 0; right: auto; min-width: 250px; max-height: min(460px, 70vh); overflow-y: auto; }
.stage-dropdown .dropdown-label { padding-top: 10px; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.stage-dropdown a .swatch.sq { width: 14px; height: 14px; border-radius: 3px; }
.stage-dropdown a.on { background: var(--bg); color: var(--fg); font-weight: 600; }
.stage-dropdown a.on .swatch { box-shadow: 0 0 0 2px #fff; }

.task-meta { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; }
.task-count { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.task-count .icon { width: 15px; height: 15px; }
.task-note { font-size: 14px; line-height: 1.55; color: var(--text); overflow-wrap: anywhere; }
.task-note-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font: inherit; font-size: 13.5px; resize: vertical; }
.task-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.task-files li { display: flex; align-items: center; gap: 6px; font-size: 13.5px; min-width: 0; }
.task-files li > .icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.task-files a { color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task-files a:hover { text-decoration: underline; }
.task-files .icon-btn { opacity: 0; }
.task-files li:hover .icon-btn, .task-files .icon-btn:focus-visible { opacity: 1; }
.task-comment { padding: 12px 14px; border-radius: 10px; background: #f5f6fa; }
.task-comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.task-comment-head time { margin-left: auto; font-size: 12px; }
.task-comment p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.task-comments-all { margin-top: 10px; }
.task-comments-all summary { cursor: pointer; list-style: none; font-size: 13px; }
.task-comments-all summary::-webkit-details-marker { display: none; }
.task-comment-old { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.task-comment-old p { margin-top: 4px; }
.task-comment-form { display: flex; flex-direction: column; gap: 8px; }
.task-comment-form[hidden] { display: none; }
.task-comment-form textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; font-size: 13.5px; resize: vertical; }
.task-actions .inline-form { display: inline-flex; }
.task-actions label.btn { cursor: pointer; }
.task-actions label.btn.drag { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 560px) {
    .task-top { flex-wrap: wrap; }
    .task-comment-head time { margin-left: 0; width: 100%; }
}

/* Furnizori / Comenzi (cards.php, card.php) */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .field { min-width: 0; }
.task-box legend { padding: 0 4px; }
.field-with-link { display: flex; align-items: center; gap: 8px; }
.field-with-link .select { flex: 1; min-width: 0; }
.cards-table th:first-child { width: 36%; }
.cards-table th:nth-child(2) { width: 17%; }
.cards-table th:nth-child(3) { width: 15%; }
.cards-table th:nth-child(4) { width: 13%; }
.cards-table th:nth-child(5) { width: 12%; }
.cards-table th:last-child { width: 7%; }
.cell-extra { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
    .cards-table th:nth-child(3), .cards-table td:nth-child(3), .cards-table th:nth-child(4), .cards-table td:nth-child(4) { display: none; }
}
@media (max-width: 560px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .cards-table { table-layout: fixed; }
    .cards-table th:nth-child(2), .cards-table td:nth-child(2) { display: none; }
    .cards-table th:first-child { width: auto; }
    .cards-table th:nth-child(5) { width: 30%; }
    .cards-table th:last-child { width: 52px; }
}
.cards-table .sale-badge, .today-table .sale-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.cards-table th:first-child { width: 33%; }
.cards-table th:nth-child(2) { width: 20%; }
