* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --gold: #b89b5e;
    --gold-light: #d4bc84;
    --gold-dark: #9a7f48;
    --charcoal: #1a1a2e;
    --bg: #faf9f6;
    --white: #ffffff;
    --card: #ffffff;
    --light-gray: #f0eff0;
    --mid-gray: #e0deda;
    --dark-gray: #8a8a8a;
    --text: #2d2d2d;
    --text-light: #6b6b6b;
    --border: #e8e6e3;
    --success: #34c759;
    --error: #ff3b30;
    --warning: #ff9500;
    --info: #007aff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.dark-mode {
    --bg: #0f0f1a;
    --white: #1c1c2e;
    --card: #1c1c2e;
    --light-gray: #252540;
    --mid-gray: #35355a;
    --text: #eaeaef;
    --text-light: #9a9ab0;
    --border: #2a2a45;
    --charcoal: #eaeaef;
    --dark-gray: #7a7a95;
}

/* ===== LOGIN ===== */
.login-container {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 20px;
}
.login-box {
    background: var(--white); padding: 48px 36px; border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25); text-align: center;
    width: 100%; max-width: 380px;
}
.login-logo-img { height: 48px; margin-bottom: 6px; }
.login-tagline { color: var(--dark-gray); font-size: 13px; margin-bottom: 36px; font-style: italic; letter-spacing: 0.5px; }
.pin-input-group { display: flex; gap: 12px; justify-content: center; margin-bottom: 28px; }
.pin-input {
    width: 56px; height: 64px; font-size: 26px; font-weight: 700;
    text-align: center; border: 2px solid var(--border); border-radius: 12px;
    color: var(--charcoal); background: var(--bg); transition: var(--transition);
    caret-color: var(--gold);
}
.pin-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(184,155,94,0.15); }
.pin-input.filled { border-color: var(--gold); background: rgba(184,155,94,0.06); }
.login-btn {
    background: var(--gold); color: #fff; border: none; padding: 14px 32px;
    border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
    transition: var(--transition); font-family: inherit; width: 100%;
    letter-spacing: 0.3px;
}
.login-btn:hover:not(:disabled) { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(184,155,94,0.3); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error { color: var(--error); font-size: 13px; margin-top: 12px; display: none; font-weight: 500; }
.login-error.show { display: block; }

/* ===== APP LAYOUT ===== */
.app-container { display: none; flex-direction: column; min-height: 100vh; }
.app-container.show { display: flex; }

/* ===== TOPBAR ===== */
.topbar {
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 0 24px; height: 64px; display: flex; justify-content: space-between;
    align-items: center; position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-sm); gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-logo-img { height: 28px; cursor: pointer; transition: var(--transition); }
.topbar-logo-img:hover { opacity: 0.8; }
.topbar-nav { display: flex; gap: 4px; align-items: center; }
.nav-btn {
    background: none; border: none; padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer;
    transition: var(--transition); font-family: inherit; letter-spacing: 0.2px;
}
.nav-btn:hover { background: var(--light-gray); color: var(--text); }
.nav-btn.active { background: rgba(184,155,94,0.1); color: var(--gold); }

.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

.fab-new {
    background: var(--gold); color: #fff; border: none; width: 42px; height: 42px;
    border-radius: 12px; font-size: 22px; font-weight: 300; cursor: pointer;
    transition: var(--transition); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(184,155,94,0.3); line-height: 1;
}
.fab-new:hover { background: var(--gold-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(184,155,94,0.4); }

.icon-btn {
    background: none; border: 1px solid var(--border); width: 38px; height: 38px;
    border-radius: 10px; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-light); font-size: 18px;
}
.icon-btn:hover { background: var(--light-gray); border-color: var(--gold); color: var(--gold); }
.icon-btn .material-icons-round { font-size: 20px; }

.btn {
    background: var(--white); color: var(--text); border: 1px solid var(--border);
    padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px; letter-spacing: 0.2px;
}
.btn:hover { background: var(--light-gray); border-color: var(--mid-gray); }
.btn.primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn.primary:hover { background: var(--gold-dark); }
.btn.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.user-badge {
    display: flex; align-items: center; gap: 8px; padding: 6px 14px;
    border-radius: 10px; background: var(--light-gray); font-size: 12px;
    font-weight: 600; color: var(--text-light); letter-spacing: 0.3px;
}

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.hamburger .material-icons-round { font-size: 24px; color: var(--text); }

@media (max-width: 768px) {
    .topbar { padding: 0 16px; }
    .topbar-nav { display: none; }
    .topbar-nav.show { display: flex; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 12px 16px; flex-direction: column; box-shadow: var(--shadow-md); z-index: 99; }
    .hamburger { display: flex; }
    .user-badge { display: none; }
}

/* ===== VIEWS ===== */
.app-content { flex: 1; overflow-y: auto; }
.view { display: none; padding: 24px; max-width: 1200px; margin: 0 auto; width: 100%; }
.view.active { display: block; }

/* ===== DASHBOARD ===== */
.dash-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.dash-header-left { display: flex; align-items: baseline; gap: 12px; }
.dash-title { font-size: 20px; font-weight: 800; color: var(--charcoal); margin: 0; }
.dash-subtitle { font-size: 12px; color: var(--dark-gray); font-weight: 500; }
.dash-period-tabs {
    display: flex; gap: 4px; background: var(--light-gray);
    padding: 3px; border-radius: 10px;
}
.period-tab {
    background: none; border: none; padding: 7px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 600; color: var(--dark-gray);
    cursor: pointer; transition: var(--transition); font-family: inherit;
}
.period-tab:hover { color: var(--text); }
.period-tab.active {
    background: var(--white); color: var(--gold); box-shadow: var(--shadow-sm);
}
#statsGrid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card); padding: 18px 20px; border-radius: var(--radius);
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--border); transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card:hover::after { background: var(--gold); }
.stat-card.active-filter { outline: 2px solid var(--gold); outline-offset: -2px; }
.stat-card.active-filter::after { background: var(--gold); }
.stat-label { font-size: 11px; color: var(--dark-gray); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--charcoal); }
.stat-value.gold { color: var(--gold); }

#chartsSection {
    display: none;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
#chartsSection.show-charts {
    display: grid !important;
}
.dash-analytics-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-analytics-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.table-card {
    background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.table-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
}
.table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-pagination {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; font-size: 12px; color: var(--dark-gray);
    border-top: 1px solid var(--border);
}
.table-title { font-size: 15px; font-weight: 700; color: var(--charcoal); }
.offers-table { width: 100%; border-collapse: collapse; }
.offers-table th {
    padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; color: var(--dark-gray);
    background: var(--light-gray); border-bottom: 1px solid var(--border);
}
.offers-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.offers-table tbody tr { cursor: pointer; transition: var(--transition); }
.offers-table tbody tr:hover { background: rgba(184,155,94,0.04); }
.status-select { appearance: none; -webkit-appearance: none; outline: none; }
.status-select.status-noua { background: #f0f0f0; color: #666; }
.status-select.status-trimisa { background: #e3f2fd; color: #1565c0; }
.status-select.status-acceptata { background: #e8f5e9; color: #2e7d32; }
.status-select.status-respinsa { background: #fce4ec; color: #c62828; }
.status-select.status-expirata { background: #fff3e0; color: #e65100; }
.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable:hover { color: var(--gold); }
.sort-icon { font-size: 10px; opacity: 0.4; }
.sortable.asc .sort-icon::after { content: ' ▲'; }
.sortable.desc .sort-icon::after { content: ' ▼'; }
.status-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.status-noua { background: rgba(0,122,255,0.08); color: #007aff; }
.status-trimisa { background: rgba(255,149,0,0.08); color: #ff9500; }
.status-acceptata { background: rgba(52,199,89,0.08); color: #34c759; }
.status-respinsa { background: rgba(255,59,48,0.08); color: #ff3b30; }
.status-expirata { background: rgba(142,142,147,0.08); color: #8e8e93; }

@media (max-width: 1024px) {
    #chartsSection.show-charts { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
    .view { padding: 16px; }
    #statsGrid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }
    .offers-table { font-size: 12px; }
    .offers-table th, .offers-table td { padding: 10px 12px; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dash-header { flex-direction: column; align-items: flex-start; }
    .dash-period-tabs { width: 100%; overflow-x: auto; }
    #chartsSection.show-charts { grid-template-columns: 1fr !important; }
}

/* ===== EDITOR ===== */
.editor-sections { display: flex; flex-direction: column; gap: 20px; }
.section-card {
    background: var(--card); border-radius: var(--radius); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); overflow: hidden;
}
.section-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.section-title { font-size: 14px; font-weight: 700; color: var(--charcoal); display: flex; align-items: center; gap: 8px; }
.section-title .material-icons-round { font-size: 18px; color: var(--gold); }
.section-body { padding: 20px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 11px; font-weight: 700; color: var(--dark-gray); text-transform: uppercase; letter-spacing: 0.8px; }
.form-input, .form-select {
    padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text);
    transition: var(--transition);
}
.form-input:focus, .form-select:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(184,155,94,0.1); background: var(--white);
}
.form-input[readonly] { background: var(--light-gray); cursor: not-allowed; color: var(--dark-gray); }

/* ===== ARTICLE CARDS ===== */
.articles-list { display: flex; flex-direction: column; gap: 12px; }
.article-card {
    background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: var(--transition); position: relative;
}
.article-card:hover { border-color: var(--mid-gray); }
.article-card.dragging { opacity: 0.5; border-color: var(--gold); }
.article-card.drag-over { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(184,155,94,0.2); }

.article-main {
    display: grid; grid-template-columns: 40px 60px 1fr; gap: 12px;
    padding: 14px; align-items: center;
}
.article-num {
    font-size: 14px; font-weight: 800; color: var(--gold); text-align: center;
    display: flex; align-items: center; justify-content: center;
    cursor: grab; user-select: none;
}
.article-num:active { cursor: grabbing; }

.article-photo {
    width: 52px; height: 52px; border-radius: 8px; background: var(--white);
    border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; transition: var(--transition); flex-shrink: 0;
}
.article-photo:hover { border-color: var(--gold); }
.article-photo img { width: 100%; height: 100%; object-fit: cover; }
.article-photo .material-icons-round { color: var(--dark-gray); font-size: 20px; }
.article-photo input[type="file"] { display: none; }

.article-fields { display: grid; grid-template-columns: 80px 1fr 60px 100px 60px 130px; gap: 8px; align-items: center; }
.article-fields input, .article-fields select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    font-size: 13px; font-family: inherit; background: var(--white); color: var(--text);
    transition: var(--transition);
}
.article-fields input:focus, .article-fields select:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(184,155,94,0.1);
}
.article-total { font-weight: 700; font-size: 13px; color: var(--charcoal); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-actions {
    display: flex; gap: 4px; justify-content: flex-end; padding: 0 14px 0 0;
}
.article-action-btn {
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--dark-gray); transition: var(--transition); border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.article-action-btn:hover { color: var(--text); background: var(--light-gray); }
.article-action-btn.delete:hover { color: var(--error); background: rgba(255,59,48,0.08); }
.article-action-btn .material-icons-round { font-size: 18px; }

.article-obs {
    display: none; padding: 0 14px 14px 112px;
}
.article-obs.show { display: block; }
.article-obs textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    font-size: 13px; font-family: inherit; background: var(--white); color: var(--text);
    transition: var(--transition); resize: vertical; min-height: 60px;
}
.article-obs textarea:focus { outline: none; border-color: var(--gold); }
.obs-toggle {
    font-size: 11px; color: var(--dark-gray); cursor: pointer; padding: 4px 8px;
    border-radius: 4px; transition: var(--transition); background: none; border: none; font-family: inherit;
}
.obs-toggle:hover { color: var(--gold); }

/* Article brand select */
.article-brand-row {
    padding: 0 14px 8px 112px;
    display: flex; align-items: center; gap: 8px;
}
.article-brand-row label { font-size: 10px; font-weight: 600; color: var(--dark-gray); text-transform: uppercase; letter-spacing: 0.5px; }
.article-brand-row select {
    padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    font-size: 12px; font-family: inherit; background: var(--white); color: var(--text);
    transition: var(--transition); max-width: 200px;
}
.article-brand-row select:focus { outline: none; border-color: var(--gold); }

.add-article-btn {
    background: var(--white); border: 2px dashed var(--border); border-radius: var(--radius-sm);
    padding: 16px; text-align: center; cursor: pointer; transition: var(--transition);
    font-size: 14px; font-weight: 600; color: var(--dark-gray); font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.add-article-btn:hover { border-color: var(--gold); color: var(--gold); background: rgba(184,155,94,0.03); }

@media (max-width: 768px) {
    .article-main { grid-template-columns: 30px 1fr; gap: 8px; padding: 12px; }
    .article-photo { display: none; }
    .article-fields { grid-template-columns: 50px 1fr 40px 70px 50px 70px; gap: 4px; }
    .article-obs { padding-left: 42px; }
    .article-brand-row { padding-left: 42px; }
}

/* ===== TOTALS ===== */
.totals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.total-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.total-row:last-child { border-bottom: none; }
.total-row.grand { font-size: 16px; font-weight: 800; border-bottom: 2px solid var(--gold); padding: 12px 0; color: var(--charcoal); }

@media (max-width: 768px) {
    .totals-grid { grid-template-columns: 1fr; }
}

/* ===== MODAL ===== */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
    z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
    background: var(--white); border-radius: 20px; width: 100%; max-width: 480px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.2); padding: 28px; max-height: 80vh; overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--charcoal); }
.modal-close { background: var(--light-gray); border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-close:hover { background: var(--mid-gray); }
.modal-close .material-icons-round { font-size: 18px; color: var(--text); }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
.modal-btn {
    padding: 14px 20px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--white); font-size: 14px; font-weight: 600; cursor: pointer;
    transition: var(--transition); font-family: inherit; text-align: left;
    display: flex; align-items: center; gap: 12px; color: var(--text);
}
.modal-btn:hover { background: var(--light-gray); border-color: var(--gold); }
.modal-btn .material-icons-round { color: var(--gold); font-size: 22px; }


/* ===== STAR RATING ===== */
.star-rating { display: flex; gap: 4px; }
.star-rating .star {
    font-size: 22px; cursor: pointer; color: var(--border);
    transition: var(--transition); user-select: none;
}
.star-rating .star.active { color: var(--gold); }
.star-rating .star:hover { color: var(--gold-light); }

/* ===== PREVIEW TOOLBAR ===== */
.preview-toolbar {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--charcoal); color: #fff; padding: 12px 24px;
    display: flex; justify-content: center; gap: 12px; z-index: 2000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.preview-toolbar .btn { color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.12); }
.preview-toolbar .btn:hover { background: rgba(255,255,255,0.25); }
.preview-toolbar .btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ===== PRODUCT LIBRARY MODAL ===== */
.product-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    margin-bottom: 8px; transition: var(--transition); cursor: pointer;
}
.product-item:hover { background: rgba(184,155,94,0.05); border-color: var(--gold); }
.product-item-info { flex: 1; }
.product-item-code { font-size: 11px; color: var(--dark-gray); font-weight: 600; }
.product-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.product-item-price { font-size: 12px; color: var(--gold); font-weight: 700; }
.product-item-actions { display: flex; gap: 4px; }

/* ===== ACTIVITY LOG MODAL ===== */
.activity-timeline {
    padding: 0;
}
.activity-item {
    padding: 12px; border-left: 3px solid var(--border); border-bottom: 1px solid var(--border);
    margin-bottom: 8px; transition: var(--transition);
}
.activity-item:last-child { border-bottom: none; }
.activity-item.created { border-left-color: var(--success); }
.activity-item.updated { border-left-color: var(--info); }
.activity-item.deleted { border-left-color: var(--error); }
.activity-item.exported { border-left-color: var(--gold); }
.activity-item-type {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.activity-item-type.created { color: var(--success); }
.activity-item-type.updated { color: var(--info); }
.activity-item-type.deleted { color: var(--error); }
.activity-item-type.exported { color: var(--gold); }
.activity-item-user { font-size: 12px; font-weight: 600; color: var(--text); }
.activity-item-time { font-size: 11px; color: var(--dark-gray); margin-top: 4px; }
.activity-item-details { font-size: 12px; color: var(--text-light); margin-top: 4px; font-style: italic; }

/* ===== OFFER TEMPLATES MODAL ===== */
.template-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-xs);
    margin-bottom: 10px; transition: var(--transition);
}
.template-item:hover { background: rgba(184,155,94,0.05); border-color: var(--gold); }
.template-item-info { flex: 1; }
.template-item-name { font-size: 14px; font-weight: 600; color: var(--text); }
.template-item-created { font-size: 11px; color: var(--dark-gray); margin-top: 2px; }
.template-item-actions { display: flex; gap: 6px; }

/* ===== TOOLBAR BUTTONS ===== */
.toolbar-spacer { flex: 1; }
.toolbar-small-btn {
    padding: 6px 12px; font-size: 12px; background: rgba(184,155,94,0.1);
    border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
    transition: var(--transition); color: var(--text);
    font-family: inherit; font-weight: 600;
}
.toolbar-small-btn:hover { background: rgba(184,155,94,0.2); border-color: var(--gold); }

/* ===== PRINT / PDF ===== */
.print-section {
    display: none; max-width: 210mm; margin: 0 auto;
    padding: 32px 40px; background: #fff; color: #222;
    font-size: 11px; line-height: 1.7;
}
.print-header { text-align: center; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 2px solid var(--gold); }
.print-logo-img { height: 44px; margin-bottom: 4px; }
.print-tagline { font-style: italic; color: #999; font-size: 10px; letter-spacing: 1px; }
.print-title { font-size: 16px; font-weight: 800; color: #1a1a2e; margin-bottom: 16px; letter-spacing: 0.5px; }
.print-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.print-meta-block { font-size: 11px; line-height: 1.8; }
.print-meta-block strong { font-weight: 700; }
.print-client-box { background: #faf9f6; padding: 16px; border-radius: 8px; border: 1px solid #e8e6e3; margin-bottom: 24px; }
.print-client-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }

.print-articles-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 11px; }
.print-articles-table th {
    background: #1a1a2e; color: #fff; padding: 10px 12px; text-align: left;
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700;
}
.print-articles-table td { padding: 10px 12px; border-bottom: 1px solid #e8e6e3; }
.print-articles-table tr:nth-child(even) td { background: #faf9f6; }
.print-obs-row td { font-style: italic; color: #666; font-size: 10px; background: #f5f4f0 !important; padding: 6px 12px 6px 28px; }

.print-totals { text-align: right; margin-bottom: 28px; page-break-inside: avoid; break-inside: avoid; }
.print-total-row { display: flex; justify-content: flex-end; gap: 20px; padding: 6px 0; font-size: 11px; }
.print-total-row.grand { font-size: 14px; font-weight: 800; border-top: 2px solid var(--gold); padding-top: 10px; margin-top: 6px; color: #1a1a2e; }
.print-total-label { min-width: 120px; text-align: right; }
.print-total-value { min-width: 100px; text-align: right; }

.print-terms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; font-size: 10px; page-break-inside: avoid; break-inside: avoid; }
.print-term-item { padding: 8px 12px; background: #faf9f6; border-radius: 6px; }
.print-term-label { font-weight: 700; color: #666; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; }
.print-term-value { font-weight: 600; margin-top: 2px; }

.print-legal { font-size: 9px; color: #888; line-height: 1.8; font-style: italic; margin-bottom: 20px; padding: 14px; background: #faf9f6; border-radius: 8px; border-left: 3px solid var(--gold); }
.print-bank { text-align: center; padding: 12px; background: #1a1a2e; color: #fff; border-radius: 8px; margin-bottom: 24px; font-size: 12px; font-weight: 600; letter-spacing: 0.5px; page-break-inside: avoid; break-inside: avoid; }
.print-footer { text-align: center; font-size: 10px; color: #999; border-top: 1px solid #e8e6e3; padding-top: 16px; line-height: 1.8; }
.print-footer strong { color: #1a1a2e; }

@media print {
    body { background: #fff !important; }
    .topbar, .view, .login-container, .modal { display: none !important; }
    .print-section { display: block !important; padding: 20px; box-shadow: none; }
}

/* ===== TOAST ===== */
.toast {
    position: fixed; top: 80px; right: 24px; z-index: 9999; min-width: 260px;
    padding: 14px 20px; border-radius: 12px; font-size: 13px; font-weight: 600;
    animation: toastIn 0.3s ease; box-shadow: var(--shadow-lg);
}
.toast.success { background: #e8f9ed; color: #1b7a3a; border: 1px solid #b8e8c4; }
.toast.error { background: #fde8e8; color: #c62828; border: 1px solid #f5b8b8; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) translateX(10px); } to { opacity: 1; transform: none; } }

/* ===== UTILS ===== */
.hidden { display: none !important; }
.text-gold { color: var(--gold); }

/* ===== DESIGN UPGRADE v4.4 ===== */
.topbar { background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%); }
body.dark-mode .topbar { background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%); }

@media (max-width: 1100px) {
    .topbar-actions .btn span:not(.material-icons-round) { display: none; }
    .topbar-actions .btn { padding: 8px 10px; min-width: 38px; justify-content: center; }
}

/* stat-card ::before removed - conflicts with ::after top line */

.offers-table tbody tr:hover { background: rgba(184,155,94,0.06); }
.offers-table tbody tr:active { background: rgba(184,155,94,0.1); }

.section-card { transition: box-shadow 0.3s ease, transform 0.2s ease; }
.section-card:hover { box-shadow: var(--shadow-md); }

.article-card { border-left: 3px solid transparent; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.article-card:hover { border-left-color: var(--gold); box-shadow: var(--shadow-sm); }

.total-row.grand {
    background: rgba(184,155,94,0.06); margin: 0 -20px; padding: 14px 20px;
    border-radius: var(--radius-xs); border-top: none; border-bottom: none;
}

.empty-state-icon { font-size: 48px; color: var(--mid-gray); margin-bottom: 8px; }
.rev-toggle:hover { background: var(--gold) !important; }

.offers-table tbody tr .article-action-btn.delete { opacity: 0; transition: opacity 0.2s; }
.offers-table tbody tr:hover .article-action-btn.delete { opacity: 1; }

/* Preview eye in dashboard: show on hover */
.offers-table tbody tr .preview-eye { opacity: 0; transition: opacity 0.2s; }
.offers-table tbody tr:hover .preview-eye { opacity: 1; }

.toast { backdrop-filter: blur(8px); }
.toast.success { background: rgba(232,249,237,0.95); }
.toast.error { background: rgba(253,232,232,0.95); }

@keyframes softPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
#autoSaveIndicator { animation: softPulse 3s ease infinite; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--mid-gray); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark-gray); }

.form-input:focus, .form-select:focus, .btn:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(184,155,94,0.2);
}

/* ===== EDITOR INFO BAR ===== */
.editor-info-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; margin-bottom: 12px;
    background: var(--card); border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm); border-left: 3px solid var(--gold);
    position: sticky; top: 60px; z-index: 20;
}
.eib-nr { font-weight: 700; font-size: 15px; color: var(--charcoal); letter-spacing: -0.3px; }
.eib-rev { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: var(--light-gray); color: var(--text-light); }
.eib-sep { width: 1px; height: 20px; background: var(--border); }
.eib-status { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 10px; border: none; cursor: pointer; appearance: none; -webkit-appearance: none; }
.eib-status.s-noua { background: #e8f4fd; color: #0277bd; }
.eib-status.s-trimisa { background: #fff3e0; color: #e65100; }
.eib-status.s-acceptata { background: #e8f5e9; color: #2e7d32; }
.eib-status.s-respinsa { background: #fce4ec; color: #c62828; }
.eib-status.s-expirata { background: #f3e5f5; color: #6a1b9a; }
.eib-client { font-size: 13px; color: var(--text); font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eib-total { margin-left: auto; font-size: 14px; font-weight: 700; color: var(--gold-dark); }
.eib-total-ron { font-size: 11px; color: var(--dark-gray); font-weight: 500; }
body.dark .editor-info-bar { background: var(--card); }

/* ===== QUICK PREVIEW MODAL ===== */
.quick-preview-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
    z-index: 1100; align-items: center; justify-content: center; padding: 30px;
}
.quick-preview-overlay.show { display: flex; }
.quick-preview-card {
    background: var(--white); border-radius: 16px; width: 100%; max-width: 560px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25); overflow: hidden;
    animation: previewSlideIn 0.25s ease;
}
@keyframes previewSlideIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
.qp-header {
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.qp-header-left { display: flex; align-items: center; gap: 10px; }
.qp-nr { font-weight: 700; font-size: 15px; color: var(--charcoal); }
.qp-rev { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--light-gray); color: var(--text-light); }
.qp-close {
    background: var(--light-gray); border: none; width: 28px; height: 28px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.qp-close:hover { background: var(--mid-gray); }
.qp-close .material-icons-round { font-size: 16px; color: var(--text); }
.qp-body { padding: 20px; }
.qp-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.qp-row:last-child { border-bottom: none; }
.qp-label { color: var(--dark-gray); font-weight: 500; }
.qp-value { font-weight: 600; color: var(--text); text-align: right; }
.qp-items { margin-top: 12px; }
.qp-item { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.qp-item-desc { flex: 1; color: var(--text); }
.qp-item-qty { width: 40px; text-align: center; color: var(--dark-gray); }
.qp-item-price { width: 80px; text-align: right; font-weight: 600; color: var(--charcoal); }
.qp-total { display: flex; justify-content: space-between; padding: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--gold-dark); border-top: 2px solid var(--gold); margin-top: 8px; }
.qp-actions { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ===== DASHBOARD CHARTS ===== */
.chart-card {
    background: var(--white); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.chart-title {
    font-size: 13px; font-weight: 700; margin-bottom: 14px; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.chart-title .material-icons-round { font-size: 16px; color: var(--gold); }
.chart-container { width: 100%; position: relative; }
.chart-container canvas { display: block; width: 100%; }

/* ===== NOTIFICATIONS ===== */
.notification-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.notification-badge {
    position: absolute; top: -4px; right: -4px; background: var(--error);
    color: white; border-radius: 50%; width: 18px; height: 18px;
    font-size: 10px; font-weight: 700; display: none; align-items: center;
    justify-content: center;
}
.notification-badge.show { display: flex; }
.notification-item {
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    font-size: 12px; cursor: pointer; transition: var(--transition);
}
.notification-item:hover { background: rgba(184,155,94,0.06); }
.notification-item.overdue { border-left: 3px solid var(--error); }
.notification-item.warning { border-left: 3px solid var(--gold); }
.notification-item.info { border-left: 3px solid var(--info); }
.notification-label {
    font-weight: 600; color: var(--text); margin-bottom: 2px;
}
.notification-detail {
    font-size: 11px; color: var(--dark-gray);
}
.notification-empty {
    padding: 20px; text-align: center; color: var(--dark-gray);
    font-size: 12px;
}
#notificationsCard .notification-item:last-child { border-bottom: none; }
#notificationList { margin: 0 -20px; }

/* ===== ATTACHMENTS SECTION ===== */
.attachments-section {
    background: var(--light-gray); border-radius: var(--radius-sm);
    padding: 16px; margin-top: 16px;
}
.attachments-header {
    display: flex; align-items: center; gap: 8px;
    font-weight: 600; font-size: 13px; margin-bottom: 12px; color: var(--text);
}
.attachments-list {
    display: flex; flex-direction: column; gap: 8px;
}
.attachment-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--white); padding: 10px 12px; border-radius: var(--radius-xs);
    border: 1px solid var(--border); font-size: 12px;
}
.attachment-info {
    display: flex; align-items: center; gap: 8px; flex: 1;
}
.attachment-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.attachment-name {
    color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 180px;
}
.attachment-size {
    color: var(--dark-gray); font-size: 11px; margin-left: 8px;
}
.attachment-actions {
    display: flex; gap: 4px;
}
.attachment-btn {
    background: none; border: none; cursor: pointer; padding: 4px 8px;
    color: var(--text-light); transition: var(--transition); font-size: 14px;
}
.attachment-btn:hover { color: var(--text); }
.attachment-btn.delete:hover { color: var(--error); }
.attachment-upload {
    display: flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 10px 12px; background: var(--white); border: 2px dashed var(--gold);
    border-radius: var(--radius-xs); text-align: center; transition: var(--transition);
    color: var(--gold); font-size: 12px; font-weight: 500;
}
.attachment-upload:hover { background: rgba(184,155,94,0.05); }
.attachment-upload.dragging { background: rgba(184,155,94,0.12); }
