/* =====================================================================
   Constaweb — Sistema de diseño
   Moderno, luminoso, con acentos en naranja y gris.
   ===================================================================== */

/* Fuentes locales para plantillas de constancia (mismas TTF que usa el
   generador de PDF, para que el editor muestre exactamente lo que saldra). */
@font-face { font-family: 'Montserrat'; font-weight: 400; src: url('../fonts/montserrat-regular.ttf') format('truetype'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; src: url('../fonts/montserrat-bold.ttf') format('truetype'); }
@font-face { font-family: 'Playfair Display'; font-weight: 400; src: url('../fonts/playfair-regular.ttf') format('truetype'); }
@font-face { font-family: 'Playfair Display'; font-weight: 700; src: url('../fonts/playfair-bold.ttf') format('truetype'); }
@font-face { font-family: 'Great Vibes'; font-weight: 400; src: url('../fonts/greatvibes-regular.ttf') format('truetype'); }
@font-face { font-family: 'Cinzel'; font-weight: 400; src: url('../fonts/cinzel-regular.ttf') format('truetype'); }
@font-face { font-family: 'Cinzel'; font-weight: 700; src: url('../fonts/cinzel-bold.ttf') format('truetype'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 400; src: url('../fonts/cormorant-regular.ttf') format('truetype'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 700; src: url('../fonts/cormorant-bold.ttf') format('truetype'); }
@font-face { font-family: 'Lato'; font-weight: 400; src: url('../fonts/lato-regular.ttf') format('truetype'); }
@font-face { font-family: 'Lato'; font-weight: 700; src: url('../fonts/lato-bold.ttf') format('truetype'); }

:root {
    --color-bg: #FAFAF8;
    --color-surface: #FFFFFF;
    --color-surface-muted: #F5F4F1;
    --color-border: #E7E5E0;
    --color-border-strong: #D8D5CE;

    --color-text: #1F1E1C;
    --color-text-muted: #6B6A65;
    --color-text-soft: #918F89;

    --color-accent: #FF6B35;
    --color-accent-dark: #E2551F;
    --color-accent-soft: #FFEBE0;
    --color-accent-softer: #FFF4EE;

    --color-gray-900: #1F1E1C;
    --color-gray-700: #4A4844;
    --color-gray-500: #6B6A65;
    --color-gray-300: #D8D5CE;
    --color-gray-100: #F0EFEB;

    --color-success: #1E8A5F;
    --color-success-bg: #E4F5EC;
    --color-warning: #B8781A;
    --color-warning-bg: #FDF0DD;
    --color-danger: #C4432B;
    --color-danger-bg: #FBE7E2;
    --color-info: #2E6FBB;
    --color-info-bg: #E7F0FC;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 999px;

    --shadow-sm: 0 1px 2px rgba(31, 30, 28, 0.06);
    --shadow-md: 0 8px 24px rgba(31, 30, 28, 0.08);
    --shadow-lg: 0 16px 48px rgba(31, 30, 28, 0.14);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Sora', var(--font-sans);
    --font-size-base: 15px;

    --sidebar-width: 264px;
    --topbar-height: 68px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--color-text);
}

h1 { font-size: 28px; letter-spacing: -0.02em; }
h2 { font-size: 22px; letter-spacing: -0.01em; }
h3 { font-size: 17px; }

p { margin: 0 0 12px; color: var(--color-text-muted); }

a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------------
   Botones
   --------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
    text-decoration: none;
    line-height: 1;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.28);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255, 107, 53, 0.38); }

.btn-dark {
    background: var(--color-gray-900);
    color: #fff;
}
.btn-dark:hover { background: #000; }

.btn-outline {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent-dark); }

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
}
.btn-ghost:hover { background: var(--color-surface-muted); }

.btn-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 4px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 0;
}
.btn-icon-link:hover { color: var(--color-accent-dark); background: var(--color-surface-muted); }

/* ---------------------------------------------------------------------
   Formularios
   --------------------------------------------------------------------- */

.field { margin-bottom: 18px; }

label, .label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-soft);
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6A65' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.help-text { font-size: 12.5px; color: var(--color-text-soft); margin-top: 6px; }
.error-text { font-size: 12.5px; color: var(--color-danger); margin-top: 6px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ---------------------------------------------------------------------
   Tarjetas / superficies
   --------------------------------------------------------------------- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-flush { padding: 0; overflow: hidden; }

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
}
.stat-card .stat-label { font-size: 13px; color: var(--color-text-soft); margin-bottom: 6px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--color-text); }
.stat-card .stat-accent { color: var(--color-accent-dark); }

/* ---------------------------------------------------------------------
   Badges / estados
   --------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12.5px;
    font-weight: 600;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-info    { background: var(--color-info-bg); color: var(--color-info); }
.badge-neutral { background: var(--color-gray-100); color: var(--color-text-muted); }
.badge-accent  { background: var(--color-accent-soft); color: var(--color-accent-dark); }

/* ---------------------------------------------------------------------
   Tablas
   --------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table thead th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-soft);
    background: var(--color-surface-muted);
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}

.data-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--color-surface-muted); }

/* ---------------------------------------------------------------------
   Layout de la aplicacion (sidebar + topbar)
   --------------------------------------------------------------------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 20px;
}

.logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-family: var(--font-display);
}

.sidebar-brand .empresa-nombre { font-weight: 700; font-size: 15px; color: var(--color-text); }
.sidebar-brand .grupo-nombre { font-size: 12px; color: var(--color-text-soft); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.sidebar-nav a:hover { background: var(--color-surface-muted); color: var(--color-text); }

.sidebar-nav a.active {
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
}

.sidebar-nav .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer { border-top: 1px solid var(--color-border); padding-top: 14px; margin-top: 14px; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-content { padding: 28px; flex: 1; }

.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header .eyebrow { font-size: 13px; color: var(--color-text-soft); margin-bottom: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 28px; }

.avatar-chip {
    width: 40px; height: 40px; border-radius: var(--radius-full);
    background: var(--color-accent-soft); color: var(--color-accent-dark);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}

/* ---------------------------------------------------------------------
   Pantallas de autenticacion / publicas (centradas, luminosas)
   --------------------------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 15% 10%, var(--color-accent-softer), transparent 45%),
        radial-gradient(circle at 85% 90%, #F3F1FF, transparent 40%),
        var(--color-bg);
}

.auth-card { width: 100%; max-width: 620px; }
.auth-card .logo-mark { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 20px; }
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-header h1 { margin-bottom: 4px; }

.empresa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }

.empresa-option {
    display: block;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease, box-shadow 0.12s ease;
}

.empresa-option input { display: none; }
.empresa-option .empresa-nombre-op { font-weight: 600; font-size: 14px; color: var(--color-text); }
.empresa-option .empresa-mark { width: 30px; height: 30px; border-radius: 8px; margin: 0 auto 10px; background: var(--color-gray-100); }

.empresa-option.selected {
    border-color: var(--color-accent);
    background: var(--color-accent-softer);
    box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.login-box { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 26px; background: var(--color-surface); }
.login-box .login-title { font-size: 14px; color: var(--color-text-muted); margin-bottom: 18px; }
.login-box .login-title strong { color: var(--color-text); }

.auth-footer-link { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--color-text-soft); }

/* ---------------------------------------------------------------------
   Dropzone (arrastrar y soltar)
   --------------------------------------------------------------------- */

.dropzone {
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-surface-muted);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.dropzone:hover { border-color: var(--color-accent); }

.dropzone.dragover {
    border-color: var(--color-accent);
    background: var(--color-accent-softer);
    transform: scale(1.005);
}

.dropzone .dz-icon {
    width: 44px; height: 44px; margin: 0 auto 14px;
    border-radius: var(--radius-md);
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
    display: flex; align-items: center; justify-content: center;
}

.dropzone .dz-title { font-weight: 600; color: var(--color-text); margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 13px; color: var(--color-text-soft); }
.dropzone .dz-file { font-size: 13.5px; color: var(--color-accent-dark); font-weight: 600; margin-top: 8px; }

.orientation-picker { display: flex; gap: 12px; }

.orientation-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text-soft);
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.orientation-option input { position: absolute; opacity: 0; pointer-events: none; }

.orientation-option:hover { border-color: var(--color-accent); }

.orientation-option.is-selected {
    border-color: var(--color-accent);
    background: var(--color-accent-softer);
    color: var(--color-accent-dark);
}

.orientation-swatch {
    display: block;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    background: currentColor;
    opacity: 0.35;
}

.orientation-swatch-h { width: 34px; height: 24px; }
.orientation-swatch-v { width: 24px; height: 34px; }

.progress-bar {
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-surface-muted);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    transition: width 0.25s ease;
}

/* ---------------------------------------------------------------------
   Editor de plantillas (drag-and-drop de campos sobre imagen)
   --------------------------------------------------------------------- */

.template-editor { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

.template-canvas-wrap {
    position: relative;
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    user-select: none;
}

.template-canvas-wrap img.bg { width: 100%; display: block; pointer-events: none; }

.field-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1.5px dashed var(--color-accent);
    color: var(--color-accent-dark);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    touch-action: none;
}

.field-chip:active { cursor: grabbing; box-shadow: var(--shadow-md); }
.field-chip.dragging { opacity: 0.85; z-index: 20; }
.field-chip.selected { border-style: solid; box-shadow: 0 0 0 3px var(--color-accent-soft); }
.field-chip.selected-secondary { border-style: solid; border-color: var(--color-info); box-shadow: 0 0 0 3px rgba(46, 111, 187, 0.28); }

.field-chip-logo {
    background: transparent;
    border: 1.5px dashed var(--color-accent);
    padding: 4px;
    border-radius: var(--radius-sm);
}
.field-chip-logo img { display: block; width: 60px; height: auto; max-height: 60px; object-fit: contain; }

.field-list { display: flex; flex-direction: column; gap: 10px; }

.field-source {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    cursor: grab;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.field-source:hover { border-color: var(--color-accent); }
.field-source.placed { opacity: 0.5; }
.field-source .drag-dots { color: var(--color-text-soft); }

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
/* La regla "display:flex" de arriba, al ser de autor, le gana al display:none
   implicito que el navegador aplica por el atributo [hidden]; esta regla lo
   restaura explicitamente para que el modal si se oculte de verdad. */
.preview-modal[hidden] { display: none; }

.preview-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 30, 28, 0.6);
}

.preview-modal-panel {
    position: relative;
    width: min(1100px, 100%);
    height: min(760px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
}

.preview-modal-panel iframe {
    flex: 1;
    border: none;
    width: 100%;
}

.preview-modal-loading {
    position: absolute;
    inset: 53px 0 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 14px;
    z-index: 5;
}
.preview-modal-loading[hidden] { display: none; }

.spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--color-accent-soft);
    border-top-color: var(--color-accent);
    animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Certificado / verificacion publica
   --------------------------------------------------------------------- */

.certificate-preview {
    background: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
}

.certificate-preview .cert-eyebrow { letter-spacing: 0.08em; text-transform: uppercase; font-size: 12.5px; color: var(--color-text-soft); }
.certificate-preview .cert-title { font-family: var(--font-display); font-size: 24px; margin: 10px 0 18px; }
.certificate-preview .cert-name { font-size: 30px; font-weight: 700; margin-bottom: 14px; }
.certificate-preview .cert-course { font-weight: 700; font-size: 17px; }

.verify-page { max-width: 560px; margin: 0 auto; padding: 60px 20px; }
.verify-search { display: flex; gap: 10px; margin-bottom: 22px; }
.verify-search .form-control { flex: 1; text-align: center; letter-spacing: 0.04em; font-weight: 600; border-radius: var(--radius-full); }
.verify-search .btn { border-radius: var(--radius-full); }

.verify-result {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-md);
    padding: 32px 28px 28px;
    overflow: hidden;
}

.verify-result::before {
    content: "";
    position: absolute;
    left: 0; top: 0; right: 0;
    height: 5px;
}
.verify-result.valid::before { background: var(--color-accent); }
.verify-result.revoked::before { background: var(--color-gray-500); }

.verify-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}
.verify-logo img {
    display: block;
    max-height: 52px;
    max-width: 200px;
    object-fit: contain;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 10px 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.verify-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 16px 8px 10px;
    border-radius: var(--radius-full);
    color: #fff;
    margin-bottom: 20px;
}
.verify-status.valid { background: var(--color-accent); }
.verify-status.revoked { background: var(--color-gray-700); }
.verify-status .status-dot { width: 24px; height: 24px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.25); color: #fff; }

.verify-detail { display: grid; gap: 14px; }
.verify-detail dt { font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--color-text-soft); }
.verify-detail dd { margin: 3px 0 0; font-weight: 600; font-size: 15.5px; color: var(--color-text); }

/* ---------------------------------------------------------------------
   Instalador
   --------------------------------------------------------------------- */

.install-shell { max-width: 720px; margin: 0 auto; padding: 48px 20px 80px; }

.install-steps { display: flex; gap: 6px; margin-bottom: 32px; }
.install-steps .step-dot { flex: 1; height: 4px; border-radius: 999px; background: var(--color-gray-100); }
.install-steps .step-dot.done { background: var(--color-accent); }
.install-steps .step-dot.current { background: var(--color-accent-dark); }

.requirement-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.requirement-row:last-child { border-bottom: none; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface-muted); }

.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--color-gray-300); border-radius: 999px; transition: background-color .15s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--color-accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ---------------------------------------------------------------------
   Utilidades
   --------------------------------------------------------------------- */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--color-text-muted); }
.text-soft { color: var(--color-text-soft); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-danger { background: var(--color-danger-bg); color: var(--color-danger); border-color: #F2C7BC; }
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: #BEE3D0; }
.alert-info { background: var(--color-info-bg); color: var(--color-info); border-color: #C7DBF5; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-soft); }

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(31, 30, 28, 0.4);
    z-index: 29;
}

@media (max-width: 900px) {
    .menu-toggle { display: flex; }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 30;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: var(--shadow-lg);
    }

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

    .sidebar-backdrop.open { display: block; }

    .template-editor { grid-template-columns: 1fr; }
    .empresa-grid { grid-template-columns: repeat(2, 1fr); }
}
