/*
Theme Name: Rufus CRM
Description: CRM intern Rufus Suprastructuri - Dark Theme
Version: 5.0
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #f0f4f8;
    --navy-light: #ffffff;
    --navy-lighter: #e8eef5;
    --rufus-accent: #E8651A;       /* Suprascris dinamic prin rufus_inject_brand_css() */
    --rufus-primary: #1a2744;
    --rufus-nav-bg: #0f1f3d;
    --orange: var(--rufus-accent);
    --orange-light: #d4580f;
    --orange-glow: rgba(232,101,26,0.1);
    --white: var(--rufus-primary);
    --text: #2d3748;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --card-bg: #ffffff;
    --card-hover: #f8fafc;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f4f8;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

html { overflow-x: hidden; }

/* ── LOGIN ─────────────────────────────────────────── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
}
.login-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow), 0 0 60px rgba(232,101,26,0.05);
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { height: 48px; filter: brightness(1.1); }
.login-logo h1 { font-size: 22px; font-weight: 700; color: #1a2744; margin-top: 12px; letter-spacing: -0.5px; }
.login-logo p { font-size: 13px; color: #64748b; margin-top: 4px; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 11px; font-weight: 600; color: #374151; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.8px; }
.form-group input {
    width: 100%; padding: 11px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    color: #1a2744; font-size: 14px; font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--orange); background: #fff7f0; }
.form-group input::placeholder { color: #94a3b8; }
.btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: white; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
    transition: opacity 0.2s, transform 0.1s;
    box-shadow: 0 4px 15px rgba(232,101,26,0.3);
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.login-error {
    background: rgba(239,68,68,0.1); color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 1rem;
}

/* ── LAYOUT ─────────────────────────────────────────── */
.crm-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
    width: 210px;
    background: var(--rufus-nav-bg);
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 10;
}
.sidebar-logo {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo img { height: 38px; filter: brightness(1.1); }
.sidebar-logo span { display: block; font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 6px; letter-spacing: 0.5px; }
.sidebar-section { padding: 1rem 0.75rem 0.5rem; }
.sidebar-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; padding: 0 0.5rem; margin-bottom: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; margin: 2px 0;
    color: rgba(255,255,255,0.6); text-decoration: none; font-size: 13px; font-weight: 500;
    border-radius: var(--radius); transition: all 0.2s;
    cursor: pointer; border: none; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #ffffff; }
.nav-item.active {
    background: rgba(232,101,26,0.15);
    color: #ffffff;
    border: 1px solid rgba(232,101,26,0.25);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user strong { display: block; font-size: 13px; font-weight: 600; color: #ffffff; }
.sidebar-user span { font-size: 11px; color: rgba(255,255,255,0.5); }
.logout-btn {
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
    color: rgba(255,255,255,0.5); font-size: 12px; text-decoration: none;
    padding: 7px 10px; border-radius: var(--radius); transition: all 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ── MAIN ─────────────────────────────────────────── */
.main-content { margin-left: 210px; flex: 1; padding: 2rem; min-width: 0; max-width: calc(100vw - 210px); /* plafon dur la lățimea ecranului minus sidebar — tabelul lat scrollează în .table-card, nu mai e tăiat */ }

/* ── TOPBAR ─────────────────────────────────────────── */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; }
.topbar h1 { font-size: 22px; font-weight: 700; color: var(--white); letter-spacing: -0.5px; }
.topbar-actions { display: flex; gap: 8px; }

/* ── BUTTONS ─────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--orange-light));
    color: white; border: none; border-radius: var(--radius);
    padding: 9px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px; font-family: inherit;
    box-shadow: 0 4px 12px rgba(232,101,26,0.25); transition: all 0.2s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(232,101,26,0.35); }
.btn-secondary {
    background: #f8fafc; color: #374151;
    border: 1px solid #e2e8f0; border-radius: var(--radius);
    padding: 8px 14px; font-size: 13px; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s;
}
.btn-secondary:hover { background: #f1f5f9; color: #1a2744; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-danger {
    background: rgba(239,68,68,0.1); color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2); border-radius: var(--radius);
    padding: 5px 11px; font-size: 12px; cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); color: #f87171; }

/* ── BUTON STATUS ─────────────────────────────────── */
.btn-status {
    background: rgba(232,101,26,0.08); color: #e8651a;
    border: 1.5px solid rgba(232,101,26,0.4); border-radius: var(--radius);
    padding: 5px 8px; font-size: 11px; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
    font-weight: 600; transition: all 0.2s; white-space: nowrap;
    flex: 1;
}
.btn-status:hover { background: rgba(232,101,26,0.18); border-color: #e8651a; color: #c45510; }

/* ── STATS ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 1.75rem; }
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.25rem;
    position: relative; overflow: hidden;
    transition: border-color 0.2s;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}
.stat-card.orange::before { background: linear-gradient(90deg, var(--orange), var(--orange-light)); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card:hover { border-color: var(--border-light); }
.stat-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--white); letter-spacing: -1px; }
.stat-card.orange .stat-value { color: var(--orange-light); }
.stat-card.red .stat-value { color: #f87171; }
.stat-sub-red { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #fca5a5; margin-top: 4px; }

/* ── FILTERS ─────────────────────────────────────────── */
.filters-bar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    background: #ffffff; border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 1.5rem;
}
.search-input, .filter-select {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius); padding: 8px 12px;
    color: #2d3748; font-size: 13px; font-family: inherit;
    transition: border-color 0.2s;
}
.search-input { min-width: 180px; }
.search-input:focus, .filter-select:focus { outline: none; border-color: var(--orange); }
.search-input::placeholder { color: #94a3b8; }
.filter-select option { background: #ffffff; color: #2d3748; }

/* ── MONTHS ─────────────────────────────────────────── */
.month-section { margin-bottom: 1.5rem; }
.month-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 4px; cursor: pointer; user-select: none;
}
.month-chevron { color: var(--text-muted); transition: transform 0.2s; }
.month-section.open .month-chevron { transform: rotate(180deg); }
.month-title { font-size: 15px; font-weight: 600; color: var(--white); }
.month-total {
    margin-left: auto;
    font-size: 13px; font-weight: 700; color: #1a2744;
    background: #f0f4f8; border: 1px solid #e2e8f0;
    border-radius: 8px; padding: 2px 10px;
}
.month-badge {
    background: #f1f5f9; color: #64748b;
    font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px;
    border: 1px solid #e2e8f0;
}
.month-body { display: none; }
.month-section.open .month-body { display: block; }

/* ── TABLE ─────────────────────────────────────────── */
.table-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;          /* scroll intern orizontal — nu mai împinge pagina */
    overflow-y: hidden;        /* păstrează border-radius intact pe verticală */
    box-shadow: var(--shadow-sm);
}
.crm-table { width: 100%; min-width: 1080px; border-collapse: separate; border-spacing: 0; } /* min-width: forțează scroll orizontal în .table-card când nu încape, în loc să taie coloana Acțiuni */
.crm-table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.crm-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: var(--text);
    vertical-align: middle;
    line-height: 1.4;
}
.crm-table tbody tr:last-child td { border-bottom: none; }
.crm-table tbody tr { transition: background 0.1s; }
.crm-table tbody tr:hover td { background: #f8fafc; }
.crm-table td strong { color: #1a2744; font-weight: 600; }
.no-orders { text-align: center; padding: 3rem; color: var(--text-muted); font-size: 13px; }

/* ── BADGES ─────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 99px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

/* ── AUDIT ROW ─────────────────────────────────────────── */
.audit-row td { padding: 4px 14px 8px; border-bottom: 1px solid var(--border); }
.audit-info { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }

/* ── ALERTS ─────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 1rem; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; font-size: 13px; }
.alert-error { background: rgba(239,68,68,0.1); color: #fca5a5; border: 1px solid rgba(239,68,68,0.2); }

/* ── PDF LINK ─────────────────────────────────────────── */
.pdf-link { color: var(--orange-light); text-decoration: none; font-size: 12px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.pdf-link:hover { text-decoration: underline; }

/* ── MODAL ─────────────────────────────────────────── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 1002; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 1.75rem; width: 100%; max-width: 520px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-title { font-size: 17px; font-weight: 700; color: #1a2744; margin-bottom: 1.5rem; letter-spacing: -0.3px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-group { margin-bottom: 14px; }
.modal-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.modal-group input, .modal-group select, .modal-group textarea {
    width: 100%; padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: var(--radius);
    color: #2d3748; font-size: 13px; font-family: inherit;
    transition: border-color 0.2s;
}
.modal-group input:focus, .modal-group select:focus, .modal-group textarea:focus { outline: none; border-color: var(--orange); }
.modal-group input::placeholder, .modal-group textarea::placeholder { color: #94a3b8; }
.modal-group select option { background: #ffffff; color: #2d3748; }
.modal-group textarea { height: 80px; resize: vertical; }
.file-upload-label {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border: 1px dashed var(--border-light);
    border-radius: var(--radius); cursor: pointer; color: var(--text-muted);
    font-size: 13px; transition: all 0.2s;
}
.file-upload-label:hover { border-color: var(--orange); color: var(--orange-light); }
.file-upload-label input { display: none; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.25rem; border-top: 1px solid #e2e8f0; padding-top: 1.25rem; }

/* ── MOBILE CARDS ─────────────────────────────────────────── */
.mobile-cards { display: none; }


/* ── STICKY BAR ───────────────────────────────────── */
#sticky-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 210px;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    z-index: 90;
    padding: 10px 2rem;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}
#sticky-bar.visible { display: flex; }
.sticky-stats { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.sticky-stat { display: flex; align-items: center; gap: 6px; }
.sticky-stat-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.6px; }
.sticky-stat-value { font-size: 15px; font-weight: 700; color: #1a2744; }
.sticky-stat-value.orange { color: var(--rufus-accent); }
.sticky-stat-value.red { color: #f87171; }
.sticky-divider { width: 1px; height: 20px; background: #e2e8f0; }
.sticky-title { font-size: 13px; font-weight: 700; color: #1a2744; white-space: nowrap; margin-right: 4px; }

@media (max-width: 768px) {
    .crm-table { display: none; }
    .table-card { overflow: visible; background: transparent; border: none; box-shadow: none; }
    .mobile-cards { display: flex; flex-direction: column; gap: 10px; }

    /* ── Card nou ── */
    .mobile-card {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        padding: 14px 14px 12px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        position: relative;
        overflow: hidden;
    }
    .mobile-card.urgent-card { border-left: 3px solid #dc2626; }

    /* Header: client + status badge */
    .mobile-card-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 8px;
    }
    .mobile-card-client {
        font-size: 15px;
        font-weight: 700;
        color: #1a2744;
        line-height: 1.3;
        flex: 1;
        min-width: 0;
        text-transform: none !important;
        letter-spacing: normal !important;
    }
    .mobile-card-obs { font-size: 11px; color: #94a3b8; margin-top: 2px; }

    /* Rând info compact */
    .mobile-card-info {
        font-size: 12px;
        color: #64748b;
        margin-bottom: 6px;
        line-height: 1.5;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 10px;
        align-items: center;
        text-transform: none !important;
        letter-spacing: normal !important;
    }
    .mobile-card-info strong { color: #1a2744; font-weight: 600; text-transform: none !important; }
    .mobile-card-info .sep { color: #cbd5e1; }

    /* Rând preț + termen */
    .mobile-card-meta {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }
    .mobile-card-pret {
        font-size: 16px;
        font-weight: 800;
        color: #1a2744;
    }
    .mobile-card-termen {
        font-size: 12px;
        color: #64748b;
        display: flex;
        align-items: center;
        gap: 4px;
    }

    /* Separator */
    .mobile-card-divider {
        border: none;
        border-top: 1px solid #f1f5f9;
        margin: 10px 0;
    }

    /* Butoane acțiuni */
    .mobile-card-actions-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }
    .mobile-btn-status {
        flex: 1;
        padding: 10px 12px;
        background: #fff7ed;
        border: 1.5px solid #fdba74;
        border-radius: 10px;
        color: #c45510;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        font-family: inherit;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }
    .mobile-btn-status:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }
    .mobile-btn-status.luc {
        background: #f0fdf4;
        border-color: #86efac;
        color: #166534;
    }
    .mobile-btn-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
        border: 1px solid #e2e8f0;
        background: #f8fafc;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 16px;
        flex-shrink: 0;
        color: #64748b;
        text-decoration: none;
    }
    .mobile-btn-icon:active { background: #f1f5f9; }
    .mobile-btn-icon.danger { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
    .mobile-btn-icon.edit { border-color: #bfdbfe; background: #eff6ff; color: #2563eb; }
    .mobile-btn-icon.purple { border-color: #ddd6fe; background: #f5f3ff; color: #7c3aed; }

    /* Audit */
    .mobile-card-audit {
        font-size: 10px;
        color: #94a3b8;
        margin-top: 8px;
    }

    /* Reprogramează — mai discret */
    .mobile-btn-reprog {
        width: 100%;
        margin-top: 6px;
        padding: 8px;
        background: #f8fafc;
        border: 1px dashed #cbd5e1;
        border-radius: 8px;
        color: #64748b;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        text-align: center;
    }

    /* Rows vechi — ascunse, înlocuite cu info compact */
    .mobile-card-rows { display: none; }
    .mobile-card-footer { display: none; }

    /* Layout */
    .crm-layout { flex-direction: column; }
    .sidebar { display: none; }
    .main-content { margin-left: 0; margin-top: 60px; padding: 0.75rem; max-width: 100%; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 1.25rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 24px; }

    /* Topbar */
    .topbar { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 1.25rem; }
    .topbar h1 { font-size: 18px; }
    #sticky-bar {
        left: 0;
        top: 60px;
        padding: 8px 14px;
        gap: 6px;
        z-index: 999;
        flex-wrap: nowrap;
        align-items: center;
        min-height: 52px;
    }
    .sticky-stats {
        flex: 1;
        gap: 0;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
    }
    .sticky-stat {
        flex-direction: column;
        align-items: center;
        gap: 0;
        padding: 0 6px;
        flex: 1;
        min-width: 0;
    }
    .sticky-stat-label {
        font-size: 10px;
        letter-spacing: 0.3px;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        text-align: center;
    }
    .sticky-stat-value {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        text-align: center;
    }
    .sticky-divider { display: none; }
    .sticky-title { display: none; }
    #sticky-bar .btn-primary { display: none !important; }
    #sticky-bar .sticky-stats::-webkit-scrollbar { display: none; }
    .month-total { font-size: 12px; padding: 2px 7px; }

    /* Filters */
    .filters-bar { display: none !important; }

    /* Buttons */
    .btn-primary, .btn-secondary { padding: 11px 16px; font-size: 14px; }
    .btn-sm { padding: 7px 12px; font-size: 13px; }
    .btn-danger { padding: 7px 12px; font-size: 13px; }
    .btn-status { padding: 7px 12px; font-size: 13px; }

    /* Modal */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal-box { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 88vh; padding: 1.25rem 1.25rem 2rem; }
    .modal-grid { grid-template-columns: 1fr; }
}

/* ── Filtre mobile tab-strip ── */
.mobile-filter-bar {
    display: none;
}
@media (max-width: 768px) {
    .mobile-filter-bar {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    .mobile-search-wrap {
        position: relative;
    }
    .mobile-search-wrap svg {
        position: absolute;
        left: 11px;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
        pointer-events: none;
    }
    .mobile-search-input {
        width: 100%;
        box-sizing: border-box;
        padding: 10px 12px 10px 34px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        font-size: 14px;
        background: #fff;
        font-family: inherit;
        color: #1a2744;
        outline: none;
    }
    .mobile-search-input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(147,197,253,0.2); }
    .mobile-status-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
        padding-right: 16px;
    }
    .mobile-status-tabs::-webkit-scrollbar { display: none; }
    .mobile-status-tab {
        flex-shrink: 0;
        padding: 7px 14px;
        border-radius: 20px;
        border: 1.5px solid #e2e8f0;
        background: #f8fafc;
        font-size: 12px;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
        white-space: nowrap;
        font-family: inherit;
        transition: all 0.15s;
    }
    .mobile-status-tab.active {
        background: #1a2744;
        border-color: #1a2744;
        color: #fff;
    }
    .mobile-status-tab.tab-luc.active { background: #c45510; border-color: #c45510; }
    .mobile-status-tab.tab-fin.active { background: #065f46; border-color: #065f46; }
    .mobile-status-tab.tab-car.active { background: #92400e; border-color: #92400e; }
}

/* Pret vizibil */
.crm-table td.pret-cell { font-weight: 700; color: #1a2744; font-size: 14px; white-space: nowrap; }

@media (max-width: 768px) {
    .mobile-card-value.pret { font-size: 15px; font-weight: 700; color: #1a2744; }
}

/* ── QC DOTS ─────────────────────────────────────────── */
.qc-dots { display: flex; gap: 3px; align-items: center; }
.qc-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: default; transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none; flex-shrink: 0;
}
a.qc-dot { cursor: pointer; }
a.qc-dot:hover { transform: scale(1.2); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.qc-dot.green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.qc-dot.red   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.qc-dot svg   { pointer-events: none; width: 13px; height: 13px; }

@media (max-width: 768px) {
    .qc-dot { width: 22px; height: 22px; }
    .qc-dot svg { width: 10px; height: 10px; }
}

/* ── QC MODAL ────────────────────────────────────────── */
.qc-header { margin-bottom: 14px; }
.qc-comanda-info { font-size: 12px; color: #64748b; margin-top: 4px; }
.qc-section { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.qc-section-title { font-size: 12px; font-weight: 700; color: #1a2744; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.qc-required-badge { font-size: 10px; font-weight: 600; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 6px; padding: 1px 6px; margin-left: 6px; text-transform: none; letter-spacing: 0; }

.qc-checklist { display: flex; flex-direction: column; gap: 6px; }
.qc-check-item { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; padding: 6px 8px; border-radius: 7px; border: 1px solid transparent; transition: all 0.15s; font-size: 13px; }
.qc-check-item:hover { background: #f8fafc; border-color: #e2e8f0; }
.qc-check-item input[type=checkbox] { margin-top: 2px; flex-shrink: 0; width: 15px; height: 15px; accent-color: #22c55e; cursor: pointer; }
.qc-check-item.qc-required { font-weight: 600; }
.qc-check-item input:checked + span { color: #166534; }

/* ── Checklist DA/NU pe categorii ───────────────────── */
.qc-danu-header { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 6px; }
.qc-danu-header-label { flex: 1; }
.qc-danu-header-cols { display: flex; gap: 6px; }
.qc-col-da, .qc-col-nu, .qc-col-na { width: 72px; text-align: center; font-size: 11px; font-weight: 700; line-height: 1.3; padding: 3px 0; border-radius: 6px; }
.qc-col-da { color: #166534; background: #dcfce7; border: 1.5px solid #22c55e; }
.qc-col-nu { color: #991b1b; background: #fef2f2; border: 1.5px solid #ef4444; }
.qc-col-na { color: #475569; background: #f1f5f9; border: 1.5px solid #cbd5e1; }
.qc-col-da small, .qc-col-nu small, .qc-col-na small { display: block; font-size: 9px; font-weight: 600; letter-spacing: 0.5px; opacity: 0.85; }
.qc-cat-block { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.qc-cat-title { background: #1e293b; color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 7px 12px; }
.qc-danu-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #f1f5f9; gap: 10px; transition: background 0.15s; }
.qc-danu-row:last-child { border-bottom: none; }
.qc-danu-row.qc-row-da { background: #f0fdf4; }
.qc-danu-row.qc-row-nu { background: #fff7ed; }
.qc-danu-label { font-size: 12px; color: #374151; flex: 1; line-height: 1.4; min-width: 0; }
.qc-danu-btns { display: flex; gap: 5px; flex-shrink: 0; }
.qc-btn-da, .qc-btn-nu, .qc-btn-na { cursor: pointer; }
.qc-btn-da input, .qc-btn-nu input, .qc-btn-na input { display: none; }
.qc-btn-da span, .qc-btn-nu span, .qc-btn-na span { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 2px solid #e2e8f0; transition: all 0.15s; white-space: nowrap; }
.qc-btn-da span { color: #64748b; background: #f8fafc; }
.qc-btn-nu span { color: #64748b; background: #f8fafc; }
.qc-btn-na span { color: #64748b; background: #f8fafc; }
.qc-btn-da input:checked + span { background: #dcfce7; border-color: #22c55e; color: #166534; }
.qc-btn-nu input:checked + span { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.qc-btn-na input:checked + span { background: #f1f5f9; border-color: #94a3b8; color: #475569; }

@media (max-width: 520px) {
    .qc-danu-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 12px; }
    .qc-danu-btns { width: 100%; justify-content: flex-start; gap: 6px; }
    .qc-btn-da span, .qc-btn-nu span, .qc-btn-na span { flex: 1; justify-content: center; font-size: 11px; padding: 6px 4px; }
    .qc-danu-header { display: none; }
}
.qc-row-na { background: #f8fafc !important; opacity: 0.75; }
.qc-row-na .qc-danu-label { color: #94a3b8; font-style: italic; }
.qc-obs-row { padding: 0 12px 10px 12px; background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.qc-obs-textarea { width: 100%; border: 1px solid #fed7aa; border-radius: 6px; padding: 6px 8px; font-size: 12px; color: #92400e; background: #fff; resize: vertical; font-family: inherit; }
.qc-complet-block { border: 2px solid #1e293b; border-radius: 8px; overflow: hidden; margin-top: 12px; }
.qc-complet-block .qc-danu-row { padding: 10px 12px; background: #f8fafc; }
/* Buton PDF */
.btn-qc-pdf { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; background: #fff; border: 1.5px solid #e2e8f0; border-radius: 7px; font-size: 12px; font-weight: 600; color: #374151; text-decoration: none; transition: all 0.15s; margin-left: auto; }
.btn-qc-pdf:hover { background: #f8fafc; border-color: var(--rufus-accent); color: var(--rufus-accent); }

.qc-decizie-grid { display: flex; gap: 8px; }
.qc-decizie-opt { flex: 1; cursor: pointer; }
.qc-decizie-opt input { display: none; }
.qc-decizie-btn { display: flex; align-items: center; justify-content: center; padding: 8px 4px; border-radius: 8px; font-size: 12px; font-weight: 600; border: 2px solid #e2e8f0; transition: all 0.2s; text-align: center; }
.qc-decizie-opt input:checked + .qc-decizie-btn.green  { background: #dcfce7; border-color: #22c55e; color: #166534; }
.qc-decizie-opt input:checked + .qc-decizie-btn.orange { background: #fff7ed; border-color: #f97316; color: #9a3412; }
.qc-decizie-opt input:checked + .qc-decizie-btn.red    { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
.qc-decizie-btn:hover { background: #f8fafc; }

/* Poze upload */
.qc-photos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qc-photo-label { cursor: pointer; }
.qc-photo-inner {
    border: 2px dashed #cbd5e1; border-radius: 10px;
    height: 90px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
    color: #94a3b8; font-size: 11px; transition: all 0.2s;
    overflow: hidden;
}
.qc-photo-label:hover .qc-photo-inner { border-color: var(--rufus-accent); color: var(--rufus-accent); }
.qc-photo-label.has-photo .qc-photo-inner { border-style: solid; border-color: #22c55e; }
.qc-photo-label input[type=file] { display: none; }

/* Semnătură canvas */
.signature-canvas {
    width: 100%; height: 80px;
    border: 1.5px solid #e2e8f0; border-radius: 8px;
    cursor: crosshair; background: #f8fafc; touch-action: none;
}

/* File upload spec tehnica */
.file-upload-label.has-file { border-color: #22c55e; color: #166534; background: #f0fdf4; }

/* Modal scroll pe mobile pt QC */
@media (max-width: 768px) {
    .qc-decizie-grid { flex-direction: column; }
    .qc-photos-grid { grid-template-columns: repeat(3,1fr); gap: 6px; }
    .qc-photo-inner { height: 75px; }
    .signature-canvas { height: 70px; }
}

/* ── QC VIEW MODAL ───────────────────────────────────── */
.qc-view-section { border:1px solid #e2e8f0; border-radius:10px; padding:12px 14px; margin-bottom:10px; }
.qc-view-title { font-size:11px; font-weight:700; color:#64748b; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:8px; }
.qc-view-row { display:flex; justify-content:space-between; align-items:center; padding:5px 0; border-bottom:1px solid #f1f5f9; font-size:13px; color:#374151; gap:8px; }
.qc-view-row:last-child { border-bottom:none; }
.qc-view-row span:first-child { color:#64748b; flex:1; }

/* ── QC VEHICLE GRID ─────────────────────────────────── */
.qc-vehicle-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; }
.qc-veh-item { display:flex; flex-direction:column; gap:2px; }
.qc-veh-label { font-size:9px; font-weight:700; color:#94a3b8; text-transform:uppercase; letter-spacing:0.4px; }
.qc-veh-val { font-size:13px; color:#1a2744; font-weight:500; }

/* ── BTN QC VIEW ─────────────────────────────────────── */
.btn-qc-view {
    background: rgba(59,130,246,0.08); color:#1d4ed8;
    border:1.5px solid rgba(59,130,246,0.3); border-radius:var(--radius);
    padding:5px 10px; font-size:11px; cursor:pointer; font-family:inherit;
    font-weight:600; transition:all 0.2s; white-space:nowrap;
}
.btn-qc-view:hover { background:rgba(59,130,246,0.15); border-color:#1d4ed8; }
@media (max-width:768px) {
    .qc-vehicle-grid { grid-template-columns:1fr 1fr; }
    .btn-qc-view { padding:7px 12px; font-size:12px; width:100%; margin-top:4px; }
}

/* ── QC LIST PAGE ────────────────────────────────────── */
.qc-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.qc-list-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: box-shadow 0.2s; }
.qc-list-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.qc-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.qc-card-client { font-size: 15px; font-weight: 700; color: #1a2744; text-transform: none !important; letter-spacing: normal !important; }
.qc-card-sub { font-size: 12px; color: #64748b; margin-top: 3px; text-transform: none !important; }
/* Info row compact — înlocuiește grila meta cu labels uppercase */
.qc-card-info-row { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: 12px; color: #374151; font-weight: 500; }
.qc-info-sep { color: #cbd5e1 !important; font-weight: 400 !important; }
.qc-card-bar { display: flex; align-items: center; gap: 8px; }
.qc-bar-track { flex: 1; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.qc-bar-fill { height: 100%; background: #22c55e; border-radius: 10px; transition: width 0.5s ease; }
.qc-bar-label { font-size: 11px; color: #64748b; white-space: nowrap; }
.qc-card-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-card-bottom .btn-qc-pdf { margin-left: auto; }
.qc-card-bottom .btn-qc-view { margin-left: 0; }
.qc-decizie-chip { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
.qc-card-thumbs { display: flex; gap: 4px; }
.qc-card-thumbs a img { width: 36px; height: 28px; object-fit: cover; border-radius: 4px; border: 1px solid #e2e8f0; }
.qc-card-date { font-size: 10px; color: #94a3b8; border-top: 1px solid #f1f5f9; padding-top: 6px; }

@media (max-width: 768px) {
    .qc-list-grid { grid-template-columns: 1fr; }
    .qc-list-card { gap: 8px; padding: 14px; }
    .qc-card-header { flex-wrap: wrap; }
    .qc-card-client { font-size: 14px; }
    .qc-card-bottom { gap: 6px; }
    .qc-card-bottom .btn-qc-pdf { margin-left: 0; }
    .qc-card-thumbs { flex-wrap: wrap; }
    .qc-bar-label { font-size: 10px; }
}
@media (max-width: 420px) {
    .qc-card-bottom { flex-direction: column; align-items: stretch; }
    .qc-card-bottom .btn-qc-pdf,
    .qc-card-bottom .btn-qc-view { margin-left: 0; width: 100%; justify-content: center; text-align: center; }
}

/* ── QC Neconform Banner ────────────────────────────── */
.qc-nec-banner { background: #fff7ed; border: 1.5px solid #fed7aa; border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.qc-nec-banner-title { font-size: 12px; font-weight: 700; color: #92400e; }
.qc-nec-banner-sub { font-size: 11px; color: #b45309; line-height: 1.5; }
.qc-nec-iteratii { display: flex; flex-direction: column; gap: 5px; border-top: 1px solid #fde68a; padding-top: 8px; }
.qc-nec-iter-title { font-size: 10px; font-weight: 700; color: #92400e; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.qc-nec-iter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: rgba(255,255,255,0.6); border-radius: 6px; padding: 5px 8px; }
.qc-nec-iter-badge { font-size: 10px; font-weight: 700; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; border-radius: 4px; padding: 1px 6px; }
.qc-nec-iter-date { font-size: 11px; color: #374151; font-weight: 600; }
.qc-nec-iter-user { font-size: 11px; color: #64748b; }
.qc-nec-iter-obs { font-size: 11px; color: #92400e; font-style: italic; flex-basis: 100%; margin-top: 2px; }
.btn-nou-qc { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; background: var(--rufus-accent); color: #fff; border: none; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.15s; align-self: flex-start; }
.btn-nou-qc:hover { background: #c9540f; }

/* ── QC CARD HIGHLIGHT ───────────────────────────────── */
.qc-card-highlight {
    border-color: var(--rufus-accent) !important;
    box-shadow: 0 0 0 3px rgba(232,101,26,0.15), 0 4px 20px rgba(232,101,26,0.12) !important;
    animation: highlightPulse 1.5s ease-out;
}
@keyframes highlightPulse {
    0%   { box-shadow: 0 0 0 6px rgba(232,101,26,0.3); }
    100% { box-shadow: 0 0 0 3px rgba(232,101,26,0.15), 0 4px 20px rgba(232,101,26,0.12); }
}

/* ── HIDE ON MOBILE ──────────────────────────────────── */
@media (max-width: 768px) {
    .hide-on-mobile { display: none !important; }
}

/* ── FAB — Floating Action Button ───────────────────── */
.fab-btn {
    display: none; /* ascuns pe desktop */
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(34,197,94,0.45), 0 2px 6px rgba(0,0,0,0.2);
    align-items: center;
    justify-content: center;
    z-index: 998;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab-btn:hover  { transform: scale(1.08); box-shadow: 0 6px 20px rgba(34,197,94,0.55); }
.fab-btn:active { transform: scale(0.95); }

@media (max-width: 768px) {
    .fab-btn { display: flex; }
}

/* ════════════════════════════════════════════════════
   MODUL OFERTE
   ════════════════════════════════════════════════════ */

/* ── Status badges oferte ───────────────────────────── */
.oferta-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.oferta-badge.draft     { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.oferta-badge.trimisa   { background: #eff6ff; color: #3b82f6; border: 1px solid #bfdbfe; }
.oferta-badge.citita    { background: #eef2ff; color: #6366f1; border: 1px solid #c7d2fe; }
.oferta-badge.acceptata { background: #f0fdf4; color: #22c55e; border: 1px solid #bbf7d0; }
.oferta-badge.respinsa  { background: #fef2f2; color: #ef4444; border: 1px solid #fecaca; }
.oferta-badge.expirata  { background: #fff7ed; color: #f97316; border: 1px solid #fed7aa; }

/* ── Email status coloană ───────────────────────────── */
.email-status-ok    { color: #22c55e; font-size: 11px; font-weight: 600; }
.email-status-err   { color: #ef4444; font-size: 11px; font-weight: 600; cursor: help; }
.email-status-citit { color: #6366f1; font-size: 11px; font-weight: 600; }

/* ── Toggle listă / calendar ────────────────────────── */
.view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
}
.view-toggle button {
    padding: 6px 16px;
    border-radius: 7px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.view-toggle button.active {
    background: #1a2744;
    color: #fff;
    border-color: #1a2744;
}
.view-toggle button:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* ── FullCalendar overrides ─────────────────────────── */
#of-calendar {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
#of-calendar .fc-toolbar-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a2744;
}
#of-calendar .fc-button {
    background: #1a2744 !important;
    border-color: #1a2744 !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
}
#of-calendar .fc-button:hover {
    background: #f97316 !important;
    border-color: #f97316 !important;
}
#of-calendar .fc-day-today {
    background: #fff7ed !important;
}
#of-calendar .fc-event {
    font-size: 11px;
    border-radius: 4px;
    padding: 1px 4px;
    cursor: pointer;
}
.oferta-ev-acceptata { opacity: .92; }
.oferta-ev-expirata  { opacity: .65; text-decoration: line-through; }
.oferta-ev-respinsa  { opacity: .55; }

/* ── Modal calendar event ───────────────────────────── */
#modal-of-event {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
#modal-of-event.open { display: flex; }
#modal-of-event .ev-box {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
    overflow: hidden;
}
#modal-of-event .ev-header {
    background: #1a2744;
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
#modal-of-event .ev-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}
#modal-of-event .ev-header button {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
}
#modal-of-event .ev-body {
    padding: 16px 20px;
}
#modal-of-event .ev-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
}
#modal-of-event .ev-row:last-child { border-bottom: none; }
#modal-of-event .ev-label {
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    flex-shrink: 0;
    width: 80px;
}
#modal-of-event .ev-footer {
    padding: 12px 20px 16px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    border-top: 1px solid #f1f5f9;
}

/* === RUFUS BTN-ACTIONS === */
.btn-predat {
    margin-left: 6px; padding: 5px 11px; border-radius: 7px;
    border: 1.5px solid #86efac; background: #f0fdf4; color: #166534;
    font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-reprogrameaza {
    margin-left: 6px; padding: 5px 11px; border-radius: 7px;
    font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.btn-reprogrameaza.rep-0 { border: 1.5px solid #93c5fd; background: #eff6ff; color: #1e40af; }
.btn-reprogrameaza.rep-1 { border: 1.5px solid #fdba74; background: #fff7ed; color: #9a3412; }
.btn-reprogrameaza.rep-2, .btn-reprogrameaza.rep-3 { border: 1.5px solid #fca5a5; background: #fef2f2; color: #991b1b; }
.btn-reprogrameaza.rep-3 { opacity: .4; pointer-events: none; }
.btn-urgent-round {
    width: 30px; height: 30px; border-radius: 50%;
    border: 1.5px solid #fca5a5; background: #fef2f2; color: #dc2626;
    cursor: pointer; display: inline-flex; align-items: center;
    justify-content: center; flex-shrink: 0; padding: 0; transition: background .15s;
}

/* ═══════════════════════════════════════════════════════════
   === RUFUS MOBILE-UX-REMAINING ===
   Module: Audit Log, Alerte, Stats period-selector,
           Admin Settings (tabs, jurnal, feedback)
   ═══════════════════════════════════════════════════════════ */

/* ── Admin Settings — rs-tabs nav ───────────────────────── */
.rs-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
@media (max-width: 768px) {
    .rs-tabs-nav {
        gap: 6px;
        margin-bottom: 14px;
    }
    .rs-tab {
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Admin settings cards grid → 1 col */
    .rs-card { margin-bottom: 12px !important; }
    /* Jurnal / feedback stats grid → 1 col */
    div[style*="grid-template-columns:repeat(3,1fr)"],
    div[style*="grid-template-columns: repeat(3, 1fr)"] {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    /* Filtre jurnal → coloană */
    .rs-card form[method="GET"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .rs-card form[method="GET"] > div { width: 100%; }
    .rs-card form[method="GET"] select,
    .rs-card form[method="GET"] input { width: 100% !important; min-height: 44px; font-size: 14px !important; }
    /* Jurnal tabel → card list pe mobil */
    .rs-notif-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* Butoane admin settings */
    .rs-btn, .rs-btn-danger, .rs-btn-ghost {
        min-height: 44px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    /* Tabel utilizatori pe mobile */
    .rs-user-table { display: none !important; }
    .rs-user-cards { display: flex !important; flex-direction: column; gap: 10px; }
}
@media (min-width: 769px) {
    .rs-user-cards { display: none !important; }
}

/* ── Audit Log page ──────────────────────────────────────── */
/* Tabel audit ascuns, cards vizibile pe mobile */
.audit-mobile-cards { display: none; }

@media (max-width: 768px) {
    /* Filtre audit → stack */
    .audit-filters-wrap > div[style*="display:flex"] {
        flex-direction: column !important;
        gap: 10px !important;
    }
    .audit-filters-wrap select,
    .audit-filters-wrap input[type="date"] {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
        padding: 10px 12px !important;
        box-sizing: border-box;
    }
    .audit-filters-wrap button[type="submit"],
    .audit-filters-wrap a {
        min-height: 44px !important;
        padding: 10px 18px !important;
        font-size: 14px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    /* Tabel audit → overflow scroll pe mobile mic */
    .audit-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    /* Cards audit pe < 520px */
    .audit-mobile-cards { display: flex; flex-direction: column; gap: 8px; }
    .audit-mobile-cards .amc {
        background: #fff; border: 1px solid #e2e8f0;
        border-radius: 12px; padding: 12px 14px;
        box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    }
    .audit-mobile-cards .amc-top {
        display: flex; align-items: center; justify-content: space-between;
        gap: 8px; margin-bottom: 6px;
    }
    .audit-mobile-cards .amc-user {
        font-size: 14px; font-weight: 700; color: #1a2744;
    }
    .audit-mobile-cards .amc-date {
        font-size: 11px; color: #94a3b8; white-space: nowrap;
    }
    .audit-mobile-cards .amc-badge {
        display: inline-block; background: #e0e7ff; color: #3730a3;
        font-size: 11px; font-weight: 700; padding: 2px 8px;
        border-radius: 5px; margin-bottom: 6px;
    }
    .audit-mobile-cards .amc-entity {
        font-size: 12px; color: #64748b; margin-bottom: 4px;
    }
    .audit-mobile-cards .amc-change {
        font-size: 11px; background: #f8fafc; border-radius: 6px;
        padding: 6px 8px; border: 1px solid #f1f5f9;
        word-break: break-word;
    }
    /* Paginare audit */
    .audit-paginare { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
    .audit-paginare a {
        text-align: center; padding: 12px 16px !important;
        font-size: 14px !important;
    }
}
@media (max-width: 520px) {
    /* Sub 520px ascundem tabelul complet, arătăm carduri */
    .audit-table-scroll { display: none; }
    .audit-mobile-cards { display: flex; }
}
@media (min-width: 521px) {
    .audit-mobile-cards { display: none; }
}

/* ── Tab Alerte — mobile ─────────────────────────────────── */
@media (max-width: 768px) {
    #tab-alerte .alerte-section h3 { font-size: 15px; }
    #tab-alerte .alerte-form-group textarea { min-height: 80px; font-size: 14px !important; }
    #tab-alerte .alerte-form-group select { font-size: 14px !important; min-height: 44px; }
    #btn-trimite-alerta {
        width: 100% !important;
        min-height: 48px !important;
        font-size: 15px !important;
        padding: 12px 20px !important;
        border-radius: 10px !important;
    }
    .alerta-card { padding: 12px 14px; }
    .alerta-card-header { flex-direction: column; gap: 4px; align-items: flex-start !important; }
    .alerta-card-meta { white-space: normal !important; text-align: left !important; font-size: 11px; }
    .alerta-counteri { gap: 6px; }
    .alerta-count-badge { font-size: 12px !important; min-height: 32px; display: inline-flex; align-items: center; }
    .btn-vezi-raspunsuri { min-height: 36px; padding: 8px 14px !important; font-size: 13px !important; width: 100%; text-align: center; }
    /* WA card */
    .alerta-wa-card { padding: 12px 14px; }
    .alerta-wa-header { flex-wrap: wrap; gap: 6px; }
    .btn-wa-feedback, .btn-wa-sent {
        width: 100% !important;
        justify-content: center !important;
        min-height: 48px !important;
        font-size: 14px !important;
        border-radius: 10px !important;
        margin-top: 8px;
    }
    /* Tabel răspunsuri alerte — scroll orizontal */
    .alerta-raspunsuri-table { font-size: 12px !important; }
    .alerta-raspunsuri-table th,
    .alerta-raspunsuri-table td { padding: 6px 8px !important; }
    /* Select luna */
    .alerte-luna-select select { width: 100% !important; min-height: 44px; font-size: 14px !important; }
    /* Checkbox row mai ușor de bifat */
    .alerte-checkbox-row { min-height: 44px; gap: 12px; }
    .alerte-checkbox-row input { width: 20px !important; height: 20px !important; }
}

/* ── Stats — period selector responsive ─────────────────── */
@media (max-width: 768px) {
    .stats-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .stats-header h1 { font-size: 18px; }
    .period-presets {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .period-btn {
        min-height: 40px !important;
        padding: 8px 14px !important;
        font-size: 13px !important;
    }
    .period-custom {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .period-custom input[type="text"] {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    .period-apply-btn {
        width: 100% !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    /* Charts — un singur grafic pe rând */
    .charts-grid, .charts-grid.triple { grid-template-columns: 1fr !important; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .kpi-value { font-size: 20px !important; }
    /* Mini stats */
    .mini-stats-row { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 420px) {
    .kpi-grid { grid-template-columns: 1fr 1fr !important; }
    .period-btn { font-size: 12px !important; padding: 7px 10px !important; }
    .stats-cat-cta { font-size: 13px !important; min-height: 44px; }
}

/* ── Stoc — modal buttons touch-friendly ────────────────── */
@media (max-width: 768px) {
    /* Modals stoc — bottom sheet */
    #stoc-modal-overlay > div,
    #stoc-miscare-overlay > div,
    #stoc-istoric-overlay > div {
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important; left: 0 !important; right: 0 !important;
        max-height: 90vh !important;
        width: 100% !important;
    }
    /* Butoane stoc modal */
    #stoc-modal-overlay button,
    #stoc-miscare-overlay button {
        min-height: 44px !important;
        font-size: 14px !important;
    }
    /* Buton + adaugă produs / mișcare */
    button[onclick*="rufusStocOpenModal"],
    button[onclick*="rufusStocOpenMiscare"] {
        min-height: 48px !important;
        font-size: 14px !important;
        padding: 12px 20px !important;
    }
    /* Input stoc search */
    #rufus-stoc-wrap input[type="text"],
    #rufus-stoc-wrap select {
        min-height: 44px !important;
        font-size: 14px !important;
    }
    /* Card row acțiuni */
    #rufus-stoc-wrap table td[data-label="Acțiuni"] button {
        min-height: 36px !important;
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

/* === END RUFUS MOBILE-UX-REMAINING === */