:root {
    --primary: #0071e3;
    --primary-soft: rgba(0, 113, 227, 0.1);
    --bg: #f5f5f7;
    --sidebar-bg: #1d1d1f;
    --card-bg: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --border: rgba(0, 0, 0, 0.05);
    --radius: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.hidden {
    display: none !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100%;
}

/* Sidebar */
.sidebar {
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

.main-logo {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text strong {
    font-size: 1rem;
    letter-spacing: 1px;
}

.logo-text span {
    font-size: 0.6rem;
    opacity: 0.6;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    font-weight: 600;
}

.sub-nav {
    margin-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sub-nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sub-nav-item.active {
    color: white;
    font-weight: 600;
}

.sub-nav-item .dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.5;
}

.sub-nav.hidden {
    display: none;
}

.sidebar-footer {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.logout-link {
    font-size: 0.75rem;
    color: #ef4444;
    text-decoration: none;
    margin-top: 2px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.logout-link:hover {
    opacity: 1;
}

/* Icon Colors */
.sidebar .lucide {
    width: 20px;
    height: 20px;
}

.icon-inicio {
    color: #3b82f6;
}

.icon-cotizacion {
    color: #22c55e;
}

/* Blue */
.icon-clientes {
    color: #a855f7;
}

/* Purple */
.icon-ordenes {
    color: #ec4899;
}

/* Pink */
.icon-fichas {
    color: #10b981;
}

/* Emerald */
.icon-historial {
    color: #94a3b8;
}

/* Slate */
.icon-produccion {
    color: #f59e0b;
}

/* Amber */
.icon-reclamos {
    color: #ef4444;
}

/* Red */
.icon-config {
    color: #86868b;
}

/* Gray */
.icon-usuarios {
    color: #f97316;
}

/* Orange */

/* Users View Specifics */
.view-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.view-title-main {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.view-subtitle-main {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.no-padding {
    padding: 0 !important;
    overflow: hidden;
}

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

.premium-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    background: #fbfbfd;
}

.premium-table td {
    padding: 1.25rem 1.5rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}

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

.premium-table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.badge.blue {
    background: rgba(0, 113, 227, 0.1);
    color: #0071e3;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: #1d1d1f;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    color: #86868b;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-action {
    background: transparent;
    border: none;
    color: #86868b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-action:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.btn-action.red:hover {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.1);
}

.admin-sidebar-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    letter-spacing: 0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #3a3a3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Main Content */
.main-content {
    background: var(--bg);
    padding: 2rem 3rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 1rem;
}

.back-button {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0 1rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    background: #ffffff;
    color: var(--text);
    box-shadow: var(--shadow);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 750;
    white-space: nowrap;
}

.back-button:hover {
    background: #fbfbfd;
    color: var(--primary);
}

.back-button svg {
    width: 18px;
    height: 18px;
}

.page-title {
    flex: 1;
    min-width: 0;
}

.top-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.mobile-menu-btn {
    display: none;
    background: white;
    border: none;
    padding: 0.6rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: var(--text);
    cursor: pointer;
    z-index: 1001;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.page-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.page-title p {
    color: var(--text-secondary);
}

.usd-badge-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.usd-update-hint {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.usd-badge {
    background: white;
    padding: 0.5rem 1.25rem;
    border-radius: 99px;
    box-shadow: var(--shadow);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.usd-header-input {
    background: transparent;
    border: none;
    color: var(--apple-blue);
    font-weight: 800;
    width: 65px;
    font-size: 0.85rem;
    padding: 0;
    outline: none;
}

.usd-header-input:focus {
    color: var(--apple-blue-dark);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

/* Apple Card */
.apple-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Formula Card */
.formula-card {
    padding: 1.5rem !important;
    background: #fdfdfd !important;
    border-style: solid !important;
    border-color: #eaeaea !important;
    border-width: 1px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.formula-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    color: var(--text-secondary);
}

.formula-header h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: #333;
}

.formula-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.breakdown-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.breakdown-step:last-child {
    border-bottom: none;
}

.breakdown-step .step-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.breakdown-step code {
    font-family: "SF Mono", "Fira Code", monospace;
    color: var(--primary);
    font-weight: 700;
    background: #f4f6f8;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.breakdown-step.highlight {
    border-bottom: none;
    background: #f0f7ff;
    padding: 0.75rem 0.8rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    border: 1px solid #e0effc;
}

.step-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.75rem 0.8rem;
    font-weight: 600;
    color: #111;
    background: #fff;
    border-radius: 6px;
    margin-top: 0.2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #eee;
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.blue {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Form Styling */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-field.full {
    grid-column: span 2;
}

.fdbordenes-card {
    border-color: rgba(0, 113, 227, 0.18);
}

.fdbordenes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.fdbordenes-grid .input-field.full {
    grid-column: 1 / -1;
}

.live-results {
    display: grid;
    gap: 0.4rem;
    max-height: 240px;
    overflow-y: auto;
    padding: 0.45rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}

.live-result {
    display: grid;
    gap: 0.15rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #f7f9fc;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.live-result:hover,
.live-result.active {
    border-color: rgba(0, 113, 227, 0.25);
    background: #eef6ff;
}

.live-result strong {
    font-size: 0.9rem;
}

.live-result span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
}

.empty-line {
    padding: 0.7rem 0.8rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
}

.fdbordenes-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.25rem;
}

.fdbordenes-save {
    width: auto;
    min-width: 160px;
    padding: 0.85rem 1.25rem;
}

.fdbordenes-auto {
    color: var(--text);
    padding-left: 0;
}

.fdbordenes-work-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.fdbordenes-work-summary.empty {
    border-color: var(--border);
    background: #f7f9fc;
}

.fdbordenes-work-summary strong {
    display: block;
    margin: 0.15rem 0 0.35rem;
    font-size: 1rem;
}

.fdbordenes-work-summary p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.45;
}

.summary-eyebrow {
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.65rem;
}

.summary-chips span {
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: #eef5ff;
    color: #0b5fc6;
    font-size: 0.75rem;
    font-weight: 800;
}

.fdbordenes-modal-btn {
    width: auto;
    min-width: 128px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.72rem 0.95rem;
}

.fdbordenes-modal-btn svg {
    width: 17px;
    height: 17px;
}

.fdbordenes-status {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #f7f9fc;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.fdbordenes-status.success {
    background: #eefbf6;
    color: #12805c;
    border-color: rgba(18, 128, 92, 0.18);
}

.fdbordenes-status.error {
    background: #fff1f0;
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.18);
}

.ficha-modal-card {
    max-width: 860px;
    max-height: min(820px, 92vh);
    overflow: hidden;
}

.modal-eyebrow {
    margin: 0 0 0.25rem;
    color: #8fbfff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ficha-modal-body {
    display: grid;
    gap: 1rem;
    max-height: 62vh;
    overflow-y: auto;
}

.ficha-modal-hero {
    padding: 1rem;
    border-radius: 14px;
    background: #f5f7fb;
    color: #1d1d1f;
}

.ficha-modal-hero h3 {
    margin: 0 0 0.35rem;
    font-size: 1.25rem;
}

.ficha-modal-hero p {
    margin: 0;
    color: #5f6673;
    font-size: 0.9rem;
}

.ficha-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.ficha-modal-field,
.ficha-modal-section {
    padding: 0.8rem;
    border-radius: 12px;
    background: #f5f7fb;
    color: #1d1d1f;
}

.ficha-modal-field span,
.ficha-modal-section span {
    display: block;
    margin-bottom: 0.25rem;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ficha-modal-field strong {
    font-size: 0.92rem;
}

.ficha-modal-section {
    grid-column: 1 / -1;
}

.ficha-modal-section p {
    margin: 0;
    color: #1d1d1f;
    white-space: pre-wrap;
}

label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-left: 0.25rem;
}

input,
select {
    background: #fbfbfd;
    border: 1px solid #d2d2d7;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-soft);
}

/* Result Pill Section */
.result-pill-container {
    background: linear-gradient(135deg, white 0%, #f0f7ff 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-main small {
    display: block;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.result-main h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0.5rem 0 0.2rem 0;
    letter-spacing: -2px;
    color: #000;
}

.unit-price-box {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    color: var(--apple-gray-dark);
}

.unit-price-box small {
    font-size: 0.75rem;
    font-weight: 600;
}

.unit-price-box span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--apple-blue);
}

.result-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: right;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.stat strong {
    font-size: 1.25rem;
    color: #1d1d1f;
}

.stat strong.highlight {
    color: var(--primary);
}

/* View Management */
.hidden {
    display: none !important;
}

.view-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Config Full Layout */
.config-full-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding-bottom: 5rem;
}

.config-tables-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.input-field.full-width {
    grid-column: 1 / -1;
}

.input-field textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.email-mockup {
    background: #ffffff;
    padding: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    max-width: 650px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.email-banner {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 0;
    background: #f8f8fa;
    min-height: 60px;
}

.email-mockup-inner {
    padding: 20px 25px;
}

.email-content-block {
    padding: 0;
    background: transparent;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

.email-quote-placeholder {
    padding: 1.5rem;
    background: #fcfcfc;
    border: 1px dashed #ddd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

.payment-block {
    border-top: 1px solid #eee;
    padding-top: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.config-section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--sidebar-bg);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.75rem;
}

.table-card {
    overflow: hidden;
    padding: 1.5rem 0;
}

.card-header-flex {
    padding: 0 2rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.table-scroll-container {
    overflow-x: auto;
    padding: 0 1rem;
}

/* Premium Toggle Group */
.toggle-group-premium {
    display: flex;
    background: #f1f3f5;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    margin-top: 8px;
    border: 1px solid #e9ecef;
}

.toggle-btn-premium {
    flex: 1;
    padding: 10px 16px;
    text-align: center;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: #6c757d;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.toggle-btn-premium:hover {
    background: rgba(255, 255, 255, 0.5);
}

.toggle-btn-premium.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Upload Control */
/* Custom Checkbox */
.container-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    -webkit-user-select: none;
    user-select: none;
    color: var(--text-secondary);
}

.container-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 1px solid #d2d2d7;
    border-radius: 4px;
    transition: all 0.2s;
}

.container-checkbox:hover input~.checkmark {
    background-color: #f5f5f7;
}

.container-checkbox input:checked~.checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.container-checkbox input:checked~.checkmark:after {
    display: block;
}

.container-checkbox .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.mt-6 {
    margin-top: 1.5rem;
}

.upload-control {
    display: flex;
    gap: 8px;
    align-items: center;
}

.upload-control .btn-action {
    white-space: nowrap;
    height: 42px;
}

/* Business Table */
.business-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.business-table th {
    background: #fbfbfd;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.business-table td {
    padding: 0;
    border: 1px solid var(--border);
}

.business-table input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    border-radius: 0;
}

.business-table input:focus {
    background: var(--primary-soft);
    box-shadow: none;
    color: var(--primary);
    font-weight: 600;
}

.business-table tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

.business-table td:first-child {
    background: #fbfbfd;
    font-weight: 700;
    color: var(--text);
    width: 180px;
    padding: 1rem;
    text-align: left;
}

.config-floating-actions {
    position: fixed;
    bottom: 2rem;
    right: 3rem;
    z-index: 100;
}

.btn-apple-primary.large {
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(0, 113, 227, 0.3);
}

/* Material List Mini */
.mini-material-list {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.material-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.material-item:hover {
    background: var(--bg);
}

.m-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.m-info strong {
    font-size: 0.75rem;
    color: var(--text);
}

.m-info small {
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
}

.search-box input {
    width: 100%;
    background: var(--bg);
    border: none;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.material-item input {
    width: 70px;
    padding: 0.4rem;
    font-size: 0.85rem;
    text-align: right;
    border: 1px solid transparent;
    background: transparent;
}

.material-item input:focus {
    background: white;
    border-color: var(--primary);
}

.btn-apple-primary {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-apple-primary:hover {
    background: #0077ed;
    transform: scale(1.01);
}

.edit-prices-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.price-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    width: 45px;
    text-align: right;
}

.material-item.dual-price {
    align-items: flex-start;
}

.material-item.dual-price .m-info {
    margin-top: 0.5rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1rem 0;
}

.small {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1100px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Extras Section */
.extras-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #fbfbfd;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.section-title-alt {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.extras-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

.extra-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.extra-group small {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
}

.extra-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.checkbox-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
}

.checkbox-mini input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Checkbox Wrapper */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-soft);
    border-radius: 12px;
    border: 1px solid rgba(0, 113, 227, 0.2);
    cursor: pointer;
    margin-top: 1rem;
}

.checkbox-wrapper.white-master {
    background: #fff;
    border-color: #d2d2d7;
}

.checkbox-wrapper.white-master label {
    color: var(--text);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-wrapper label {
    padding-left: 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* Weight Alert Card */
.result-pill-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 2.5rem;
    position: relative;
    border-radius: 24px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.result-main {
    text-align: left;
    flex: 1;
}

.result-main h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
    letter-spacing: -2px;
}

.result-main small {
    color: var(--apple-blue);
    font-weight: 700;
    letter-spacing: 1px;
}

.unit-price-box {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.unit-price-box small {
    color: #86868b;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.unit-price-box span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.result-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    min-width: 140px;
}

.stat {
    text-align: right;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.stat span {
    font-size: 0.65rem;
    color: #86868b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat strong {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.stat .highlight {
    color: var(--apple-blue);
    font-size: 1.5rem;
}

.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: flex-end;
}

.result-insights-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: -0.75rem;
    margin-bottom: 2rem;
}

.result-insight-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 1.1rem 1.15rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.result-insight-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.result-insight-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-insight-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.1);
    border-radius: 999px;
    padding: 0.28rem 0.55rem;
    white-space: nowrap;
}

.result-insight-value {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
}

.result-insight-value.neutral {
    color: #0f172a;
}

.result-insight-value.success {
    color: #16a34a;
}

.result-insight-note {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.35;
}

.btn-share-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: #f5f5f7;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.btn-share-icon i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    stroke-width: 2.5px;
}

.btn-share-icon span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-share-icon:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-share-icon:hover i {
    color: var(--apple-blue);
}

.btn-share-icon.whatsapp:hover i {
    color: #25D366;
}

.btn-share-icon.email:hover i {
    color: #ea4335;
}

.btn-share-icon.text-copy:hover i {
    color: #111827;
}

.weight-alert-card {
    background: #fff4e5;
    border-radius: var(--radius);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #ffe7c4;
    box-shadow: 0 4px 12px rgba(255, 167, 38, 0.15);
    animation: shake 0.5s ease-in-out;
}

.weight-alert-card .icon {
    font-size: 1.5rem;
}

.weight-alert-card .alert-content strong {
    display: block;
    color: #e65100;
    font-size: 0.95rem;
}

.weight-alert-card .alert-content p {
    font-size: 0.85rem;
    color: #ef6c00;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Config Material Grid & Search */
.config-material-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.usd-box {
    background: #fbfbfd;
    padding: 2rem;
    border-radius: 20px;
    height: fit-content;
    border: 1px solid var(--border);
}

.micro-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    line-height: 1.4;
}

.full-material-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 1.5rem;
    margin-top: 1.5rem;
}

.material-search-box .search-box input {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    background: white;
    border: 1px solid #d2d2d7;
}

/* Print Optimization */
@media print {
    @page {
        margin: 0.5cm;
        size: A4 portrait;
    }

    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide browser headers/footers */
    header,
    footer {
        display: none !important;
    }

    .no-print {
        display: none !important;
    }
}

/* --- NEW PREMIUM UI STYLES --- */
.premium-form-card {
    background: #ffffff;
    border: 1px solid #d2d2d7;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.premium-form-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.field-hint {
    font-size: 0.72rem;
    color: #86868b;
    margin-top: 6px;
    display: block;
    line-height: 1.4;
    font-weight: 500;
}

.text-secondary {
    color: #86868b !important;
}

.card-header-main {
    padding: 0 0 1.5rem 0;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 2rem;
}

.badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge.blue {
    background: rgba(0, 113, 227, 0.1) !important;
    color: #0071e3 !important;
}

.badge.gray {
    background: rgba(134, 134, 139, 0.1) !important;
    color: #86868b !important;
}

.btn-apple-secondary {
    background: #f5f5f7;
    border: none;
    color: #1d1d1f;
    padding: 10px 24px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-apple-secondary:hover {
    background: #e8e8ed;
    transform: translateY(-1px);
}

.btn-apple-secondary:active {
    transform: translateY(0);
}

/* Premium Toast Notifications */
.toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    color: #1d1d1f;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    min-width: 280px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success svg {
    background: #34c759;
    color: white;
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0;
}

.toast.error svg {
    background: #ff3b30;
    color: white;
    border-radius: 50%;
    padding: 4px;
    flex-shrink: 0;
}

.toast span {
    letter-spacing: -0.01em;
}

/* Currency Selector Styles */
.currency-badge {
    background: #000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #fff;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.currency-badge:hover {
    background: #1d1d1f;
}

.currency-dropdown {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    cursor: pointer;
    outline: none;
    padding-right: 4px;
}

.currency-dropdown option {
    background: #1d1d1f;
    color: white;
}

/* Modal Enhancements */
.modal-overlay {
    -webkit-backdrop-filter: blur(12px) !important;
    backdrop-filter: blur(12px) !important;
}

.modal-card {
    border: none !important;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5) !important;
}

.btn-close-modal {
    background: none;
    border: none;
    color: #86868b;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: white;
}

/* User Management Table Refinements */
.premium-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    font-weight: 500;
}

.premium-table tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .top-bar {
        margin-bottom: 1.5rem;
        flex-wrap: wrap;
    }

    .page-title h2 {
        font-size: 1.4rem;
    }

    .page-title p {
        font-size: 0.8rem;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .input-field.full {
        grid-column: span 1 !important;
    }

    .input-field.full.hidden {
        display: none !important;
    }

    .extras-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }

    .extra-subgrid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .fdbordenes-grid {
        grid-template-columns: 1fr !important;
    }

    .fdbordenes-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .fdbordenes-save {
        width: 100%;
    }

    .fdbordenes-work-summary {
        flex-direction: column;
    }

    .fdbordenes-modal-btn {
        width: 100%;
    }

    .ficha-modal-grid {
        grid-template-columns: 1fr;
    }

    .result-pill-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .result-stats {
        align-items: flex-start;
        min-width: 0;
    }

    .stat {
        text-align: left;
    }

    .action-buttons-container {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .result-insights-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        margin-top: -1rem;
    }

    .result-insight-card {
        border-radius: 18px;
    }

    .result-insight-value {
        font-size: 1.55rem;
    }

    .top-actions {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    /* Adjust formula breakdown for narrow screens */
    .breakdown-step {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
        padding: 1rem !important;
    }

    .breakdown-step .step-label {
        width: 100% !important;
        border-right: none !important;
        padding-bottom: 0.5rem !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .breakdown-step code {
        width: 100% !important;
        padding-left: 0 !important;
        font-size: 0.85rem !important;
        word-break: break-all !important;
    }
}
