/* ==========================================================================
   VENAIR SUPPORT - Warm Monochrome Design
   Friendly structure with professional black/gray/white palette
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Warm Neutral Palette */
    --bg: #FAFAF9;
    /* Blanco roto cálido */
    --bg-soft: #F7F6F5;
    /* Fondo suave */
    --surface: #FFFFFF;
    --surface-hover: #FCFCFB;

    /* Text */
    --text: #1A1A1A;
    /* Negro carbón */
    --text-soft: #4A4A4A;
    /* Gris oscuro */
    --text-muted: #8A8A8A;
    /* Gris medio */

    /* Primary (Negro/Gris) */
    --primary: #1A1A1A;
    --primary-soft: rgba(26, 26, 26, 0.08);
    --primary-hover: #2D2D2D;
    --secondary: #3D3D3D;
    --secondary-soft: rgba(61, 61, 61, 0.08);
    --gradient: linear-gradient(135deg, #2D2D2D 0%, #1A1A1A 100%);
    --gradient-soft: linear-gradient(135deg, rgba(26, 26, 26, 0.04) 0%, rgba(61, 61, 61, 0.04) 100%);

    /* Functional */
    --success: #2D8A4E;
    --success-soft: rgba(45, 138, 78, 0.1);
    --error: #C53030;
    --error-soft: rgba(197, 48, 48, 0.1);
    --info: #2B6CB0;
    --info-soft: rgba(43, 108, 176, 0.1);

    /* Borders */
    --border: #EBEBEA;
    --border-hover: #DDDCDB;
    --border-focus: #1A1A1A;

    /* Typography */
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;

    /* Radii */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-xl: 24px;
    --r-2xl: 32px;
    --r-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.04);
    --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.06);
    --shadow-lg: 0 8px 24px rgba(26, 26, 26, 0.08);
    --shadow-xl: 0 16px 48px rgba(26, 26, 26, 0.10);
    --shadow-button: 0 4px 16px rgba(26, 26, 26, 0.15);

    /* Animation */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration: 250ms;
    --duration-lg: 400ms;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Warm Background (sutil)
   -------------------------------------------------------------------------- */
.warm-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation: glowPulse 10s ease-in-out infinite;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(26, 26, 26, 0.03) 0%, transparent 70%);
    top: -150px;
    right: -100px;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(61, 61, 61, 0.025) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes glowPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: var(--sp-8);
}

.view {
    display: block;
}

.hidden {
    display: none !important;
}

.hidden-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 250, 249, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--sp-4) var(--sp-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 26px;
    width: auto;
    transition: opacity var(--duration) var(--ease);
}

.logo:hover .logo-img {
    opacity: 0.6;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
}

/* Header Link (Mis Tickets) */
.header-link {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 8px 14px;
    background: var(--bg-soft);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.header-link:hover {
    background: var(--text);
    color: white;
}

.header-link svg {
    width: 16px;
    height: 16px;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* Language Toggle */
.lang-toggle {
    display: flex;
    background: var(--bg-soft);
    border-radius: var(--r-full);
    padding: 3px;
}

.lang-btn {
    padding: 6px 14px;
    border: none;
    background: transparent;
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.lang-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.lang-btn:hover:not(.active) {
    color: var(--text-soft);
}

/* User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.btn-logout {
    padding: 8px 16px;
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration) var(--ease);
}

.btn-logout:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

/* --------------------------------------------------------------------------
   Welcome Card (Login View)
   -------------------------------------------------------------------------- */
.welcome-card {
    background: var(--surface);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--sp-12);
    max-width: 480px;
    width: 100%;
    text-align: center;
    animation: fadeUp 0.6s var(--ease-out);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-illustration {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--sp-6);
    animation: wiggle 3s ease-in-out infinite;
}

.welcome-illustration svg {
    width: 100%;
    height: 100%;
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(2deg);
    }
}

.welcome-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--gradient-soft);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: var(--sp-4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--sp-3);
    line-height: 1.3;
}

.welcome-text {
    font-size: 1rem;
    color: var(--text-soft);
    margin-bottom: var(--sp-8);
    line-height: 1.6;
}

/* Login Button */
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    width: 100%;
    padding: 18px var(--sp-6);
    background: var(--gradient);
    border: none;
    border-radius: var(--r-lg);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-button);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.2);
}

.btn-login:active {
    transform: scale(0.98);
}

.btn-icon {
    width: 22px;
    height: 22px;
}

.btn-arrow {
    width: 20px;
    height: 20px;
    margin-left: auto;
    opacity: 0.7;
    transition: transform var(--duration) var(--ease);
}

.btn-login:hover .btn-arrow {
    transform: translateX(4px);
}

.welcome-footer {
    margin-top: var(--sp-8);
    padding-top: var(--sp-6);
    border-top: 1px solid var(--border);
}

.link-tickets {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 14px;
    color: var(--text-soft);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

.link-tickets:hover {
    color: var(--text);
}

.link-tickets svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Form View
   -------------------------------------------------------------------------- */
.form-wrapper {
    width: 100%;
    max-width: 640px;
    animation: fadeUp 0.6s var(--ease-out);
}

/* Greeting */
.greeting {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-6);
}

.greeting-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: var(--r-full);
    color: white;
}

.greeting-avatar svg {
    width: 24px;
    height: 24px;
}

.greeting-text {
    font-size: 1.125rem;
    color: var(--text);
}

.greeting-hello {
    font-weight: 500;
}

.greeting-name {
    font-weight: 700;
}

.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--sp-8);
    line-height: 1.3;
}

/* Form */
.form {
    background: var(--surface);
    border-radius: var(--r-2xl);
    padding: var(--sp-8);
    box-shadow: var(--shadow-lg);
}

/* Steps Indicator */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-1);
    margin-bottom: var(--sp-8);
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    transition: all var(--duration) var(--ease);
}

.step-dot.active {
    background: var(--text);
    transform: scale(1.2);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.step-dot.completed {
    background: var(--success);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
}

/* Form Section */
.form-section {
    margin-bottom: var(--sp-8);
    padding-bottom: var(--sp-8);
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: var(--sp-6);
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--sp-5);
}

.section-num {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    color: var(--text-soft);
    border-radius: var(--r-full);
    font-size: 13px;
    font-weight: 700;
}

.section-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Field Row */
.field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

@media (max-width: 540px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

/* Field */
.field {
    margin-bottom: var(--sp-4);
}

.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: var(--sp-2);
}

/* Select */
.select-box {
    position: relative;
}

.select {
    width: 100%;
    padding: var(--sp-4);
    padding-right: 44px;
    background: var(--bg-soft);
    border: 1.5px solid transparent;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    transition: all var(--duration) var(--ease);
}

.select:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
}

.select:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.select-icon {
    position: absolute;
    right: var(--sp-4);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Type Options */
.type-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

@media (max-width: 480px) {
    .type-options {
        grid-template-columns: 1fr;
    }
}

.type-option {
    display: contents;
}

.type-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-card {
    display: flex;
    align-items: flex-start;
    gap: var(--sp-4);
    padding: var(--sp-5);
    background: var(--bg-soft);
    border: 2px solid transparent;
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.type-card:hover {
    background: var(--surface);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.type-radio:checked+.type-card {
    background: var(--surface);
    border-color: var(--text);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.type-icon {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    border-radius: var(--r-md);
    color: var(--text-soft);
    flex-shrink: 0;
    transition: all var(--duration) var(--ease);
    overflow: hidden;
}

.type-icon svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1;
    transition: transform var(--duration) var(--ease);
}

.type-card:hover .type-icon svg {
    transform: scale(1.1);
}

/* Pulse animation for incident */
.icon-pulse {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(26, 26, 26, 0.1) 0%, transparent 70%);
    border-radius: inherit;
    animation: iconPulse 2s ease-in-out infinite;
    opacity: 0;
}

.type-card:hover .icon-pulse {
    opacity: 1;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
}

/* Sparkle rotation for request */
.icon-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity var(--duration) var(--ease);
}

.type-card:hover .icon-sparkle {
    opacity: 1;
    animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(0.5);
        opacity: 0.3;
    }

    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Request icon rotation on hover */
.type-icon--request svg {
    transition: transform 0.6s var(--ease);
}

.type-card:hover .type-icon--request svg {
    transform: rotate(90deg);
}

.type-radio:checked+.type-card .type-icon {
    background: var(--text);
    color: white;
}

.type-radio:checked+.type-card .icon-sparkle {
    background: white;
}

.type-info {
    flex: 1;
}

.type-name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.type-desc {
    display: block;
    font-size: 13px;
    color: var(--text-soft);
}

/* Editor */
.editor-box {
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all var(--duration) var(--ease);
}

.editor-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.editor-tools {
    display: flex;
    gap: var(--sp-1);
    padding: var(--sp-2) var(--sp-3);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.tool-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.tool-btn:hover {
    background: var(--surface);
    color: var(--text);
}

.tool-btn.active {
    background: var(--text);
    color: white;
}

.tool-btn svg {
    width: 16px;
    height: 16px;
}

.editor {
    min-height: 140px;
    max-height: 280px;
    padding: var(--sp-4);
    font-size: 15px;
    line-height: 1.7;
    overflow-y: auto;
    outline: none;
}

.editor:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.editor-status {
    padding: var(--sp-2) var(--sp-4);
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    text-align: right;
}

.char-indicator {
    font-size: 12px;
    color: var(--text-muted);
}

/* Upload Zone */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-10);
    text-align: center;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--text);
    background: var(--primary-soft);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon-wrap {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--sp-4);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    border-radius: var(--r-full);
}

.upload-icon {
    width: 28px;
    height: 28px;
    color: var(--text-soft);
}

.upload-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: var(--sp-1);
}

.upload-or {
    font-size: 14px;
    color: var(--text-soft);
}

.upload-browse {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* File List */
.file-list {
    margin-top: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--bg-soft);
    border-radius: var(--r-md);
    animation: slideIn 0.3s var(--ease-out);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-icon {
    width: 20px;
    height: 20px;
    color: var(--text-soft);
}

.file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
}

.file-remove {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-full);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.file-remove:hover {
    background: var(--error-soft);
    color: var(--error);
}

.file-remove svg {
    width: 14px;
    height: 14px;
}

/* Notification */
.notification {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-5);
    animation: slideIn 0.3s var(--ease-out);
}

.notification.success {
    background: var(--success-soft);
    color: #1e6f3d;
}

.notification.error {
    background: var(--error-soft);
    color: #a32828;
}

.notification svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Form Footer */
.form-footer {
    text-align: center;
}

.btn-submit {
    width: 100%;
    padding: 18px var(--sp-6);
    background: var(--gradient);
    border: none;
    border-radius: var(--r-lg);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    box-shadow: var(--shadow-button);
}

.btn-submit:disabled {
    background: var(--border);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.btn-submit:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.2);
}

.btn-submit:not(:disabled):active {
    transform: scale(0.98);
}

.btn-loader {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.16s;
}

.dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.submit-hint {
    margin-top: var(--sp-4);
    font-size: 13px;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-lg) var(--ease);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--surface);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--duration-lg) var(--ease-spring);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-5) var(--sp-6);
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-full);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.modal-close:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--sp-6);
    max-height: calc(85vh - 70px);
    overflow-y: auto;
}

/* SAP Choices */
.sap-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

@media (max-width: 480px) {
    .sap-choices {
        grid-template-columns: 1fr;
    }
}

.sap-choice {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-5);
    background: var(--bg-soft);
    border: 2px solid transparent;
    border-radius: var(--r-lg);
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all var(--duration) var(--ease);
}

.sap-choice:hover {
    background: var(--surface);
    border-color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sap-choice-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    border-radius: var(--r-md);
    color: var(--text-soft);
    flex-shrink: 0;
}

.sap-choice-icon svg {
    width: 22px;
    height: 22px;
}

.sap-choice:hover .sap-choice-icon {
    background: var(--text);
    color: white;
}

.sap-choice-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.sap-choice-desc {
    display: block;
    font-size: 13px;
    color: var(--text-soft);
}

/* SAP Inventory */

.sap-tip {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4);
    background: var(--info-soft);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
    font-size: 13px;
    color: var(--info);
}

.sap-tip svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sap-table-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: var(--sp-4);
}

.sap-table {
    width: 100%;
    min-width: 550px;
    border-collapse: collapse;
}

.sap-table th {
    padding: var(--sp-3);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}

.sap-table td {
    padding: var(--sp-2);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.sap-table tr:last-child td {
    border-bottom: none;
}

.sap-table input,
.sap-table textarea {
    width: 100%;
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 13px;
    background: var(--surface);
    transition: all var(--duration) var(--ease);
}

.sap-table input:focus,
.sap-table textarea:focus {
    outline: none;
    border-color: var(--text);
    box-shadow: 0 0 0 2px var(--primary-soft);
}

.sap-table textarea {
    min-height: 36px;
    resize: vertical;
}

.sap-qty-input {
    text-align: center;
    font-weight: 600;
}

.sap-qty-positive {
    background: var(--success-soft) !important;
    color: var(--success) !important;
    border-color: var(--success) !important;
}

.sap-qty-negative {
    background: var(--error-soft) !important;
    color: var(--error) !important;
    border-color: var(--error) !important;
}

.sap-delete-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.sap-delete-btn:hover {
    background: var(--error-soft);
    color: var(--error);
}

.sap-delete-btn svg {
    width: 16px;
    height: 16px;
}

.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    width: 100%;
    padding: var(--sp-3);
    background: transparent;
    border: 2px dashed var(--border);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    margin-bottom: var(--sp-6);
    transition: all var(--duration) var(--ease);
}

.btn-add:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--primary-soft);
}

.btn-add svg {
    width: 18px;
    height: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--sp-3);
    padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
}

.btn-cancel,
.btn-confirm {
    padding: var(--sp-3) var(--sp-6);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.btn-cancel {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-soft);
}

.btn-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.btn-confirm {
    background: var(--gradient);
    border: none;
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-6);
    font-size: 13px;
    color: var(--text-muted);
}

.footer-link {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--text);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .main {
        padding: var(--sp-4);
    }

    .welcome-card {
        padding: var(--sp-8);
    }

    .form {
        padding: var(--sp-6);
    }

    .form-title {
        font-size: 1.5rem;
    }

    .greeting-text {
        font-size: 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}