/* ============================================================
   SONELTECH Order Management App - Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #0084ff;
    --primary-dark: #006cd1;
    --success: #2a9d48;
    --warning: #d4a017;
    --danger: #dc3545;
    --dark: #1a1a2e;
    --sidebar-bg: #16213e;
    --sidebar-hover: #1a2744;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text: #333;
    --text-muted: #888;
    --border: #e0e0e0;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark) 0%, var(--sidebar-bg) 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 20px; }

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.login-logo {
    text-align: center;
    margin-bottom: 25px;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group { margin-bottom: 16px; }

.login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-form input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,132,255,0.1);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 250px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.sidebar-nav { padding: 10px 0; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.nav-item.active {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}

.nav-icon {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 20px;
}

.nav-logout { color: rgba(255,255,255,0.5); }
.nav-logout:hover { color: #ff6b6b; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

.topbar {
    background: var(--card-bg);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    margin-right: 15px;
    color: var(--text);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-badge {
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.content {
    padding: 25px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--border);
}

.stat-total { border-left-color: var(--primary); }
.stat-quick { border-left-color: #0084ff; }
.stat-quote { border-left-color: var(--warning); }
.stat-revenue { border-left-color: var(--success); }

.stat-icon {
    font-size: 32px;
    opacity: 0.8;
}

.stat-info { flex: 1; }

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-link {
    position: absolute;
    bottom: 8px;
    right: 15px;
    font-size: 12px;
    color: var(--primary);
}

/* ============================================================
   MONTH STATS
   ============================================================ */
.month-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.month-stat { text-align: center; }

.month-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.month-label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: 6px;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1f7a37; color: #fff; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b88b12; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }

.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--body-bg); color: var(--text); }

.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; }

/* ============================================================
   BADGES
   ============================================================ */
.status-badge, .type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-quick { background: #e3f2fd; color: #0084ff; }
.badge-quote { background: #fff3e0; color: #d4a017; }
.badge-processing { background: #e8f5e9; color: #2a9d48; }
.badge-completed { background: #e8f5e9; color: #1b5e20; }
.badge-pending { background: #fff8e1; color: #f57f17; }
.badge-cancelled { background: #fce4ec; color: #c62828; }
.badge-default { background: #f5f5f5; color: #666; }

/* New workflow status badges */
.badge-nouveau { background: #e3f2fd; color: #1565c0; }
.badge-tentative1 { background: #fff3e0; color: #e65100; }
.badge-tentative2 { background: #fbe9e7; color: #d84315; }
.badge-tentative3 { background: #fce4ec; color: #c62828; }
.badge-confirme { background: #e8f5e9; color: #2e7d32; }
.badge-preparation { background: #e0f2f1; color: #00695c; }
.badge-expedie { background: #f3e5f5; color: #7b1fa2; }
.badge-livre { background: #e8f5e9; color: #1b5e20; font-weight: 800; }
.badge-annule { background: #fce4ec; color: #c62828; }
.badge-injoignable { background: #f5f5f5; color: #616161; }
.badge-reporte { background: #fff8e1; color: #f57f17; }

.type-quick { background: #0084ff; color: #fff; }
.type-quote { background: #d4a017; color: #fff; }
.type-standard { background: #666; color: #fff; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
    background: var(--card-bg);
    padding: 15px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.filters-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input, .filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

.filter-input { flex: 1; min-width: 200px; }
.filter-input:focus, .filter-select:focus {
    border-color: var(--primary);
    outline: none;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-responsive { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table th {
    background: var(--body-bg);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.data-table tbody tr:hover { background: #f8f9ff; }

.order-row { cursor: pointer; }

.phone-link { 
    color: var(--success); 
    font-weight: 600; 
    white-space: nowrap;
}
.phone-link:hover { text-decoration: underline; }

.phone-large { font-size: 16px; }

.price-pending {
    color: var(--warning);
    font-style: italic;
    font-weight: 600;
}

.price-large {
    font-size: 20px;
    color: var(--success);
}

.date-cell {
    font-size: 12px;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 4px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 0;
}

.page-info {
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.detail-badges { display: flex; gap: 8px; }

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
    min-width: 120px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
}

.detail-value { flex: 1; }

.quote-message {
    background: #fff8e1;
    padding: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--warning);
    font-style: italic;
}

.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Notes */
.notes-list { }

.note-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: baseline;
}

.note-item:last-child { border-bottom: none; }

.note-date {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    min-width: 120px;
}

.note-content { font-size: 13px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.2s ease;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 14px;
}

.modal-body label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.modal-body input, .modal-body textarea, .modal-body select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.modal-body textarea { resize: vertical; }

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-danger { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.alert-warning { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon { font-size: 48px; margin-bottom: 10px; }
.empty-state h3 { margin-bottom: 8px; color: var(--text-muted); }
.empty-state p { color: var(--text-muted); }

.loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-form .form-group {
    margin-bottom: 16px;
}

.settings-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 13px;
}

.settings-form input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

.settings-form .help-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.api-url {
    background: var(--body-bg);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
}

/* ============================================================
   CHARTS GRID (Dashboard)
   ============================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    width: 100%;
    max-height: 320px;
}

.chart-container canvas {
    max-height: 300px;
}

/* ============================================================
   CONVERSION STATS
   ============================================================ */
.conversion-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.conversion-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.conversion-svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg);
}

.conversion-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 6;
}

.conversion-circle {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.conversion-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.conversion-label {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   TOP PRODUCTS
   ============================================================ */
.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-product-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.top-product-info {
    flex: 1;
    min-width: 0;
}

.top-product-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-product-bar-wrap {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.top-product-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.8s ease;
}

.top-product-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 30px;
    text-align: right;
}

/* ============================================================
   BULK ACTIONS BAR
   ============================================================ */
.bulk-actions-bar {
    display: none;
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,132,255,0.3);
    position: sticky;
    top: 60px;
    z-index: 50;
    animation: slideDown 0.2s ease;
}

.bulk-actions-bar.visible {
    display: flex;
}

.bulk-check-all {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-count {
    font-weight: 600;
    font-size: 14px;
}

.bulk-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 13px;
}

.bulk-select option { color: var(--text); background: #fff; }

.bulk-apply {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.bulk-apply:hover { background: rgba(255,255,255,0.3); }

.bulk-cancel {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
}

.bulk-cancel:hover { color: #fff; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Checkbox column */
.th-check, .td-check {
    width: 36px;
    text-align: center;
    padding: 8px !important;
}

.order-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ============================================================
   SWIPE ACTIONS
   ============================================================ */
.swipeable-row {
    position: relative;
    overflow: hidden;
}

.swipe-actions {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: stretch;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 5;
}

.swipeable-row.swiped .swipe-actions {
    transform: translateX(0);
}

.swipe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: none;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.swipe-btn:hover { opacity: 0.85; }

.swipe-confirm { background: var(--success); }
.swipe-call { background: var(--primary); }
.swipe-cancel { background: var(--danger); }

/* ============================================================
   DATE FILTERS
   ============================================================ */
.filter-date {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    min-width: 140px;
}

.filter-date:focus {
    border-color: var(--primary);
    outline: none;
}

.filter-separator {
    color: var(--text-muted);
    font-size: 13px;
    padding: 0 2px;
}

.filter-export {
    margin-left: auto;
}

/* ============================================================
   ORDER NOTES / TIMELINE
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 2px;
}

.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -25px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--border);
}

.dot-system {
    background: var(--text-muted);
    box-shadow: 0 0 0 2px var(--text-muted);
}

.dot-user {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content {
    background: var(--body-bg);
    padding: 10px 14px;
    border-radius: var(--radius);
    border-left: 3px solid var(--border);
}

.timeline-system .timeline-content {
    border-left-color: var(--text-muted);
}

.timeline-user .timeline-content {
    border-left-color: var(--primary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.timeline-header strong {
    font-size: 12px;
}

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
}

.timeline-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
}

/* Note Form */
.note-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

.note-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,132,255,0.1);
}

.note-form .btn {
    align-self: flex-end;
}

/* ============================================================
   AUTO-REFRESH INDICATOR
   ============================================================ */
.auto-refresh-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.auto-refresh-indicator.paused .refresh-dot {
    background: var(--text-muted);
    animation: none;
}

/* ============================================================
   ACTIVITY LOG
   ============================================================ */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-icon-status { background: #e8f5e9; }
.activity-icon-note { background: #e3f2fd; }
.activity-icon-price { background: #fff3e0; }
.activity-icon-login { background: #f3e5f5; }
.activity-icon-export { background: #e0f2f1; }
.activity-icon-default { background: var(--body-bg); }

.activity-content { flex: 1; min-width: 0; }

.activity-text {
    font-size: 13px;
    line-height: 1.4;
}

.activity-meta {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================================
   USERS PAGE
   ============================================================ */
.users-table .role-admin {
    color: var(--primary);
    font-weight: 700;
}

.users-table .role-staff {
    color: var(--success);
    font-weight: 600;
}

.user-status-active {
    color: var(--success);
    font-weight: 600;
}

.user-status-inactive {
    color: var(--danger);
    font-weight: 600;
}

.role-descriptions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

.role-desc-card {
    padding: 12px;
    background: var(--body-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.role-desc-card h4 {
    font-size: 14px;
    margin-bottom: 6px;
}

.role-desc-card ul {
    list-style: none;
    font-size: 12px;
    color: var(--text-muted);
}

.role-desc-card li::before {
    content: '✓ ';
    color: var(--success);
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mb-10 { margin-bottom: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close { display: block; }
    .hamburger { display: block; }
    
    .main-content { margin-left: 0; }
    
    .content { padding: 15px; }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .stat-card { padding: 14px; }
    .stat-number { font-size: 22px; }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .filters-form {
        flex-direction: column;
    }
    
    .filter-input { min-width: 100%; }
    
    .topbar-actions .btn { display: none; }
    
    .actions-row { flex-direction: column; }
    .actions-row .btn { width: 100%; }
    
    /* Charts responsive */
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Bulk actions responsive */
    .bulk-actions-bar {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .bulk-cancel { margin-left: 0; }
    
    /* Swipe actions visible on mobile */
    .swipe-actions {
        display: flex;
    }
    
    /* Conversion stats */
    .conversion-stats {
        gap: 15px;
    }
    
    .conversion-svg {
        width: 80px;
        height: 80px;
    }
    
    /* Role descriptions */
    .role-descriptions {
        grid-template-columns: 1fr;
    }
    
    /* Timeline */
    .timeline {
        padding-left: 24px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 2px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .month-stats { flex-direction: column; gap: 15px; }
    
    .data-table th, .data-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Hide checkbox column on very small screens */
    .th-check, .td-check {
        display: none;
    }
    
    .conversion-svg {
        width: 70px;
        height: 70px;
    }
    
    .conversion-value {
        font-size: 18px;
    }
}

/* ============================================================
   ZR EXPRESS INTEGRATION
   ============================================================ */

/* ZR Express button */
.btn-zrexpress {
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
    border: none;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-zrexpress:hover {
    background: linear-gradient(135deg, #bf360c, #e65100);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.3);
}

.btn-zrexpress:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ZR Express tracking card */
.zr-tracking-card {
    border-left: 4px solid #e65100;
}

.zr-tracking-card .card-header h3 {
    color: #e65100;
}

.zr-tracking-id {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    background: #fff3e0;
    padding: 4px 12px;
    border-radius: 6px;
    color: #e65100;
    letter-spacing: 1px;
}

.zr-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

/* Modal large variant */
.modal-lg {
    max-width: 650px;
    width: 95%;
}

/* Form layout helpers */
.form-row {
    display: flex;
    gap: 12px;
}

.form-half {
    flex: 1;
    min-width: 0;
}

/* ZR Express modal specific */
#zr-modal .form-group {
    margin-bottom: 14px;
}

#zr-modal label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    color: #333;
}

#zr-modal input,
#zr-modal select,
#zr-modal textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#zr-modal input:focus,
#zr-modal select:focus,
#zr-modal textarea:focus {
    border-color: #e65100;
    outline: none;
    box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.1);
}

#zr-modal .modal-header {
    background: linear-gradient(135deg, #e65100, #ff8f00);
    color: #fff;
    border-radius: 12px 12px 0 0;
    padding: 16px 20px;
}

#zr-modal .modal-header h3 {
    color: #fff;
    margin: 0;
}

#zr-modal .modal-header .modal-close {
    color: #fff;
}

/* ZR Express badge on orders list */
.zr-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #fff3e0;
    color: #e65100;
    font-weight: 700;
    margin-left: 4px;
    vertical-align: middle;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-lg {
        max-width: 100%;
        width: 100%;
        margin: 10px;
    }
}
