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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f1f5f9;
    min-height: 100vh;
    color: #1e293b;
}

.container {
    max-width: 100%;
    margin: 0;
    background: transparent;
    min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────────────── */
header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    color: white;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(245,158,11,0.4);
}

header h1 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.subtitle {
    font-size: 12px;
    opacity: 0.55;
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* ── Navigation ─────────────────────────────────────────────────────── */
#main-nav {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0 -40px;
    padding: 0 40px;
}

.nav-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    letter-spacing: 0.2px;
}

.nav-link:hover {
    color: rgba(255,255,255,0.85);
}

.nav-link.active {
    color: white;
    border-bottom-color: #f59e0b;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.1px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59,130,246,0.45);
}

.btn-secondary {
    background: white;
    color: #1e3a5f;
    border: 1.5px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-small {
    padding: 5px 10px;
    font-size: 11.5px;
    margin: 0 2px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.btn-view  { background: #eff6ff; color: #1d4ed8; }
.btn-view:hover  { background: #dbeafe; }

.btn-edit  { background: #fff7ed; color: #c2410c; }
.btn-edit:hover  { background: #fed7aa; }

.btn-pdf   { background: #faf5ff; color: #7e22ce; }
.btn-pdf:hover   { background: #e9d5ff; }

.btn-mail  { background: #f0fdf4; color: #15803d; }
.btn-mail:hover  { background: #bbf7d0; }

.btn-whatsapp { background: #dcfce7; color: #16a34a; }
.btn-whatsapp:hover { background: #86efac; }

.btn-delete { background: #fff1f2; color: #be123c; }
.btn-delete:hover { background: #fecdd3; }

/* ── Dashboard Layout ──────────────────────────────────────────────── */
.dashboard {
    padding: 32px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

/* ── Stat Cards ──────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 16px 40px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon { background: #eff6ff; }
.stat-card:nth-child(2) .stat-icon { background: #fffbeb; }
.stat-card:nth-child(3) .stat-icon { background: #f0fdf4; }
.stat-card:nth-child(4) .stat-icon { background: #faf5ff; }

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

.stat-card h3 {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-number {
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}

/* ── Chart Cards ──────────────────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
}

.chart-card-title {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: -0.1px;
}

.chart-card-subtitle {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 20px;
}

/* ── Quotations Section ─────────────────────────────────────────────── */
.quotations-section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    margin-top: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.section-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 9px 14px 9px 36px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    width: 260px;
    font-size: 13px;
    transition: all 0.2s;
    background: #f8fafc;
    color: #1e293b;
}

.search-box::before {
    content: '⌕';
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ── Table ──────────────────────────────────────────────────────────── */
.table-container {
    overflow-x: auto;
}

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

.quotations-table thead {
    background: #f8fafc;
}

.quotations-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.quotations-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f8fafc;
    font-size: 13.5px;
    color: #334155;
}

.quotations-table tbody tr:hover {
    background: #fafbfc;
}

.quotations-table tbody tr:last-child td {
    border-bottom: none;
}

.no-data {
    text-align: center;
    color: #94a3b8;
    padding: 56px !important;
    font-size: 14px;
}

.actions {
    white-space: nowrap;
}

/* ── Status Badges ───────────────────────────────────────────────────── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.status-draft    { background: #f1f5f9; color: #475569; }
.status-sent     { background: #eff6ff; color: #1d4ed8; }
.status-viewed   { background: #fffbeb; color: #b45309; }
.status-accepted { background: #f0fdf4; color: #15803d; }
.status-rejected { background: #fff1f2; color: #be123c; }

/* ── Form ───────────────────────────────────────────────────────────── */
.form-container {
    padding: 32px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.form-section {
    background: white;
    padding: 28px;
    border-radius: 16px;
    margin-bottom: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.form-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    letter-spacing: -0.1px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    font-size: 13px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    transition: all 0.2s;
    background: #fafafa;
    color: #1e293b;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ── PDF Preview ─────────────────────────────────────────────────────── */
.pdf-preview {
    background: white;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.pdf-header {
    border-bottom: 3px solid #1e3c72;
    padding-bottom: 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.company-info h1 {
    color: #c41e3a;
    font-size: 36px;
    margin-bottom: 5px;
}

.company-info .vendor-badge {
    background: #1e3c72;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 10px;
}

.company-info .address {
    font-size: 12px;
    color: #666;
    line-height: 1.6;
}

.contact-info {
    text-align: right;
    font-size: 12px;
}

.quotation-title {
    text-align: center;
    margin: 30px 0;
}

.quotation-title h2 {
    color: #1e3c72;
    font-size: 24px;
    margin-bottom: 10px;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.pdf-table th {
    background: #f0f0f0;
    font-weight: 600;
}

.terms-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.terms-section h3 {
    color: #1e3c72;
    margin-bottom: 15px;
}

.terms-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.term-item {
    padding: 10px;
    background: white;
    border-radius: 5px;
}

.term-label {
    font-weight: 600;
    color: #666;
    font-size: 12px;
}

.term-value {
    color: #333;
    margin-top: 5px;
}

/* ── Pipeline / Kanban ──────────────────────────────────────────────── */
.pipeline-container {
    padding: 32px 40px;
}

.pipeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.pipeline-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.pipeline-stats {
    display: flex;
    gap: 10px;
    font-size: 12.5px;
    color: #64748b;
}

.pipeline-stats span {
    background: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

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

.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 20px;
    min-height: 500px;
    align-items: flex-start;
}

.kanban-column {
    min-width: 280px;
    max-width: 320px;
    flex: 0 0 280px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    border: 1px solid #e2e8f0;
}

.kanban-column.drag-over {
    background: #eff6ff;
    outline: 2px dashed #3b82f6;
    outline-offset: -2px;
}

.column-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
    background: white;
}

.column-header .stage-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.column-header .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.column-header .stage-count {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
}

.column-header .stage-value {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

.column-cards {
    padding: 10px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 60px;
}

.kanban-card {
    background: white;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: grab;
    transition: box-shadow 0.2s, transform 0.15s;
    border: 1px solid #f1f5f9;
    border-left: 3px solid transparent;
}

.kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.kanban-card .card-customer {
    font-weight: 600;
    font-size: 13.5px;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-card .card-amount {
    font-weight: 700;
    color: #1d4ed8;
    font-size: 13px;
}

.kanban-card .card-quotation-no {
    font-size: 11.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.kanban-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #94a3b8;
}

.kanban-empty {
    text-align: center;
    color: #b0bec5;
    font-size: 12.5px;
    padding: 28px 10px;
    border: 2px dashed #e2e8f0;
    border-radius: 8px;
}

/* ── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.modal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 20px;
}

.stage-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #f1f5f9;
}

.stage-list-item input[type="text"] {
    flex: 1;
    padding: 8px 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
}

.stage-list-item input[type="color"] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
}

.stage-list-item .btn-stage-delete {
    background: #fff1f2;
    color: #be123c;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stage-list-item .drag-handle {
    cursor: grab;
    color: #bbb;
    font-size: 16px;
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    gap: 10px;
}

/* ── Toast ──────────────────────────────────────────────────────────── */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Loading Spinner ─────────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    header { padding: 0 20px; }
    .header-top { padding: 14px 0 12px; }
    #main-nav { margin: 0 -20px; padding: 0 20px; }
    .nav-link { padding: 12px 10px; font-size: 12px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .charts-row { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .search-box input { width: 100%; }
    .table-container { overflow-x: auto; }
    .terms-grid { grid-template-columns: 1fr; }
    .dashboard { padding: 20px; }
    .form-container { padding: 20px; }
    .pipeline-container { padding: 20px; }
}

/* ── Print ──────────────────────────────────────────────────────────── */
@media print {
    body { background: white; padding: 0; }
    .container { box-shadow: none; }
    .btn, .header-actions { display: none; }
}
