/* Tipografías incluidas en el sistema (licencia SIL OFL 1.1, ver assets/fonts/app) */
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/app/ibm-plex-sans-latin-400-normal.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/app/ibm-plex-sans-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/app/ibm-plex-sans-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;src:url('../fonts/app/ibm-plex-mono-latin-500-normal.woff2') format('woff2');}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/app/source-serif-4-latin-600-normal.woff2') format('woff2');}
@font-face{font-family:'Source Serif 4';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/app/source-serif-4-latin-700-normal.woff2') format('woff2');}

/* =====================================================================
   Tema visual del sistema jurídico
   Se carga al final, encima de Bootstrap 3 y AdminLTE, sin cambiar el
   funcionamiento de las pantallas. Colores y medidas en variables.
   ===================================================================== */

:root {
    --app-bg: #F6F5F1;
    --app-surface: #FFFFFF;
    --app-ink: #1B1F23;
    --app-ink-2: #3F444A;
    --app-muted: #5B6168;
    --app-line: #E4E1D8;
    --app-line-2: #ECE9E1;
    --app-input-line: #CFCBC0;

    --app-side: #14201C;
    --app-side-2: #22332D;
    --app-side-3: #2B3D36;
    --app-side-text: #C9D3CE;
    --app-side-muted: #9FB0A8;

    --app-primary: #1F5C4A;
    --app-primary-dark: #143D31;
    --app-primary-soft: #E3EFEA;

    --app-danger: #A3261B;
    --app-danger-soft: #FBE4E1;
    --app-warning: #8A4305;
    --app-warning-soft: #FBEFD9;
    --app-info: #1D4E89;
    --app-info-soft: #E2ECF8;

    --app-radius: 10px;
    --app-radius-sm: 8px;
    --app-font: 'IBM Plex Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --app-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --app-mono: 'IBM Plex Mono', Consolas, 'Courier New', monospace;
}

/* ---------- Base ---------- */
body.app-theme,
body.app-theme .content-wrapper,
body.app-theme .right-side,
body.app-theme .wrapper {
    background-color: var(--app-bg);
}
body.app-theme {
    font-family: var(--app-font);
    color: var(--app-ink);
    font-size: 14.5px;
    -webkit-font-smoothing: antialiased;
}
body.app-theme h1, body.app-theme h2, body.app-theme h3,
body.app-theme h4, body.app-theme h5, body.app-theme h6,
body.app-theme .h1, body.app-theme .h2, body.app-theme .h3 {
    font-family: var(--app-font);
    color: var(--app-ink);
}
body.app-theme a { color: var(--app-primary); }
body.app-theme a:hover, body.app-theme a:focus { color: var(--app-primary-dark); }
body.app-theme :focus-visible { outline: 2px solid var(--app-primary); outline-offset: 2px; }

/* ---------- Barra superior ---------- */
body.app-theme .main-header .navbar,
body.app-theme.skin-black .main-header .navbar {
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-line);
    box-shadow: none;
}
body.app-theme .main-header .navbar .nav > li > a,
body.app-theme.skin-black .main-header .navbar .nav > li > a,
body.app-theme.skin-black .main-header .navbar .sidebar-toggle {
    color: var(--app-ink-2);
    border-left: 0 !important;
    border-right: 0 !important;
}
body.app-theme.skin-black .main-header .navbar .nav > li > a:hover,
body.app-theme.skin-black .main-header .navbar .sidebar-toggle:hover,
body.app-theme.skin-black .main-header .navbar .nav .open > a {
    background: var(--app-line-2);
    color: var(--app-ink);
}
body.app-theme .main-header .navbar .nav > li > a > .label {
    font-family: var(--app-font);
    border-radius: 999px;
    padding: 2px 6px;
}
body.app-theme .main-header .logo,
body.app-theme.skin-black .main-header .logo,
body.app-theme.skin-black .main-header .logo:hover {
    background: var(--app-side);
    color: #FFFFFF;
    border-right: 0;
    border-bottom: 0;
    font-family: var(--app-serif);
    font-weight: 700;
    text-align: left;
    padding-left: 18px;
}
body.app-theme .app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    overflow: hidden;
    white-space: nowrap;
}
body.app-theme .app-brand-mark {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: #E8ECE9;
    color: var(--app-side);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 17px;
    line-height: 1;
}
body.app-theme .app-brand-text {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 17px;
    color: #FFFFFF;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.app-theme .main-header .logo .logo-mini .app-brand { justify-content: center; }
body.app-theme .main-header .logo img { max-height: 40px; width: auto; height: auto; }

body.app-theme .main-header .dropdown-menu {
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius-sm);
    box-shadow: 0 8px 24px rgba(20, 32, 28, .12);
}
body.app-theme .main-header .navbar .dropdown-menu > li.header {
    font-weight: 600;
    color: var(--app-ink);
}
body.app-theme .main-header li.user-header,
body.app-theme.skin-black .main-header li.user-header {
    background: var(--app-side);
}

/* ---------- Menú lateral ---------- */
body.app-theme .main-sidebar,
body.app-theme .left-side,
body.app-theme.skin-black .wrapper,
body.app-theme.skin-black .main-sidebar,
body.app-theme.skin-black .left-side {
    background-color: var(--app-side);
}
body.app-theme .main-sidebar { border-right: 0; }
body.app-theme .user-panel {
    padding: 14px 12px;
    border-bottom: 1px solid var(--app-side-3);
}
body.app-theme .user-panel > .image > img {
    width: 38px;
    height: 38px;
    max-width: 38px;
    object-fit: cover;
    border-radius: 50%;
    background: var(--app-side-3);
}
body.app-theme .user-panel > .info,
body.app-theme .user-panel > .info > a,
body.app-theme.skin-black .user-panel > .info,
body.app-theme.skin-black .user-panel > .info > a { color: #E8ECE9; }
body.app-theme .user-panel > .info > p { font-weight: 600; }
body.app-theme .user-panel > .info > a { color: var(--app-side-muted); font-size: 12px; }

body.app-theme .sidebar-menu > li.header,
body.app-theme.skin-black .sidebar-menu > li.header {
    background: transparent;
    color: var(--app-side-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
    font-weight: 600;
    padding: 16px 18px 8px;
}
body.app-theme .sidebar a,
body.app-theme.skin-black .sidebar a,
body.app-theme.skin-black .sidebar-menu > li > a {
    color: var(--app-side-text);
}
body.app-theme.skin-black .sidebar-menu > li > a {
    border-left: 3px solid transparent;
    padding: 11px 15px 11px 15px;
    font-size: 14px;
}
body.app-theme.skin-black .sidebar-menu > li:hover > a,
body.app-theme.skin-black .sidebar-menu > li.active > a,
body.app-theme.skin-black .sidebar-menu > li.menu-open > a {
    color: #FFFFFF;
    background: var(--app-side-2);
    border-left-color: #7FB6A0;
}
body.app-theme.skin-black .sidebar-menu > li > .treeview-menu {
    background: #182722;
    margin: 0;
    padding: 4px 0;
}
body.app-theme.skin-black .treeview-menu > li > a {
    color: var(--app-side-muted);
    padding: 7px 5px 7px 22px;
    font-size: 13.5px;
}
body.app-theme.skin-black .treeview-menu > li.active > a,
body.app-theme.skin-black .treeview-menu > li > a:hover {
    color: #FFFFFF;
}
body.app-theme .sidebar-menu .fa,
body.app-theme .sidebar-menu .glyphicon,
body.app-theme .sidebar-menu .ion { width: 22px; opacity: .9; }
body.app-theme .sidebar-menu .treeview-menu .fa-circle-o { font-size: 8px; vertical-align: middle; margin-right: 4px; }

/* ---------- Encabezado de página ---------- */
body.app-theme .content-header { padding: 22px 22px 6px; }
body.app-theme .content-header > h1 {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 28px;
    letter-spacing: -.01em;
    color: var(--app-ink);
}
body.app-theme .content-header > h1 > small {
    font-family: var(--app-font);
    color: var(--app-muted);
    font-size: 14px;
    font-weight: 400;
}
body.app-theme .content-header > .breadcrumb {
    background: transparent;
    top: 26px;
    font-size: 12.5px;
}
body.app-theme .content-header > .breadcrumb > li > a { color: var(--app-muted); }
body.app-theme .content { padding: 16px 22px 28px; }

/* ---------- Tarjetas (box) ---------- */
body.app-theme .box {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-top: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    box-shadow: none;
    margin-bottom: 22px;
}
body.app-theme .box.box-primary, body.app-theme .box.box-info, body.app-theme .box.box-success,
body.app-theme .box.box-warning, body.app-theme .box.box-danger, body.app-theme .box.box-default {
    border-top-color: var(--app-line);
}
body.app-theme .box.box-solid > .box-header { background: transparent; color: var(--app-ink); }
body.app-theme .box-header { padding: 14px 18px; }
body.app-theme .box-header.with-border { border-bottom: 1px solid var(--app-line-2); }
body.app-theme .box-header .box-title {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 18px;
    color: var(--app-ink);
}
body.app-theme .box-body { padding: 16px 18px; }
body.app-theme .box-footer {
    background: transparent;
    border-top: 1px solid var(--app-line-2);
    border-radius: 0 0 var(--app-radius) var(--app-radius);
    padding: 12px 18px;
}

/* ---------- Indicadores del tablero (small-box) ---------- */
body.app-theme .small-box {
    background: var(--app-surface) !important;
    color: var(--app-ink) !important;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    box-shadow: none;
    overflow: hidden;
}
body.app-theme .small-box > .inner { padding: 16px 18px 10px; }
body.app-theme .small-box h3 {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 32px;
    color: var(--app-ink);
    margin: 0 0 4px;
}
body.app-theme .small-box p { color: var(--app-muted); font-size: 13.5px; }
body.app-theme .small-box .icon {
    color: var(--app-primary);
    opacity: .14;
    top: 6px;
    right: 14px;
    font-size: 60px;
}
body.app-theme .small-box:hover .icon { font-size: 60px; }
body.app-theme .small-box > .small-box-footer {
    background: var(--app-bg) !important;
    color: var(--app-primary) !important;
    border-top: 1px solid var(--app-line-2);
    font-weight: 600;
    font-size: 13px;
    padding: 7px 0;
}
body.app-theme .small-box > .small-box-footer:hover { background: var(--app-primary-soft) !important; }
body.app-theme .small-box.bg-red h3, body.app-theme .small-box.bg-maroon h3 { color: var(--app-danger); }
body.app-theme .small-box.bg-yellow h3, body.app-theme .small-box.bg-orange h3 { color: var(--app-warning); }

/* ---------- Botones ---------- */
body.app-theme .btn {
    border-radius: var(--app-radius-sm);
    font-weight: 600;
    font-size: 13.5px;
    padding: 7px 14px;
    box-shadow: none;
    transition: background-color .15s, border-color .15s, color .15s;
}
body.app-theme .btn-sm, body.app-theme .btn-group-sm > .btn { padding: 5px 10px; font-size: 12.5px; }
body.app-theme .btn-xs, body.app-theme .btn-group-xs > .btn { padding: 2px 8px; font-size: 12px; }
body.app-theme .btn-lg { padding: 10px 18px; font-size: 15px; }
body.app-theme .btn-flat { border-radius: var(--app-radius-sm); }
body.app-theme .btn-primary,
body.app-theme .btn-success,
body.app-theme .bg-olive.btn {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #FFFFFF;
}
body.app-theme .btn-primary:hover, body.app-theme .btn-primary:focus, body.app-theme .btn-primary:active,
body.app-theme .btn-success:hover, body.app-theme .btn-success:focus, body.app-theme .btn-success:active {
    background: var(--app-primary-dark);
    border-color: var(--app-primary-dark);
    color: #FFFFFF;
}
body.app-theme .btn-default {
    background: var(--app-surface);
    border-color: var(--app-input-line);
    color: var(--app-ink);
}
body.app-theme .btn-default:hover, body.app-theme .btn-default:focus {
    background: var(--app-line-2);
    border-color: var(--app-input-line);
    color: var(--app-ink);
}
body.app-theme .btn-danger {
    background: var(--app-surface);
    border-color: #E3B5AF;
    color: var(--app-danger);
}
body.app-theme .btn-danger:hover, body.app-theme .btn-danger:focus {
    background: var(--app-danger);
    border-color: var(--app-danger);
    color: #FFFFFF;
}
body.app-theme .btn-info {
    background: var(--app-info);
    border-color: var(--app-info);
    color: #FFFFFF;
}
body.app-theme .btn-warning {
    background: var(--app-warning-soft);
    border-color: #E9C98F;
    color: var(--app-warning);
}
body.app-theme .btn-warning:hover { background: #F5E0B8; color: var(--app-warning); }

/* ---------- Formularios ---------- */
body.app-theme .form-control {
    border: 1px solid var(--app-input-line);
    border-radius: var(--app-radius-sm);
    box-shadow: none;
    height: 38px;
    padding: 7px 11px;
    color: var(--app-ink);
    font-size: 14px;
}
body.app-theme textarea.form-control { height: auto; }
body.app-theme select.form-control[multiple] { height: auto; }
body.app-theme .form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(31, 92, 74, .15);
}
body.app-theme label { font-weight: 600; color: var(--app-ink-2); font-size: 13.5px; }
body.app-theme .input-group-addon {
    border-color: var(--app-input-line);
    background: var(--app-bg);
    color: var(--app-muted);
}
body.app-theme .has-error .form-control { border-color: var(--app-danger); }
body.app-theme .text-danger { color: var(--app-danger); }
body.app-theme .text-muted { color: var(--app-muted); }

/* ---------- Tablas ---------- */
body.app-theme .table {
    color: var(--app-ink);
    font-size: 14px;
}
body.app-theme .table > thead > tr > th {
    background: var(--app-bg);
    color: var(--app-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    border-bottom: 1px solid var(--app-line) !important;
    padding: 10px 12px;
    white-space: nowrap;
}
body.app-theme .table > tbody > tr > td {
    border-top: 1px solid var(--app-line-2);
    padding: 10px 12px;
    vertical-align: middle;
}
body.app-theme .table-bordered,
body.app-theme .table-bordered > thead > tr > th,
body.app-theme .table-bordered > tbody > tr > td {
    border-color: var(--app-line-2);
}
body.app-theme .table-striped > tbody > tr:nth-of-type(odd) { background-color: #FBFAF7; }
body.app-theme .table-hover > tbody > tr:hover { background-color: var(--app-primary-soft); }

body.app-theme .dataTables_wrapper .dataTables_filter input,
body.app-theme .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--app-input-line);
    border-radius: var(--app-radius-sm);
    padding: 5px 9px;
    margin-left: 6px;
}
body.app-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--app-radius-sm) !important;
}
body.app-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.app-theme .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: #FFFFFF !important;
}

/* ---------- Paginación ---------- */
body.app-theme .pagination > li > a,
body.app-theme .pagination > li > span {
    color: var(--app-primary);
    border-color: var(--app-line);
}
body.app-theme .pagination > .active > a,
body.app-theme .pagination > .active > a:hover,
body.app-theme .pagination > .active > span {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #FFFFFF;
}

/* ---------- Etiquetas de estado ---------- */
body.app-theme .label {
    border-radius: 999px;
    font-weight: 600;
    font-size: 11.5px;
    padding: 3px 9px;
}
body.app-theme .label-success, body.app-theme .label.bg-green, body.app-theme .badge.bg-green { background-color: var(--app-primary-soft) !important; color: var(--app-primary) !important; }
body.app-theme .label-danger { background-color: var(--app-danger-soft) !important; color: var(--app-danger) !important; }
body.app-theme .label-warning { background-color: var(--app-warning-soft) !important; color: var(--app-warning) !important; }
body.app-theme .label-info, body.app-theme .label-primary { background-color: var(--app-info-soft) !important; color: var(--app-info) !important; }
body.app-theme .label-default { background-color: var(--app-line-2) !important; color: var(--app-ink-2) !important; }
body.app-theme .badge.bg-red, body.app-theme .label.bg-red { background: var(--app-danger) !important; color: #FFFFFF !important; }

/* ---------- Avisos ---------- */
body.app-theme .alert {
    border-radius: var(--app-radius-sm);
    border: 1px solid transparent;
    font-size: 14px;
}
body.app-theme .alert-danger, body.app-theme .alert-error {
    background: var(--app-danger-soft) !important;
    border-color: #F1C3BD !important;
    color: var(--app-danger) !important;
}
body.app-theme .alert-info {
    background: var(--app-info-soft) !important;
    border-color: #C5D8EF !important;
    color: var(--app-info) !important;
}
body.app-theme .alert-success {
    background: var(--app-primary-soft) !important;
    border-color: #C2DCD1 !important;
    color: var(--app-primary) !important;
}
body.app-theme .alert-warning {
    background: var(--app-warning-soft) !important;
    border-color: #EED5A6 !important;
    color: var(--app-warning) !important;
}
body.app-theme .alert .close { color: inherit; opacity: .6; }

/* ---------- Ventanas emergentes ---------- */
body.app-theme .modal-content {
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: 0 18px 50px rgba(20, 32, 28, .25);
}
body.app-theme .modal-header { border-bottom: 1px solid var(--app-line-2); padding: 14px 18px; }
body.app-theme .modal-title { font-family: var(--app-serif); font-weight: 700; }
body.app-theme .modal-footer { border-top: 1px solid var(--app-line-2); }

/* ---------- Listas del tablero ---------- */
body.app-theme .todo-list > li {
    background: var(--app-bg);
    border-left: 0;
    border-radius: var(--app-radius-sm);
    color: var(--app-ink);
    padding: 10px 12px;
}
body.app-theme .external-event { border-radius: var(--app-radius-sm); font-weight: 600; }

/* ---------- Calendario ---------- */
body.app-theme .fc-header-title h2 { font-family: var(--app-serif); font-size: 20px; font-weight: 700; }
body.app-theme .fc-button,
body.app-theme .fc-state-default {
    background: var(--app-surface);
    background-image: none;
    border: 1px solid var(--app-input-line);
    color: var(--app-ink);
    text-shadow: none;
    box-shadow: none;
    border-radius: var(--app-radius-sm);
}
body.app-theme .fc-state-active, body.app-theme .fc-state-down {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: #FFFFFF;
}
body.app-theme .fc-state-highlight { background: var(--app-primary-soft); }
body.app-theme .fc-widget-header, body.app-theme .fc-widget-content { border-color: var(--app-line-2); }

/* ---------- Pie ---------- */
body.app-theme .main-footer {
    background: var(--app-surface);
    border-top: 1px solid var(--app-line);
    color: var(--app-muted);
    font-size: 13px;
}

/* ---------- Encabezado del tablero ---------- */
body.app-theme .app-today {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 22px 0;
}
body.app-theme .app-today-date {
    display: block;
    font-size: 12px;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
    margin-bottom: 4px;
}
body.app-theme .app-today h1 {
    margin: 0;
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 30px;
    line-height: 1.15;
}

/* ---------- Números de expediente y folios ---------- */
body.app-theme .app-mono, body.app-theme .app-mono * { font-family: var(--app-mono); }

/* ---------- Celular ---------- */
@media (max-width: 767px) {
    body.app-theme .content-header { padding: 16px 14px 4px; }
    body.app-theme .content-header > .breadcrumb { position: static; padding-left: 0; margin-top: 4px; }
    body.app-theme .content { padding: 12px 12px 22px; }
    body.app-theme .app-today { padding: 16px 14px 0; }
    body.app-theme .app-today h1 { font-size: 24px; }
    body.app-theme .box-header, body.app-theme .box-body { padding-left: 14px; padding-right: 14px; }
    body.app-theme .table-responsive { border: 0; }
}

/* =====================================================================
   Pantallas de acceso (inicio de sesión, recuperación, registro)
   ===================================================================== */
body.app-auth {
    margin: 0;
    min-height: 100vh;
    background: var(--app-bg);
    font-family: var(--app-font);
    color: var(--app-ink);
    -webkit-font-smoothing: antialiased;
}
.app-auth-wrap {
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    align-content: stretch;
}
.app-auth-side {
    flex: 1 1 420px;
    background: var(--app-side);
    color: #E8ECE9;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    box-sizing: border-box;
}
.app-auth-brand { display: flex; align-items: center; gap: 12px; }
.app-auth-brand .app-brand-mark {
    width: 40px; height: 40px; border-radius: 9px;
    background: #E8ECE9; color: var(--app-side);
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--app-serif); font-weight: 700; font-size: 22px;
}
.app-auth-brand span {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 21px;
    color: #FFFFFF;
}
.app-auth-pitch h1 {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 38px;
    line-height: 1.15;
    color: #FFFFFF;
    margin: 0 0 16px;
    max-width: 520px;
}
.app-auth-pitch p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--app-side-text);
    max-width: 460px;
    margin: 0;
}
.app-auth-points {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.app-auth-points li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #DDE5E1;
    font-size: 15px;
}
.app-auth-points li::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7FB6A0;
    margin-top: 7px;
}
.app-auth-foot { font-size: 12.5px; color: var(--app-side-muted); }
.app-auth-main {
    flex: 1 1 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    box-sizing: border-box;
}
.app-auth-card {
    width: 100%;
    max-width: 400px;
}
.app-auth-logo { margin-bottom: 22px; }
.app-auth-logo img { max-width: 200px; max-height: 70px; width: auto; height: auto; }
.app-auth-card h2 {
    font-family: var(--app-serif);
    font-weight: 700;
    font-size: 28px;
    margin: 0 0 6px;
    color: var(--app-ink);
}
.app-auth-card .app-auth-sub { color: var(--app-muted); margin: 0 0 26px; font-size: 14.5px; }
.app-auth-card .form-group { margin-bottom: 16px; }
.app-auth-card label {
    display: block;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--app-ink-2);
    margin-bottom: 6px;
}
.app-auth-card .form-control {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 46px;
    border: 1px solid var(--app-input-line);
    border-radius: var(--app-radius-sm);
    padding: 10px 14px;
    font-size: 15px;
    font-family: var(--app-font);
    color: var(--app-ink);
    background: #FFFFFF;
    box-shadow: none;
}
.app-auth-card .form-control:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(31, 92, 74, .15);
}
.app-auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 4px 0 22px;
    font-size: 14px;
}
.app-auth-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 500 !important;
    cursor: pointer;
    margin: 0 !important;
    min-height: 32px;
}
.app-auth-check input { width: 17px; height: 17px; accent-color: var(--app-primary); margin: 0; }
.app-auth-card a { color: var(--app-primary); font-weight: 600; text-decoration: none; }
.app-auth-card a:hover { color: var(--app-primary-dark); text-decoration: underline; }
.app-auth-btn {
    display: block;
    width: 100%;
    height: 46px;
    border: 0;
    border-radius: var(--app-radius-sm);
    background: var(--app-primary);
    color: #FFFFFF;
    font-family: var(--app-font);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.app-auth-btn:hover, .app-auth-btn:focus { background: var(--app-primary-dark); }
.app-auth-card .alert {
    border-radius: var(--app-radius-sm);
    padding: 11px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}
.app-auth-card .alert-danger { background: var(--app-danger-soft); border-color: #F1C3BD; color: var(--app-danger); }
.app-auth-card .alert-info, .app-auth-card .alert-success { background: var(--app-primary-soft); border-color: #C2DCD1; color: var(--app-primary); }
.app-auth-back { margin-top: 22px; font-size: 14px; }
@media (max-width: 860px) {
    .app-auth-wrap { align-content: flex-start; }
    .app-auth-side { padding: 28px 24px; gap: 18px; flex-basis: 100%; justify-content: flex-start; }
    .app-auth-pitch h1 { font-size: 26px; }
    .app-auth-pitch p, .app-auth-points, .app-auth-foot { display: none; }
    .app-auth-main { padding: 28px 18px 40px; }
}

/* ---------- Botones "Agregar" junto a campos ---------- */
body.app-theme .add-btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--app-input-line);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    color: var(--app-primary);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
}
body.app-theme .add-btn:hover { background: var(--app-primary-soft); color: var(--app-primary-dark); text-decoration: none; }

/* ---------- Listas de selección (Chosen / Select2) ---------- */
body.app-theme .chosen-container-single .chosen-single,
body.app-theme .chosen-container-multi .chosen-choices {
    min-height: 38px;
    border: 1px solid var(--app-input-line);
    border-radius: var(--app-radius-sm);
    background: var(--app-surface);
    box-shadow: none;
    padding-top: 4px;
}
body.app-theme .chosen-container-single .chosen-single { height: 38px; line-height: 28px; }
body.app-theme .chosen-container-active .chosen-single,
body.app-theme .chosen-container-active .chosen-choices {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(31, 92, 74, .15);
}
body.app-theme .chosen-container .chosen-results li.highlighted { background: var(--app-primary); background-image: none; }
body.app-theme .select2-container--default .select2-selection--single,
body.app-theme .select2-container--default .select2-selection--multiple {
    border-color: var(--app-input-line);
    border-radius: var(--app-radius-sm);
    min-height: 38px;
}

/* ---------- Indicadores en dos columnas en el celular ---------- */
@media (max-width: 767px) {
    body.app-theme .row > .col-xs-12:has(> .small-box) { width: 50%; }
    body.app-theme .small-box h3 { font-size: 26px; }
    body.app-theme .small-box .icon { display: none; }
    body.app-theme .small-box > .inner { text-align: left; padding: 12px 14px 8px; }
}

/* =====================================================================
   Etapa 4 — Expediente (resumen, actuaciones, partes, equipo)
   ===================================================================== */
.app-theme .exp-summary {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start;
    padding: 4px 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--app-line);
}
.app-theme .exp-summary-main { flex: 1 1 420px; min-width: 0; }
.app-theme .exp-kicker { font-family: var(--app-mono); font-size: 12px; color: var(--app-muted); letter-spacing: .02em; }
.app-theme .exp-title { font-family: var(--app-serif); font-size: 22px; font-weight: 600; margin: 4px 0 8px; color: var(--app-ink); }
.app-theme .exp-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--app-ink-2); margin-top: 4px; }
.app-theme .exp-meta b { color: var(--app-muted); font-weight: 500; }
.app-theme .exp-summary-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.app-theme .exp-sections .box-header .box-tools { position: absolute; right: 10px; top: 7px; }
.app-theme .exp-empty { margin: 6px 0; }
.app-theme .exp-filter { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.app-theme .exp-filter .btn.active { background: var(--app-primary); border-color: var(--app-primary); color: #fff; }

.app-theme .exp-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.app-theme .exp-timeline:before { content: ""; position: absolute; left: 15px; top: 4px; bottom: 4px; width: 2px; background: var(--app-line); }
.app-theme .exp-tl-item { position: relative; padding: 0 0 18px 46px; }
.app-theme .exp-tl-icon {
    position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
    box-shadow: 0 0 0 3px var(--app-surface);
}
.app-theme .exp-tl-body { background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 10px 12px; }
.app-theme .exp-tl-item.is-future .exp-tl-body { border-style: dashed; background: var(--app-warning-soft); }
.app-theme .exp-tl-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; }
.app-theme .exp-tl-date { font-family: var(--app-mono); color: var(--app-muted); }
.app-theme .exp-tl-type { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.app-theme .exp-tl-title { font-weight: 600; margin-top: 4px; color: var(--app-ink); }
.app-theme .exp-tl-text { margin-top: 4px; color: var(--app-ink-2); font-size: 13px; }
.app-theme .exp-tl-foot { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--app-muted); }

.app-theme .exp-party { padding: 10px 0; border-bottom: 1px solid var(--app-line-2); }
.app-theme .exp-party:last-child { border-bottom: 0; }
.app-theme .exp-party-head { display: flex; gap: 8px; align-items: center; }
.app-theme .exp-party-role { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--app-primary); }
.app-theme .exp-party-name { font-weight: 600; margin-top: 2px; }
.app-theme .exp-party-data { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--app-ink-2); margin-top: 2px; }
.app-theme .exp-party-notes { font-size: 12.5px; color: var(--app-muted); margin-top: 4px; }
.app-theme .exp-party-actions { display: flex; gap: 14px; font-size: 12px; margin-top: 6px; }

.app-theme .exp-team-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--app-line-2); font-size: 13px; }
.app-theme .exp-team-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.app-theme .exp-team-form select { flex: 1 1 140px; width: auto; }

@media (max-width: 767px) {
    .app-theme .exp-title { font-size: 19px; }
    .app-theme .exp-sections .box-header .box-tools { position: static; margin-top: 8px; }
}

/* =====================================================================
   Etapa 5 — Plazos (semáforo), agenda y días inhábiles
   ===================================================================== */
.app-theme .dl-item { border: 1px solid var(--app-line); border-left: 4px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 9px 11px; margin-bottom: 10px; background: var(--app-surface); }
.app-theme .dl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; }
.app-theme .dl-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--app-line-2); color: var(--app-ink-2); }
.app-theme .dl-due { font-family: var(--app-mono); font-size: 12px; color: var(--app-ink-2); }
.app-theme .dl-title { font-weight: 600; margin-top: 4px; }
.app-theme .dl-meta { font-size: 12px; color: var(--app-muted); margin-top: 2px; }
.app-theme .dl-notes { font-size: 12.5px; color: var(--app-ink-2); margin-top: 4px; }
.app-theme .dl-overdue { border-left-color: #6E1A12; background: #FBE4E1; }
.app-theme .dl-overdue .dl-badge { background: #6E1A12; color: #fff; }
.app-theme .dl-today { border-left-color: var(--app-danger); }
.app-theme .dl-today .dl-badge { background: var(--app-danger); color: #fff; }
.app-theme .dl-soon { border-left-color: #C27803; }
.app-theme .dl-soon .dl-badge { background: var(--app-warning-soft); color: var(--app-warning); }
.app-theme .dl-ok { border-left-color: var(--app-primary); }
.app-theme .dl-ok .dl-badge { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.app-theme .dl-done { opacity: .72; }
.app-theme .dl-done .dl-title { text-decoration: line-through; }
.app-theme .dl-calc { padding: 9px 11px; border-radius: var(--app-radius-sm); background: var(--app-bg); border: 1px dashed var(--app-input-line); font-size: 13px; color: var(--app-muted); margin-bottom: 12px; }
.app-theme .dl-calc.is-ok { border-style: solid; border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); }
.app-theme .dl-gen { border-top: 1px solid var(--app-line); padding-top: 10px; margin-top: 4px; }
.app-theme .dl-gen-toggle { font-weight: 600; cursor: pointer; display: block; margin-bottom: 10px; }
.app-theme .dl-gen-toggle input { margin-right: 6px; }

.app-theme .dl-table td { vertical-align: middle !important; }
.app-theme .dl-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.app-theme .dl-pill.dl-overdue { background: #6E1A12; color: #fff; }
.app-theme .dl-pill.dl-today { background: var(--app-danger); color: #fff; }
.app-theme .dl-pill.dl-soon { background: var(--app-warning-soft); color: var(--app-warning); }
.app-theme .dl-pill.dl-ok { background: var(--app-primary-soft); color: var(--app-primary-dark); }
.app-theme .dl-pill.dl-done { background: var(--app-line-2); color: var(--app-muted); }

.app-theme .dl-widget-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--app-line-2); }
.app-theme .dl-widget-row:last-child { border-bottom: 0; }
.app-theme .dl-widget-row .dl-pill { flex: 0 0 auto; margin-top: 2px; }
.app-theme .dl-widget-row a { font-weight: 600; color: var(--app-ink); }
.app-theme .dl-widget-row small { display: block; color: var(--app-muted); }

.app-theme .agenda-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--app-ink-2); margin-bottom: 10px; }
.app-theme .agenda-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.app-theme .agenda-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.app-theme .agenda-filters select { width: auto; min-width: 200px; }
.app-theme #agenda-calendar .fc-event { border-radius: 4px; font-size: 11.5px; padding: 1px 3px; }
.app-theme .nwd-year { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.app-theme .nwd-local { font-size: 11px; color: var(--app-muted); }

/* =====================================================================
   Etapa 6 — Notarial
   ===================================================================== */
.app-theme .nt-tabs { margin-bottom: 14px; border-bottom-color: var(--app-line); }
.app-theme .nt-tabs > li > a { color: var(--app-ink-2); border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0; }
.app-theme .nt-tabs > li.active > a, .app-theme .nt-tabs > li.active > a:hover { color: var(--app-primary-dark); font-weight: 600; background: var(--app-surface); border-color: var(--app-line) var(--app-line) transparent; }
.app-theme .nt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.app-theme .nt-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.app-theme .nt-picker select { width: auto; min-width: 110px; }
.app-theme .nt-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.app-theme .nt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.app-theme .nt-stats > div { border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 10px 12px; background: var(--app-bg); }
.app-theme .nt-stats span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--app-muted); }
.app-theme .nt-stats strong { display: block; font-family: var(--app-serif); font-size: 20px; color: var(--app-ink); margin-top: 2px; }
.app-theme .nt-stats small { display: block; color: var(--app-muted); font-size: 12px; }
.app-theme .nt-table tr.nt-cancelled td { color: var(--app-muted); }
.app-theme .nt-table tr.nt-cancelled td a { text-decoration: line-through; }
.app-theme .nt-quarter { padding: 9px 0; border-bottom: 1px solid var(--app-line-2); }
.app-theme .nt-quarter:last-child { border-bottom: 0; }
.app-theme .nt-quarter-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.app-theme .nt-quarter-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 6px; font-size: 12.5px; }
.app-theme .nt-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.app-theme .nt-inline .form-control { width: auto; max-width: 160px; }
.app-theme .nt-detail th { width: 30%; color: var(--app-muted); font-weight: 500; }
.app-theme .nt-form-row { border-top: 1px solid var(--app-line); padding-top: 10px; margin-top: 4px; }

/* =====================================================================
   Etapa 7 — Gestor documental y plantillas
   ===================================================================== */
.app-theme .dm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }
.app-theme .dm-picker { flex: 1 1 320px; max-width: 520px; margin: 0; }
.app-theme .dm-search { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; flex: 1 1 380px; justify-content: flex-end; }
.app-theme .dm-search input[type="search"] { flex: 1 1 200px; width: auto; max-width: 320px; }
.app-theme .dm-search select { width: auto; }
.app-theme .dm-storage { margin-top: 12px; font-size: 12.5px; color: var(--app-muted); }
.app-theme .dm-storage strong { color: var(--app-ink); }
.app-theme .dm-storage-bar { height: 6px; border-radius: 999px; background: var(--app-line-2); overflow: hidden; margin-top: 6px; }
.app-theme .dm-storage-bar span { display: block; height: 100%; background: var(--app-primary); }
.app-theme .dm-storage-warning .dm-storage-bar span { background: #C27803; }
.app-theme .dm-storage-danger .dm-storage-bar span { background: var(--app-danger); }
.app-theme .dm-storage-danger .dm-storage-text { color: var(--app-danger); }

.app-theme .dm-tree { padding: 6px 0; }
.app-theme .dm-tree-item { display: flex; align-items: center; gap: 7px; padding: 6px 10px; color: var(--app-ink-2); border-left: 3px solid transparent; font-size: 13.5px; }
.app-theme .dm-tree-item:hover { background: var(--app-bg); color: var(--app-ink); text-decoration: none; }
.app-theme .dm-tree-item.active { background: var(--app-primary-soft); color: var(--app-primary-dark); border-left-color: var(--app-primary); font-weight: 600; }
.app-theme .dm-tree-item .fa { color: var(--app-primary); width: 15px; text-align: center; }
.app-theme .dm-count { margin-left: auto; font-size: 11px; background: var(--app-line-2); color: var(--app-muted); border-radius: 999px; padding: 0 7px; font-weight: 600; }

.app-theme .dm-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.app-theme .dm-tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--app-info-soft); color: var(--app-info); }
.app-theme .dm-tag:hover, .app-theme .dm-tag.active { background: var(--app-info); color: #fff; text-decoration: none; }
.app-theme .dm-tag span { opacity: .7; margin-left: 2px; }
.app-theme .dm-tag-cloud { gap: 6px; display: flex; }

.app-theme .dm-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.app-theme .dm-head-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.app-theme .dm-crumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; }
.app-theme .dm-crumbs li + li:before { content: '/'; color: var(--app-muted); margin-right: 4px; }
.app-theme .dm-file-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; }

.app-theme .dm-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.app-theme .dm-folder { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 10px 12px; background: var(--app-bg); color: var(--app-ink); }
.app-theme .dm-folder:hover { border-color: var(--app-primary); text-decoration: none; background: var(--app-primary-soft); }
.app-theme .dm-folder .fa { color: #C9A227; font-size: 20px; }
.app-theme .dm-folder span { font-weight: 600; line-height: 1.25; }
.app-theme .dm-folder small { color: var(--app-muted); }

.app-theme .dm-table td { vertical-align: middle !important; }
.app-theme .dm-file-cell { display: flex; gap: 10px; align-items: flex-start; min-width: 240px; }
.app-theme .dm-file-cell small { display: block; }
.app-theme .dm-file-icon { font-size: 22px; color: var(--app-primary); margin-top: 2px; width: 22px; text-align: center; }
.app-theme .fa-file-pdf-o.dm-file-icon { color: #B42318; }
.app-theme .fa-file-word-o.dm-file-icon { color: #1D4E89; }
.app-theme .fa-file-excel-o.dm-file-icon { color: #1F7A3E; }
.app-theme .dm-file-title { font-weight: 600; color: var(--app-ink); }
.app-theme .dm-loc { color: var(--app-ink-2); }
.app-theme .dm-type { display: inline-block; font-size: 12px; border-left: 4px solid; padding-left: 6px; }
.app-theme .dm-ver { font-family: var(--app-mono); font-size: 12px; background: var(--app-line-2); border-radius: 6px; padding: 1px 6px; }
.app-theme .dm-actions .btn { margin-left: 2px; }
.app-theme .dm-empty { text-align: center; padding: 26px 10px !important; color: var(--app-muted); }
.app-theme .dm-empty .fa { font-size: 30px; opacity: .5; }
.app-theme .dm-empty p { margin: 8px 0 0; }
.app-theme .dm-hint { margin: 0; }

.app-theme .dm-frame { width: 100%; height: 72vh; min-height: 420px; border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); background: #fff; }
.app-theme .dm-image { text-align: center; background: var(--app-bg); border-radius: var(--app-radius-sm); padding: 10px; }
.app-theme .dm-image img, .app-theme .dm-preview-img { max-width: 100%; max-height: 72vh; }
.app-theme .dm-preview-body { text-align: center; }

.app-theme .dm-docx { background: var(--app-bg); border-radius: var(--app-radius-sm); padding: 18px; max-height: 76vh; overflow: auto; }
.app-theme .dm-docx-page, .app-theme .tp-page { background: #fff; color: #000; max-width: 720px; margin: 0 auto; padding: 48px 56px; box-shadow: 0 1px 4px rgba(0,0,0,.12); font-family: 'Times New Roman', Times, serif; font-size: 15px; line-height: 1.45; text-align: left; }
.app-theme .dm-docx-page p, .app-theme .tp-page p { margin: 0 0 9px; }
.app-theme .dm-docx-page h1, .app-theme .tp-page h1 { font-size: 19px; font-weight: bold; margin: 0 0 14px; font-family: inherit; text-align: center; }
.app-theme .dm-docx-page h2, .app-theme .tp-page h2 { font-size: 16px; font-weight: bold; margin: 12px 0 8px; font-family: inherit; }
.app-theme .dm-docx-page h3, .app-theme .tp-page h3 { font-size: 15px; font-weight: bold; font-style: italic; margin: 10px 0 8px; font-family: inherit; }
.app-theme .dm-docx-page table, .app-theme .tp-page table { width: 100%; border-collapse: collapse; margin: 0 0 9px; }
.app-theme .dm-docx-page td, .app-theme .tp-page td, .app-theme .tp-page th { vertical-align: top; padding: 3px 5px; }
.app-theme .dm-docx-page .dx-bordered td { border: 1px solid #000; }

.app-theme .dm-versions { padding-top: 4px; }
.app-theme .dm-version { padding: 9px 0; border-bottom: 1px solid var(--app-line-2); }
.app-theme .dm-version:last-child { border-bottom: 0; }
.app-theme .dm-version.is-current strong { color: var(--app-primary-dark); }
.app-theme .dm-version-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.app-theme .dm-version-head .text-muted { margin-left: auto; }
.app-theme .dm-version-note { font-size: 12.5px; color: var(--app-ink-2); margin-top: 3px; }
.app-theme .dm-version-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 5px; font-size: 12.5px; }
.app-theme .dm-meta { margin: 12px 0 0; }

.app-theme .dm-case-docs .dm-file-cell { min-width: 0; }

/* Plantillas */
.app-theme .tp-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.app-theme .tp-filters .btn.active { background: var(--app-primary); color: #fff; border-color: var(--app-primary); }
.app-theme .tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.app-theme .tp-card { border: 1px solid var(--app-line); border-radius: var(--app-radius); background: var(--app-surface); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.app-theme .tp-card.is-off { opacity: .6; }
.app-theme .tp-card-cat { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--app-primary); }
.app-theme .tp-card h4 { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.3; }
.app-theme .tp-card p { margin: 0; font-size: 13px; color: var(--app-ink-2); }
.app-theme .tp-card-meta { font-size: 12px; color: var(--app-muted); margin-top: auto; }
.app-theme .tp-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.app-theme .tp-editor { border: 1px solid var(--app-input-line); border-radius: var(--app-radius-sm); background: var(--app-bg); }
.app-theme .tp-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--app-line); background: var(--app-surface); border-radius: var(--app-radius-sm) var(--app-radius-sm) 0 0; position: sticky; top: 0; z-index: 2; }
.app-theme .tp-tools .btn { min-width: 32px; }
.app-theme .tp-tools .tp-sep { width: 1px; background: var(--app-line); margin: 2px 4px; }
.app-theme .tp-area { min-height: 480px; max-height: 70vh; overflow: auto; padding: 18px; }
.app-theme .tp-area .tp-page { min-height: 440px; outline: none; }
.app-theme .tp-area .tp-page:focus { box-shadow: 0 0 0 2px var(--app-primary-soft), 0 1px 4px rgba(0,0,0,.12); }
.app-theme .tp-var { background: #FFF4C2; border-radius: 3px; padding: 0 2px; }
.app-theme .tp-var-missing { background: #FBE4E1; color: var(--app-danger); border-radius: 3px; padding: 0 2px; }
.app-theme .tp-vars { max-height: 70vh; overflow: auto; }
.app-theme .tp-vars h5 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--app-muted); margin: 12px 0 4px; }
.app-theme .tp-vars h5:first-child { margin-top: 0; }
.app-theme .tp-vars a { display: block; padding: 3px 6px; border-radius: 6px; font-size: 12.5px; color: var(--app-ink); }
.app-theme .tp-vars a:hover { background: var(--app-primary-soft); text-decoration: none; }
.app-theme .tp-vars code { font-family: var(--app-mono); font-size: 11.5px; color: var(--app-primary-dark); background: none; padding: 0; }
.app-theme .tp-fields .form-group { margin-bottom: 10px; }
.app-theme .tp-fields label { font-size: 12.5px; margin-bottom: 3px; }
.app-theme .tp-fields label code { font-family: var(--app-mono); font-size: 11px; color: var(--app-muted); background: none; padding: 0; margin-left: 4px; font-weight: 400; }
.app-theme .tp-fields .is-empty { border-color: #E3A008; background: #FFFBEB; }
.app-theme .tp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.app-theme .tp-preview { background: var(--app-bg); border-radius: var(--app-radius-sm); padding: 18px; max-height: 80vh; overflow: auto; }
.app-theme .tp-src-tabs { margin-bottom: 12px; }
.app-theme .dm-head:before, .app-theme .dm-head:after, .app-theme .dm-file-top:before, .app-theme .dm-file-top:after { display: none; }

/* =====================================================================
   Etapa 8 — Clientes y portal del cliente
   ===================================================================== */
.app-theme .cl-table td { vertical-align: middle !important; }
.app-theme .cl-name { font-weight: 600; color: var(--app-ink); }
.app-theme .cl-table small { display: block; }
.app-theme .cl-type { font-size: 12px; color: var(--app-ink-2); white-space: nowrap; }
.app-theme .cl-type.is-jur { color: var(--app-info); }
.app-theme .cl-type-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.app-theme .cl-type-opt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--app-input-line); border-radius: var(--app-radius-sm); padding: 9px 14px; cursor: pointer; font-weight: 500; margin: 0; background: var(--app-surface); }
.app-theme .cl-type-opt input { margin: 0; }
.app-theme .cl-type-opt.active { border-color: var(--app-primary); background: var(--app-primary-soft); color: var(--app-primary-dark); }
.app-theme .cl-form-actions { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; }
.app-theme .cl-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.app-theme .cl-head-id { display: flex; gap: 12px; align-items: center; }
.app-theme .cl-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--app-primary-soft); color: var(--app-primary-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 auto; }
.app-theme .cl-head-name { font-family: var(--app-serif); font-size: 21px; font-weight: 700; color: var(--app-ink); line-height: 1.2; }
.app-theme .cl-head-name small { font-family: var(--app-font); font-size: 14px; color: var(--app-muted); font-weight: 400; }
.app-theme .cl-head-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--app-ink-2); margin-top: 3px; }

.app-theme .exp-tl-visible { font-size: 11px; font-weight: 600; color: var(--app-info); white-space: nowrap; }

/* Portal */
.app-theme .pt-hero { padding-bottom: 6px; }
.app-theme .pt-date { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--app-muted); margin: 0 0 4px; }
.app-theme .pt-lead { color: var(--app-ink-2); margin: 6px 0 0; max-width: 760px; }
.app-theme .pt-alert { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--app-radius-sm); background: var(--app-info-soft); color: var(--app-info); margin-bottom: 14px; font-size: 14px; }
.app-theme .pt-alert:hover { text-decoration: none; filter: brightness(.97); }
.app-theme .pt-alert span { margin-left: auto; font-weight: 600; }
.app-theme .pt-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.app-theme .pt-case { display: flex; flex-direction: column; gap: 8px; background: var(--app-surface); border: 1px solid var(--app-line); border-radius: var(--app-radius); padding: 16px; color: var(--app-ink); }
.app-theme .pt-case:hover { border-color: var(--app-primary); text-decoration: none; box-shadow: 0 2px 10px rgba(20, 61, 49, .08); }
.app-theme .pt-case-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.app-theme .pt-case-no { font-family: var(--app-mono); font-size: 12px; color: var(--app-muted); }
.app-theme .pt-case h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.app-theme .pt-facts { margin: 0; display: grid; gap: 6px; }
.app-theme .pt-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--app-muted); font-weight: 600; }
.app-theme .pt-facts dd { margin: 0; font-size: 13.5px; color: var(--app-ink-2); }
.app-theme .pt-case-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; border-top: 1px solid var(--app-line-2); padding-top: 10px; margin-top: auto; font-size: 12.5px; color: var(--app-muted); }
.app-theme .pt-more { margin-left: auto; color: var(--app-primary); font-weight: 600; }
.app-theme .pt-summary { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; background: var(--app-bg); border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 10px 12px; font-size: 13px; }
.app-theme .pt-summary-text { flex: 1 1 320px; }
.app-theme .pt-summary-text .text-muted { display: block; font-size: 12px; margin-top: 2px; }

/* Mensajes */
.app-theme .pm-thread { max-height: 62vh; overflow: auto; padding: 4px 2px; display: flex; flex-direction: column; gap: 8px; }
.app-theme .pm-empty { margin: 10px 0; text-align: center; }
.app-theme .pm-day { text-align: center; margin: 6px 0; }
.app-theme .pm-day span { font-size: 11px; color: var(--app-muted); background: var(--app-bg); border-radius: 999px; padding: 2px 10px; }
.app-theme .pm-msg { display: flex; }
.app-theme .pm-msg.is-mine { justify-content: flex-end; }
.app-theme .pm-bubble { max-width: 78%; border-radius: 12px; padding: 8px 12px; background: var(--app-bg); border: 1px solid var(--app-line); }
.app-theme .pm-msg.is-mine .pm-bubble { background: var(--app-primary-soft); border-color: #C9DFD6; }
.app-theme .pm-who { font-size: 11.5px; font-weight: 600; color: var(--app-ink-2); margin-bottom: 3px; }
.app-theme .pm-case { font-weight: 400; color: var(--app-info); margin-left: 6px; }
.app-theme .pm-body { font-size: 14px; color: var(--app-ink); white-space: normal; word-wrap: break-word; }
.app-theme .pm-time { font-size: 11px; color: var(--app-muted); margin-top: 4px; text-align: right; }
.app-theme .pm-form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.app-theme .pm-form-row select { width: auto; max-width: 100%; }
.app-theme .pm-form-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.app-theme .pm-thread-row { display: flex; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--app-line-2); color: var(--app-ink); }
.app-theme .pm-thread-row:last-child { border-bottom: 0; }
.app-theme .pm-thread-row:hover { background: var(--app-bg); text-decoration: none; }
.app-theme .pm-thread-row.is-unread strong { color: var(--app-primary-dark); }
.app-theme .pm-thread-main { flex: 1; min-width: 0; }
.app-theme .pm-thread-head { display: flex; justify-content: space-between; gap: 8px; }
.app-theme .pm-thread-last { font-size: 13px; color: var(--app-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
    .app-theme .pt-cases { grid-template-columns: 1fr; }
    .app-theme .pm-bubble { max-width: 92%; }
}

/* =====================================================================
   Etapa 9 — Honorarios, cuenta del cliente y control de tiempo
   ===================================================================== */
.app-theme .hn-tabs .badge { background: var(--app-line); color: var(--app-ink-2); font-weight: 600; margin-left: 2px; }
.app-theme .hn-table td { vertical-align: middle; }
.app-theme .hn-table td .nt-inline { display: inline-flex; vertical-align: middle; }
.app-theme .hn-table tr.nt-cancelled td { color: var(--app-muted); }
.app-theme .hn-table tr.nt-cancelled td strong { text-decoration: line-through; font-weight: 500; }
.app-theme .hn-table tfoot th { border-top: 2px solid var(--app-line); }
.app-theme .hn-stage-form { margin-top: 10px; }
.app-theme .hn-receipt-ready { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.app-theme .hn-receipt-ready .btn { margin-left: auto; }
.app-theme .hn-timer { font-family: var(--app-serif); font-size: 30px; font-weight: 600; letter-spacing: .04em; color: var(--app-primary-dark); margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.app-theme .hn-iguala-list { max-height: 220px; overflow: auto; margin-bottom: 12px; }
.app-theme .hn-iguala-list li { padding: 3px 0; border-bottom: 1px solid var(--app-line-2); }
.app-theme .hn-filters .form-group { margin-bottom: 8px; }
.app-theme .main-header .navbar .hn-nav-timer > a { color: var(--app-danger); font-weight: 600; font-variant-numeric: tabular-nums; }
.app-theme .main-header .navbar .hn-nav-timer > a .fa { color: var(--app-danger); animation: hn-pulse 1.6s ease-in-out infinite; }
@keyframes hn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 767px) {
    .app-theme .hn-receipt-ready .btn { margin-left: 0; }
    .app-theme .main-header .navbar .hn-nav-timer .hn-timer-mini { display: none; }
}

/* =====================================================================
   Etapa 10 — Tablero gerencial y reportes
   ===================================================================== */
.app-theme .rp-nav { flex-wrap: wrap; }
.app-theme .rp-nav > li > a { padding: 9px 12px; }
.app-theme .rp-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; }
.app-theme .rp-filter label { display: block; font-size: 12px; font-weight: 600; color: var(--app-ink-2); margin-bottom: 3px; }
.app-theme .rp-filter-check { padding-bottom: 6px; }
.app-theme .rp-filter-check label { font-weight: 500; }
.app-theme .rp-filter-actions { display: flex; gap: 4px; align-items: center; }
.app-theme .rp-export { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.app-theme .rp-export .text-muted { margin-right: auto; }
.app-theme .rp-table td, .app-theme .rp-table th { vertical-align: middle; }
.app-theme .rp-table tfoot th { border-top: 2px solid var(--app-line); }
.app-theme .rp-section-body { max-height: 420px; overflow: auto; }
.app-theme .rp-detail { font-size: 13px; }
.app-theme .rp-bars { display: flex; flex-direction: column; gap: 8px; }
.app-theme .rp-bar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.app-theme .rp-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--app-ink-2); }
.app-theme .rp-bar-track { background: var(--app-bg); border-radius: 4px; height: 14px; overflow: hidden; }
.app-theme .rp-bar-fill { display: block; height: 100%; background: var(--app-primary); border-radius: 4px; }
.app-theme .rp-bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-theme .rp-cols { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 6px; }
.app-theme .rp-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.app-theme .rp-col-bar { display: block; width: 100%; max-width: 30px; background: var(--app-primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.app-theme .rp-col-bar.is-current { background: var(--app-warning); }
.app-theme .rp-col-label { font-size: 11px; color: var(--app-muted); margin-top: 4px; }
.app-theme .rp-dl-split { margin-top: 12px; }
.app-theme .rp-stack { display: flex; height: 14px; border-radius: 4px; overflow: hidden; margin: 6px 0; background: var(--app-bg); }
.app-theme .rp-stack-ok { background: var(--app-primary); }
.app-theme .rp-stack-late { background: var(--app-warning); }
.app-theme .rp-stack-miss { background: var(--app-danger); }
.app-theme .rp-legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--app-ink-2); }
.app-theme .rp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.app-theme .rp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 10px; }
.app-theme .rp-card { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--app-line); border-radius: var(--app-radius-sm); padding: 12px 14px; background: var(--app-surface); color: var(--app-ink); }
.app-theme .rp-card:hover, .app-theme .rp-card:focus { border-color: var(--app-primary); background: var(--app-primary-soft); text-decoration: none; color: var(--app-ink); }
.app-theme .rp-card .fa { color: var(--app-primary); font-size: 18px; }
.app-theme .rp-card span { font-size: 12.5px; color: var(--app-muted); }
@media (max-width: 767px) {
    .app-theme .rp-export .text-muted { width: 100%; }
    .app-theme .rp-cols { height: 130px; gap: 3px; }
}

/* =====================================================================
   Etapa 11 — Acciones que cambian datos van por formulario (POST)
   ===================================================================== */
.app-theme .exp-post-form { display: inline; margin: 0; }
.app-theme .exp-link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--app-primary); cursor: pointer; line-height: inherit; }
.app-theme .exp-link-btn:hover, .app-theme .exp-link-btn:focus { text-decoration: underline; }
.app-theme .exp-link-btn.text-danger { color: var(--app-danger); }
.app-theme .app-plan-alert { margin-bottom: 0; }
