/* ========================================
   Quote Manager - Modern Dashboard UI
   ======================================== */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    --text-dark: #1e293b;
    --text-medium: #475569;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --bg-body: #f1f5f9;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #1e293b;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);

    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Heebo", -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    direction: rtl;
    min-height: 100vh;
}

/* ========================================
   Layout
   ======================================== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-dark);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-white);
}

.nav-icon {
    font-size: 18px;
}

.nav-badge {
    margin-right: auto;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-item.active .nav-badge {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-light);
    padding: 10px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-width: 280px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
}

.search-icon {
    font-size: 16px;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-white);
    color: var(--text-medium);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-light);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add:hover {
    background: var(--primary);
    color: var(--text-white);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-medium);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.btn-back:hover {
    color: var(--text-dark);
}

/* ========================================
   View Container
   ======================================== */
.view-container {
    padding: 24px 32px;
    flex: 1;
}

/* ========================================
   Stats Grid
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: var(--info-light);
}
.stat-icon.green {
    background: var(--success-light);
}
.stat-icon.orange {
    background: var(--warning-light);
}
.stat-icon.purple {
    background: var(--primary-light);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

.stat-trend {
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    color: var(--text-light);
}

.stat-trend.up {
    color: var(--success);
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto auto;
    gap: 20px;
}

.dashboard-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.quotes-list-card {
    grid-row: span 2;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

/* Quotes Table */
.quotes-table-wrapper {
    overflow-x: auto;
}

.quotes-table {
    width: 100%;
    border-collapse: collapse;
}

.quotes-table th {
    padding: 12px 20px;
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
}

.quotes-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.quotes-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.quotes-table tbody tr:hover {
    background: var(--bg-light);
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--info));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.customer-name {
    font-weight: 600;
    color: var(--text-dark);
}

.customer-company {
    font-size: 12px;
    color: var(--text-light);
}

.amount-cell {
    font-weight: 700;
    color: var(--text-dark);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge.draft {
    background: var(--bg-light);
    color: var(--text-medium);
}
.status-badge.draft .status-dot {
    background: var(--text-light);
}

.status-badge.sent {
    background: var(--info-light);
    color: var(--info);
}
.status-badge.sent .status-dot {
    background: var(--info);
}

.status-badge.viewed {
    background: var(--warning-light);
    color: var(--warning);
}
.status-badge.viewed .status-dot {
    background: var(--warning);
}

.status-badge.approved {
    background: var(--success-light);
    color: var(--success);
}
.status-badge.approved .status-dot {
    background: var(--success);
}

.status-badge.expired {
    background: var(--danger-light);
    color: var(--danger);
}
.status-badge.expired .status-dot {
    background: var(--danger);
}

.date-cell {
    color: var(--text-light);
    font-size: 13px;
}

.action-cell {
    text-align: left;
}

.row-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.15s;
}

.row-action-btn:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

/* Pending List */
.pending-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.pending-item:hover {
    background: var(--primary-light);
}

.pending-icon {
    font-size: 18px;
}

.pending-content {
    flex: 1;
}

.pending-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.pending-desc {
    font-size: 12px;
    color: var(--text-light);
}

.pending-time {
    font-size: 11px;
    color: var(--text-light);
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.action-icon {
    font-size: 24px;
}

.action-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium);
}

/* Activity Timeline */
.activity-timeline {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: 4px;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-dark);
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
}

/* ========================================
   Editor View
   ======================================== */
.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
}

.editor-header-right,
.editor-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.quote-id-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.badge-label {
    font-size: 12px;
    color: var(--text-light);
}

.badge-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.status-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.status-selector:hover {
    border-color: var(--primary);
}

.status-selector .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-selector .status-dot.draft {
    background: var(--text-light);
}
.status-selector .status-dot.sent {
    background: var(--info);
}
.status-selector .status-dot.viewed {
    background: var(--warning);
}
.status-selector .status-dot.approved {
    background: var(--success);
}

.status-selector .status-text {
    font-size: 14px;
    font-weight: 500;
}

.dropdown-arrow {
    font-size: 10px;
    color: var(--text-light);
}

.autosave-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--success);
}

.autosave-status.saving {
    color: var(--warning);
}

/* Editor Layout */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-actions {
    display: flex;
    gap: 12px;
}

/* Customer Form */
.customer-form {
    padding: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Items Section */
.items-container {
    padding: 0;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 100px 120px 100px 40px;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    align-items: start;
}

.item-row:hover {
    background: var(--bg-light);
}

.item-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    transition: all 0.15s;
}

.item-input:focus {
    outline: none;
    border-color: var(--primary);
}

.item-input.number {
    text-align: left;
    direction: ltr;
}

.item-total {
    padding: 10px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
}

.delete-item-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.15s;
}

.delete-item-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.add-item-placeholder {
    padding: 24px;
    display: flex;
    justify-content: center;
}

.add-item-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: none;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-light);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.add-item-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.add-icon {
    font-size: 18px;
}

/* Totals Panel */
.totals-panel {
    padding: 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
}

.totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.totals-label {
    font-size: 14px;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 8px;
}

.totals-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.totals-row.discount-row {
    background: var(--success-light);
    margin: 8px -20px;
    padding: 10px 20px;
}

.discount-value {
    color: var(--success);
}

.edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
}

.edit-btn:hover {
    opacity: 1;
}

.totals-row.grand-total {
    padding-top: 14px;
    margin-top: 8px;
    border-top: 2px solid var(--border);
}

.totals-row.grand-total .totals-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.totals-row.grand-total .totals-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
}

.add-discount-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: none;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.add-discount-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Terms Grid */
.terms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}

/* Internal Section */
.internal-section {
    background: var(--warning-light);
    border-color: rgba(245, 158, 11, 0.3);
}

.internal-section .section-header {
    border-color: rgba(245, 158, 11, 0.2);
}

.internal-badge {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--warning);
    color: white;
    border-radius: 20px;
    margin-right: 8px;
}

.internal-section textarea {
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 12px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    background: rgba(255, 255, 255, 0.8);
}

/* Editor Sidebar */
.editor-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-panel {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
}

.panel-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-preview textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 12px;
}

.send-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.send-btn.whatsapp {
    background: #25d366;
    color: white;
}

.send-btn.whatsapp:hover {
    background: #128c7e;
}

.send-btn.email {
    background: var(--primary);
    color: white;
}

.send-btn.email:hover {
    background: var(--primary-hover);
}

.send-btn.link {
    background: var(--bg-light);
    color: var(--text-medium);
    border: 1px solid var(--border);
}

.send-btn.link:hover {
    background: var(--bg-body);
}

/* Tracking Panel */
.tracking-status {
    margin-bottom: 16px;
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
}

.status-indicator.draft {
    background: var(--bg-light);
}
.status-indicator.sent {
    background: var(--info-light);
}
.status-indicator.viewed {
    background: var(--warning-light);
}
.status-indicator.approved {
    background: var(--success-light);
}

.status-icon {
    font-size: 28px;
}

.status-label {
    font-size: 14px;
    font-weight: 600;
}

.tracking-timeline {
    border-right: 2px solid var(--border);
    margin-right: 6px;
    padding-right: 16px;
}

.timeline-item {
    position: relative;
    padding: 10px 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    right: -22px;
    top: 14px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg-white);
}

.timeline-item.active::before {
    background: var(--primary);
}

.timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
}

.timeline-date {
    font-size: 12px;
    color: var(--text-light);
}

.tracking-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.track-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
}

.track-icon {
    font-size: 16px;
}
.track-value {
    font-size: 18px;
    font-weight: 700;
}
.track-label {
    font-size: 11px;
    color: var(--text-light);
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--success);
    font-weight: 500;
    margin-top: 12px;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

/* Actions Panel */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn:hover {
    background: var(--border);
}

.action-btn.success {
    background: var(--success-light);
    color: var(--success);
}

.action-btn.success:hover {
    background: var(--success);
    color: white;
}

.action-btn.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.action-btn.danger:hover {
    background: var(--danger);
    color: white;
}

/* ========================================
   Quotes View
   ======================================== */
.filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 10px 18px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    background: var(--bg-white);
    cursor: pointer;
}

.quotes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.quote-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.quote-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.quote-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.quote-card-customer {
    display: flex;
    align-items: center;
    gap: 12px;
}

.quote-card-id {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.quote-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.quote-card-amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
}

.quote-card-date {
    font-size: 12px;
    color: var(--text-light);
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.modal.open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.modal.modal-sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* Product Modal */
.product-search input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.product-item:hover {
    background: var(--primary-light);
}

.product-name {
    font-weight: 600;
    color: var(--text-dark);
}

.product-desc {
    font-size: 12px;
    color: var(--text-light);
}

.product-price {
    font-weight: 700;
    color: var(--primary);
}

/* Discount Modal */
.discount-type-btns {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.15s;
}

.type-btn:hover {
    border-color: var(--primary);
}

.type-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.discount-input-group {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 8px;
    margin-bottom: 16px;
}

.discount-input-group input {
    flex: 1;
    padding: 14px;
    border: none;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.discount-input-group input:focus {
    outline: none;
}

.input-suffix {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-light);
    padding: 0 16px;
}

.discount-preview {
    display: flex;
    justify-content: space-between;
    padding: 14px;
    background: var(--success-light);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--success);
}

/* Send Modal */
.send-method-cards {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.method-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.method-card:hover {
    border-color: var(--primary);
}

.method-card.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

.method-icon {
    font-size: 28px;
}
.method-name {
    font-size: 13px;
    font-weight: 600;
}

.send-details {
    margin-bottom: 16px;
}

.send-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-medium);
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Customer Modal */
.customer-search input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 16px;
}

.customers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.customer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.customer-item:hover {
    background: var(--primary-light);
}

/* Convert Modal */
.convert-info {
    text-align: center;
    margin-bottom: 20px;
}

.convert-info p {
    font-size: 15px;
    color: var(--text-medium);
    margin-bottom: 16px;
}

.convert-summary {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.convert-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.convert-row span:last-child {
    font-weight: 600;
}

.convert-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.autocomplete-item:hover {
    background: var(--primary-light);
}

/* Customer Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown .autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown .autocomplete-item:hover {
    background: var(--primary-light);
}

.autocomplete-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.autocomplete-info {
    flex: 1;
}

.autocomplete-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-dark);
}

.autocomplete-company {
    font-size: 12px;
    color: var(--text-light);
}

.autocomplete-phone {
    font-size: 13px;
    color: var(--text-medium);
    direction: ltr;
}

/* Customer Modal List */
.customers-list {
    max-height: 400px;
    overflow-y: auto;
}

.customer-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light);
}

.customer-item:hover {
    background: var(--primary-light);
}

.customer-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.customer-item-info {
    flex: 1;
}

.customer-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.customer-item-company {
    font-size: 13px;
    color: var(--text-light);
}

.customer-item-contact {
    text-align: left;
    font-size: 13px;
    color: var(--text-medium);
    direction: ltr;
}

.customer-item-contact div {
    margin-bottom: 2px;
}

.customer-search {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.customer-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.customer-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-dark);
    color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    background: var(--success);
}
.toast.error {
    background: var(--danger);
}
.toast.warning {
    background: var(--warning);
}

.toast-icon {
    font-size: 18px;
}
.toast-message {
    font-size: 14px;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .editor-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
        padding: 12px;
    }
    .logo-text,
    .nav-text,
    .nav-badge,
    .user-details {
        display: none;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .main-content {
        margin-right: 70px;
    }
    .main-header {
        padding: 0 16px;
    }
    .view-container {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .filter-tabs {
        flex-wrap: wrap;
    }
    .quotes-grid {
        grid-template-columns: 1fr;
    }
}
