/**
 * Online Resume Maker (ऑनलाइन रिज़्यूम मेकर)
 * Production Quality Stylesheet & A4 Print Engine
 * Supports Hindi & English Typography, 3 Templates & Dynamic Accent Colors
 */

:root {
    --rm-primary: #0c52a6;
    --rm-primary-hover: #083c7d;
    --rm-primary-light: #eef4fc;
    --rm-primary-border: #bcd2ee;
    --rm-accent-color: #0c52a6;
    --rm-accent-light: #edf4fe;
    
    --rm-bg: #f4f6fa;
    --rm-surface: #ffffff;
    --rm-border: #e2e8f0;
    --rm-border-dark: #cbd5e1;
    --rm-text: #1e293b;
    --rm-text-muted: #64748b;
    --rm-text-light: #94a3b8;
    
    --rm-success: #16a34a;
    --rm-danger: #dc2626;
    --rm-danger-light: #fee2e2;
    --rm-warning: #f59e0b;

    --rm-radius: 8px;
    --rm-radius-lg: 12px;
    --rm-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --rm-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --rm-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

    /* Dynamic Resume Typography (Adjusted by User Controls) */
    --rm-font-family: 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --rm-heading-font: inherit;
    --rm-font-size: 14px;
    --rm-line-height: 1.45;
    
    --rm-a4-width: 210mm;
    --rm-a4-height: 297mm;
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
    background-color: var(--rm-bg);
    color: var(--rm-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Main Container */
.rm-container {
    max-width: 1540px;
    margin: 0 auto;
    padding: 16px 20px 40px;
}

/* ================= HEADER ================= */
.rm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rm-surface);
    padding: 16px 24px;
    border-radius: var(--rm-radius-lg);
    box-shadow: var(--rm-shadow-sm);
    border: 1px solid var(--rm-border);
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.rm-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rm-logo-badge {
    font-size: 32px;
    background: var(--rm-primary-light);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--rm-primary-border);
}

.rm-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rm-primary);
    line-height: 1.2;
}

.rm-subtitle {
    font-size: 0.88rem;
    color: var(--rm-text-muted);
    margin-top: 3px;
}

.rm-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Language Toggle */
.rm-lang-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px 6px;
    border-radius: 20px;
    border: 1px solid var(--rm-border);
    font-size: 0.85rem;
}

.rm-lang-label {
    color: var(--rm-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 4px;
}

.rm-btn-lang {
    border: none;
    background: transparent;
    padding: 4px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--rm-text-muted);
    transition: all 0.2s ease;
}

.rm-btn-lang.active {
    background: var(--rm-primary);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(12, 82, 166, 0.3);
}

/* ================= BUTTONS ================= */
.rm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--rm-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.4;
}

.rm-btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.rm-btn-primary {
    background: var(--rm-primary);
    color: #ffffff;
}

.rm-btn-primary:hover {
    background: var(--rm-primary-hover);
    box-shadow: var(--rm-shadow);
}

.rm-btn-secondary {
    background: #e2e8f0;
    color: var(--rm-text);
}

.rm-btn-secondary:hover {
    background: #cbd5e1;
}

.rm-btn-outline {
    background: #ffffff;
    border-color: var(--rm-border-dark);
    color: var(--rm-text);
}

.rm-btn-outline:hover {
    background: #f8fafc;
    border-color: var(--rm-primary);
    color: var(--rm-primary);
}

.rm-btn-danger {
    background: var(--rm-danger);
    color: #ffffff;
}

.rm-btn-danger:hover {
    background: #b91c1c;
}

.rm-btn-danger-outline {
    background: transparent;
    border-color: #fca5a5;
    color: var(--rm-danger);
}

.rm-btn-danger-outline:hover {
    background: var(--rm-danger-light);
}

.rm-btn-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--rm-radius);
    border: 1px solid var(--rm-border);
    background: var(--rm-surface);
    color: var(--rm-text);
    cursor: pointer;
    font-weight: 700;
    transition: all 0.15s;
}

.rm-btn-icon:hover {
    background: #f1f5f9;
    border-color: var(--rm-border-dark);
}

/* ================= MOBILE TABS ================= */
.rm-mobile-tabs {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--rm-surface);
    padding: 8px 12px;
    border-radius: var(--rm-radius);
    box-shadow: var(--rm-shadow);
    margin-bottom: 16px;
    border: 1px solid var(--rm-border);
}

.rm-mobile-tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    background: transparent;
    border-radius: var(--rm-radius);
    cursor: pointer;
    color: var(--rm-text-muted);
    position: relative;
}

.rm-mobile-tab-btn.active {
    background: var(--rm-primary);
    color: #ffffff;
}

.rm-badge-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-left: 6px;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: rm-pulse 1.8s infinite;
}

@keyframes rm-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ================= WORKSPACE GRID (2-COLUMN) ================= */
.rm-workspace {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: start;
}

/* ================= FORM COLUMN ================= */
.rm-form-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Progress Card */
.rm-progress-card {
    background: var(--rm-surface);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    padding: 12px 18px;
    box-shadow: var(--rm-shadow-sm);
}

.rm-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.rm-progress-percent {
    color: var(--rm-primary);
}

.rm-progress-track {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.rm-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--rm-primary), #2563eb);
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* Accordion Cards */
.rm-card {
    background: var(--rm-surface);
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    box-shadow: var(--rm-shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rm-card:focus-within {
    border-color: var(--rm-primary-border);
    box-shadow: var(--rm-shadow);
}

.rm-card-header {
    padding: 14px 18px;
    background: #fafbfe;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}

.rm-card-header:hover {
    background: #f1f5fb;
}

.rm-card.open .rm-card-header {
    border-bottom-color: var(--rm-border);
}

.rm-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--rm-text);
}

.rm-icon {
    font-size: 1.15rem;
}

.rm-badge-req {
    font-size: 0.72rem;
    background: #fee2e2;
    color: #b91c1c;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.rm-accordion-arrow {
    font-size: 0.75rem;
    color: var(--rm-text-muted);
    transition: transform 0.25s ease;
}

.rm-card.open .rm-accordion-arrow {
    transform: rotate(0deg);
}

.rm-card:not(.open) .rm-accordion-arrow {
    transform: rotate(180deg);
}

.rm-card-body {
    padding: 18px;
    display: block;
}

.rm-card:not(.open) .rm-card-body {
    display: none;
}

/* ================= FORM CONTROLS ================= */
.rm-form-group {
    margin-bottom: 14px;
}

.rm-form-group:last-child {
    margin-bottom: 0;
}

.rm-form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.rm-req {
    color: var(--rm-danger);
    font-weight: 700;
}

.rm-input, .rm-select, .rm-textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 0.92rem;
    color: var(--rm-text);
    background: #ffffff;
    border: 1px solid var(--rm-border-dark);
    border-radius: var(--rm-radius);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.rm-input:focus, .rm-select:focus, .rm-textarea:focus {
    border-color: var(--rm-primary);
    box-shadow: 0 0 0 3px rgba(12, 82, 166, 0.15);
}

.rm-input.has-error, .rm-textarea.has-error {
    border-color: var(--rm-danger);
    background: #fffafa;
}

.rm-error-msg {
    display: block;
    color: var(--rm-danger);
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 4px;
}

.rm-help-text {
    font-size: 0.8rem;
    color: var(--rm-text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.rm-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.rm-char-counter {
    font-size: 0.78rem;
    color: var(--rm-text-muted);
}

.rm-input-action-row {
    display: flex;
    gap: 8px;
}

.rm-input-action-row .rm-input {
    flex: 1;
}

/* Grid Layouts */
.rm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.rm-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

/* Toggle Checkbox Boxes */
.rm-toggles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.rm-toggle-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    cursor: pointer;
    transition: all 0.15s;
}

.rm-toggle-box:hover {
    background: #f1f5f9;
    border-color: var(--rm-border-dark);
}

.rm-toggle-box input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--rm-primary);
    cursor: pointer;
}

.rm-toggle-label strong {
    display: block;
    font-size: 0.88rem;
    color: var(--rm-text);
}

.rm-toggle-label small {
    display: block;
    font-size: 0.76rem;
    color: var(--rm-text-muted);
    margin-top: 2px;
}

/* Photo Upload Box */
.rm-photo-upload-container {
    display: flex;
    gap: 18px;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px dashed var(--rm-primary-border);
    border-radius: var(--rm-radius);
    margin-top: 12px;
}

.rm-photo-preview-box {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rm-photo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rm-photo-placeholder {
    text-align: center;
    color: var(--rm-text-muted);
}

.rm-photo-placeholder span {
    font-size: 28px;
    display: block;
}

.rm-photo-placeholder small {
    font-size: 0.72rem;
}

.rm-photo-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sample Pills */
.rm-sample-pills, .rm-quick-suggestions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.rm-pills-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rm-text-muted);
}

.rm-pill-btn, .rm-sugg-pill {
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 14px;
    background: #edf2f7;
    border: 1px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
}

.rm-pill-btn:hover, .rm-sugg-pill:hover {
    background: var(--rm-primary-light);
    border-color: var(--rm-primary);
    color: var(--rm-primary);
}

/* Skills Tag Cloud */
.rm-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 38px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    margin-bottom: 8px;
}

.rm-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--rm-primary);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.82rem;
    font-weight: 500;
}

.rm-tag-remove {
    background: rgba(255,255,255,0.25);
    border: none;
    color: #ffffff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
}

.rm-tag-remove:hover {
    background: rgba(255,255,255,0.45);
}

/* Dynamic Add Items (Education, Experience, etc.) */
.rm-dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rm-dynamic-entry {
    background: #f8fafc;
    border: 1px solid var(--rm-border);
    border-radius: var(--rm-radius);
    padding: 14px;
    position: relative;
    transition: border-color 0.2s;
}

.rm-dynamic-entry:hover {
    border-color: var(--rm-border-dark);
}

.rm-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--rm-border);
}

.rm-entry-number {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--rm-primary);
}

.rm-entry-actions {
    display: flex;
    gap: 4px;
}

.rm-btn-entry-action {
    background: #ffffff;
    border: 1px solid var(--rm-border);
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--rm-text-muted);
}

.rm-btn-entry-action:hover {
    background: #e2e8f0;
    color: var(--rm-text);
}

.rm-btn-entry-delete {
    color: var(--rm-danger);
    border-color: #fca5a5;
}

.rm-btn-entry-delete:hover {
    background: #fee2e2;
}

.rm-add-action-row {
    margin-top: 14px;
}

.rm-sub-heading {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--rm-text);
    margin: 12px 0 10px;
}

.rm-section-divider {
    border: 0;
    border-top: 1px solid var(--rm-border);
    margin: 18px 0 14px;
}

.rm-mb-10 { margin-bottom: 10px; }
.rm-mb-15 { margin-bottom: 15px; }
.rm-mt-15 { margin-top: 15px; }

/* Templates Picker */
.rm-templates-picker {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.rm-tpl-card {
    border: 2px solid var(--rm-border);
    border-radius: var(--rm-radius);
    padding: 10px;
    cursor: pointer;
    text-align: center;
    background: #ffffff;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rm-tpl-card input[type="radio"] {
    display: none;
}

.rm-tpl-card:hover {
    border-color: var(--rm-primary-border);
    background: #f8fafc;
}

.rm-tpl-card.active {
    border-color: var(--rm-primary);
    background: var(--rm-primary-light);
}

.rm-tpl-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--rm-text);
}

/* Template Miniature Visuals */
.rm-tpl-preview {
    width: 65px;
    height: 85px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    border-radius: 4px;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.rm-tpl-bar {
    height: 6px;
    background: var(--rm-primary);
    border-radius: 2px;
    width: 100%;
}

.rm-tpl-line {
    height: 3px;
    background: #94a3b8;
    border-radius: 1px;
}

.rm-tpl-line.w-80 { width: 80%; }
.rm-tpl-line.w-60 { width: 60%; }
.rm-tpl-line.w-90 { width: 90%; }
.rm-tpl-line.w-70 { width: 70%; }
.rm-tpl-line.w-85 { width: 85%; }
.rm-tpl-line.w-75 { width: 75%; }
.rm-tpl-line.w-50 { width: 50%; }
.rm-tpl-line.center { margin: 0 auto; }

.rm-tpl-divider {
    height: 1px;
    background: #cbd5e1;
    margin: 2px 0;
}

.rm-tpl-modern-thumb {
    flex-direction: row;
    padding: 0;
    overflow: hidden;
}

.rm-tpl-side {
    width: 30%;
    height: 100%;
    background: var(--rm-primary);
}

.rm-tpl-body {
    width: 70%;
    height: 100%;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Color Picker */
.rm-color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rm-color-input {
    width: 44px;
    height: 38px;
    border: 1px solid var(--rm-border-dark);
    border-radius: var(--rm-radius);
    padding: 2px;
    cursor: pointer;
    background: #ffffff;
}

.rm-preset-colors {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rm-color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    transition: transform 0.15s;
}

.rm-color-dot:hover {
    transform: scale(1.15);
}

.rm-color-dot.active {
    box-shadow: 0 0 0 2px var(--rm-primary);
    transform: scale(1.1);
}

/* Range Sliders */
.rm-slider-val {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--rm-primary);
}

.rm-range {
    width: 100%;
    accent-color: var(--rm-primary);
    cursor: pointer;
}

/* Font Upload Box */
.rm-user-font-upload-box {
    background: #f8fafc;
    border: 1px dashed var(--rm-border-dark);
    padding: 12px;
    border-radius: var(--rm-radius);
    margin-top: 10px;
}

.rm-font-status-msg {
    font-size: 0.8rem;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 4px;
}

.rm-font-status-msg.success {
    background: #dcfce7;
    color: #15803d;
}

.rm-font-status-msg.error {
    background: #fee2e2;
    color: #b91c1c;
}

/* Privacy Note */
.rm-privacy-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: var(--rm-radius);
    font-size: 0.82rem;
    color: var(--rm-text-muted);
}

/* ================= RIGHT COLUMN: LIVE A4 PREVIEW ================= */
.rm-preview-column {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.rm-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--rm-surface);
    padding: 10px 16px;
    border-radius: var(--rm-radius) var(--rm-radius) 0 0;
    border: 1px solid var(--rm-border);
    border-bottom: none;
    box-shadow: var(--rm-shadow-sm);
    flex-wrap: wrap;
    gap: 10px;
}

.rm-preview-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rm-preview-badge {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--rm-primary);
}

.rm-page-indicator {
    font-size: 0.78rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--rm-text-muted);
    font-weight: 500;
}

.rm-preview-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: var(--rm-radius);
    border: 1px solid var(--rm-border);
}

.rm-zoom-level {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    color: var(--rm-text);
}

/* Canvas Area */
.rm-preview-canvas {
    flex: 1;
    background: #525659;
    border: 1px solid var(--rm-border);
    border-radius: 0 0 var(--rm-radius) var(--rm-radius);
    overflow: auto;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Exact A4 Page Container (210mm x 297mm) */
.rm-a4-page {
    width: var(--rm-a4-width);
    min-height: var(--rm-a4-height);
    background: #ffffff;
    color: #111827;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transform-origin: top center;
    transition: transform 0.2s ease;
    position: relative;
    font-family: var(--rm-font-family);
    font-size: var(--rm-font-size);
    line-height: var(--rm-line-height);
    margin-bottom: 24px;
}

.rm-resume-inner {
    width: 100%;
    min-height: 100%;
}

.rm-mobile-action-bar {
    display: none;
}

/* ================= RESUME TEMPLATES STYLES ================= */

/* Common Resume Headings & Elements */
.res-sec-heading {
    font-family: var(--rm-heading-font);
    font-size: 1.02em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--rm-accent-color, #0c52a6) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 5px !important;
    margin-top: 15px;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: none !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.res-sec-heading * {
    color: #ffffff !important;
}

.res-name {
    font-family: var(--rm-heading-font);
    font-size: 2em;
    font-weight: 700;
    color: var(--rm-accent-color);
    line-height: 1.15;
}

.res-job-title {
    font-size: 1.08em;
    font-weight: 600;
    color: #475569;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.res-contact-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.88em;
    color: #334155;
    margin-top: 8px;
}

.res-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.res-contact-item a {
    color: inherit;
    text-decoration: none;
}

.res-photo-img {
    width: 95px;
    height: 115px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--rm-accent-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Clean Tables for Education */
.res-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 6px;
    font-size: 0.92em;
}

.res-table th {
    background: var(--rm-accent-light);
    color: var(--rm-accent-color);
    font-weight: 700;
    text-align: left;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    font-size: 0.9em;
}

.res-table td {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

/* Timeline & Entries */
.res-entry-block {
    margin-bottom: 10px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.res-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.98em;
}

.res-entry-title {
    font-weight: 700;
    color: #0f172a;
}

.res-entry-sub {
    font-weight: 600;
    color: #475569;
}

.res-entry-meta {
    font-size: 0.86em;
    color: #64748b;
    font-style: italic;
    white-space: nowrap;
}

.res-bullets {
    margin: 4px 0 6px 18px;
    color: #334155;
    font-size: 0.92em;
}

.res-bullets li {
    margin-bottom: 2px;
}

/* Skills Badges in Resume */
.res-skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.res-skill-badge {
    background: var(--rm-accent-light);
    color: var(--rm-accent-color);
    font-size: 0.86em;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    border: 1px solid rgba(0,0,0,0.06);
}

/* Personal Details 2-Column Table */
.res-personal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 16px;
    font-size: 0.9em;
    margin-top: 4px;
}

.res-personal-item {
    display: flex;
    gap: 6px;
}

.res-personal-label {
    font-weight: 600;
    color: #475569;
    min-width: 95px;
}

.res-personal-val {
    color: #0f172a;
}

/* Declaration Box */
.res-declaration-box {
    margin-top: 18px;
    page-break-inside: avoid;
    break-inside: avoid;
    font-size: 0.9em;
    border-top: 1px dashed #cbd5e1;
    padding-top: 10px;
}

.res-declaration-text {
    font-style: italic;
    color: #334155;
    margin-bottom: 16px;
    line-height: 1.4;
}

.res-signature-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.res-decl-meta {
    font-size: 0.92em;
    color: #475569;
}

.res-signature-block {
    text-align: right;
}

.res-sig-line {
    width: 140px;
    border-top: 1px solid #1e293b;
    margin-bottom: 4px;
    display: inline-block;
}

.res-sig-name {
    font-weight: 700;
    color: #0f172a;
}

/* -------------------------------------------------------------
   TEMPLATE 1: CLASSIC (क्लासिक)
   ------------------------------------------------------------- */
.template-classic {
    padding: 18mm 18mm 20mm;
}

.template-classic .res-header-classic {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--rm-accent-color);
    padding-bottom: 14px;
    margin-bottom: 12px;
}

.template-classic .res-sec-heading {
    border-bottom: none !important;
    background: var(--rm-accent-color, #0c52a6) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 5px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* -------------------------------------------------------------
   TEMPLATE 2: MODERN WITH SIDEBAR (मॉडर्न साइडबार)
   ------------------------------------------------------------- */
.template-modern {
    padding: 0;
    display: grid;
    grid-template-columns: 70mm auto;
    min-height: var(--rm-a4-height);
}

.template-modern .res-modern-sidebar {
    background: var(--rm-accent-light);
    border-right: 1px solid #e2e8f0;
    padding: 16mm 7mm;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.template-modern .res-modern-sidebar .res-photo-wrapper {
    text-align: center;
    margin-bottom: 8px;
}

.template-modern .res-modern-sidebar .res-photo-img {
    width: 110px;
    height: 130px;
    border-radius: 8px;
    border: 3px solid #ffffff;
    box-shadow: var(--rm-shadow);
}

.template-modern .res-modern-sidebar .res-sec-heading {
    font-size: 0.92em;
    border-bottom: none !important;
    background: var(--rm-accent-color, #0c52a6) !important;
    color: #ffffff !important;
    padding: 5px 10px !important;
    border-radius: 4px !important;
    margin-top: 10px;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.template-modern .res-modern-sidebar .res-contact-bar {
    flex-direction: column;
    gap: 6px;
    font-size: 0.86em;
}

.template-modern .res-modern-main {
    padding: 16mm 14mm;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-modern .res-modern-main .res-sec-heading {
    border-bottom: none !important;
    background: var(--rm-accent-color, #0c52a6) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 5px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* -------------------------------------------------------------
   TEMPLATE 3: MINIMALIST (मिनिमल)
   ------------------------------------------------------------- */
.template-minimal {
    padding: 20mm 20mm;
}

.template-minimal .res-header-minimal {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e2e8f0;
}

.template-minimal .res-header-minimal .res-photo-wrapper {
    margin-bottom: 10px;
}

.template-minimal .res-header-minimal .res-photo-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid var(--rm-accent-color);
}

.template-minimal .res-header-minimal .res-name {
    font-size: 2.2em;
    letter-spacing: 1px;
}

.template-minimal .res-header-minimal .res-contact-bar {
    justify-content: center;
}

.template-minimal .res-sec-heading {
    border-bottom: none !important;
    background: var(--rm-accent-color, #0c52a6) !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 5px !important;
    margin-top: 16px;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.template-minimal .res-sec-heading::before {
    display: none !important;
}

/* ================= MODAL DIALOG ================= */
.rm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.rm-modal-box {
    background: #ffffff;
    border-radius: var(--rm-radius-lg);
    max-width: 440px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--rm-shadow-lg);
    text-align: center;
    animation: rm-scale-in 0.2s ease-out;
}

@keyframes rm-scale-in {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.rm-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rm-text);
    margin-bottom: 8px;
}

.rm-modal-msg {
    font-size: 0.95rem;
    color: var(--rm-text-muted);
    margin-bottom: 20px;
}

.rm-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ================= RESPONSIVE MOBILE STYLES ================= */
@media screen and (max-width: 1024px) {
    .rm-workspace {
        grid-template-columns: 1fr;
    }

    .rm-preview-column {
        position: static;
        height: auto;
        display: none; /* Controlled by mobile tabs */
    }

    .rm-mobile-tabs {
        display: flex;
    }

    .rm-workspace.show-preview .rm-form-column {
        display: none;
    }

    .rm-workspace.show-preview .rm-preview-column {
        display: flex;
    }

    .rm-mobile-action-bar {
        display: flex;
        gap: 10px;
        position: sticky;
        bottom: 0;
        background: #ffffff;
        padding: 12px 16px;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
        border-top: 1px solid var(--rm-border);
        z-index: 90;
    }

    .rm-mobile-action-bar .rm-btn {
        flex: 1;
    }
}

@media screen and (max-width: 640px) {
    .rm-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .rm-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .rm-grid-2, .rm-grid-3, .rm-toggles-grid {
        grid-template-columns: 1fr;
    }

    .rm-templates-picker {
        grid-template-columns: 1fr;
    }
}

/* ================= PRINT ENGINE (@media print) ================= */
@media print {
    /* Hide everything on the page except the resume document */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .rm-header,
    .rm-mobile-tabs,
    .rm-form-column,
    .rm-preview-toolbar,
    .rm-mobile-action-bar,
    .rm-modal-backdrop {
        display: none !important;
    }

    .rm-container,
    .rm-workspace,
    .rm-preview-column,
    .rm-preview-canvas {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        height: auto !important;
    }

    .rm-a4-page {
        width: 100% !important;
        max-width: 210mm !important;
        min-height: 297mm !important;
        margin: 0 auto !important;
        padding: 15mm !important;
        box-shadow: none !important;
        border: none !important;
        transform: none !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .template-modern {
        padding: 0 !important;
    }

    /* Page Break Safety Rules */
    .res-sec-heading,
    .res-entry-block,
    .res-table tr,
    .res-declaration-box,
    .res-signature-row {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    @page {
        size: A4 portrait;
        margin: 0;
    }
}


/* Section Reorder Controls in Header */
.rm-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rm-order-arrows {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-right: 4px;
}

.rm-btn-order {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1;
    padding: 0;
    transition: all 0.15s ease;
}

.rm-btn-order:hover:not(:disabled) {
    background: var(--rm-accent-color, #0284c7);
    color: #ffffff;
    border-color: var(--rm-accent-color, #0284c7);
}

.rm-btn-order:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Section Order Manager List */
.rm-section-order-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.rm-order-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.rm-order-item:hover {
    background: #f1f5f9;
}

.rm-order-item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

.rm-order-item-num {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rm-order-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
