:root {
    --bg-main: #0b1120;
    --bg-panel: #131c31;
    --bg-panel-soft: #1a2640;
    --bg-sidebar: #0f172a;
    --bg-card: #16213a;
    --border-color: #26344f;
    --text-main: #e2e8f0;
    --text-soft: #94a3b8;
    --primary: #0ea5e9;
    --primary-dark: #0284c7;
    --secondary: #38bdf8;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --brand-title: #ffffff;
    --brand-subtitle: rgba(255, 255, 255, 0.72);
    --theme-toggle-border: rgba(125, 211, 252, 0.35);
    --theme-toggle-bg: rgba(14, 165, 233, 0.12);
    --theme-toggle-text: #e0f2fe;
    --theme-toggle-text-hover: #ffffff;
    --theme-toggle-bg-hover: rgba(14, 165, 233, 0.2);
    --theme-toggle-border-hover: rgba(125, 211, 252, 0.55);
}

html[data-theme="light"] {
    --bg-main: #edf3fb;
    --bg-panel: #f7faff;
    --bg-panel-soft: #ffffff;
    --bg-sidebar: #dfe9f6;
    --bg-card: #ffffff;
    --border-color: #cbd8ea;
    --text-main: #1f2d3d;
    --text-soft: #61758d;
    --primary: #0b74c8;
    --primary-dark: #085fa4;
    --secondary: #38bdf8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --brand-title: #163252;
    --brand-subtitle: #61758d;
    --theme-toggle-border: rgba(11, 116, 200, 0.22);
    --theme-toggle-bg: rgba(11, 116, 200, 0.08);
    --theme-toggle-text: #163252;
    --theme-toggle-text-hover: #0f2742;
    --theme-toggle-bg-hover: rgba(11, 116, 200, 0.14);
    --theme-toggle-border-hover: rgba(11, 116, 200, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
}

/* =========================
   LOGIN
========================= */
.login-body {
    background: linear-gradient(135deg, #0b1120, #10213d);
    min-height: 100vh;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card-portuario {
    width: 100%;
    max-width: 520px;
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-header-portuario {
    background: linear-gradient(135deg, #1e3a8a, #0369a1);
    color: white;
    text-align: center;
    padding: 32px 28px;
}

.login-logo {
    width: 90px;
    height: 90px;
    background: white;
    color: #1e3a8a;
    border-radius: 20px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 42px;
    font-weight: bold;
}

.login-header-portuario h2 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 800;
}

.login-header-portuario p {
    margin: 0;
    color: #dbeafe;
    font-size: 16px;
}

.login-form-portuario {
    padding: 32px;
}

.login-form-portuario label {
    color: #0f172a;
    font-weight: 600;
    margin-bottom: 8px;
}

.input-login {
    height: 54px;
    border-radius: 14px;
    border: 1px solid #cbd5e1;
    font-size: 16px;
}

.btn-login {
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border: none;
    color: white;
    font-size: 19px;
    font-weight: 700;
    margin-top: 10px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7);
    color: white;
}

.login-footer-text {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
    font-size: 14px;
}

html[data-theme="light"] .login-body {
    background: linear-gradient(135deg, #eaf2fb, #dbe8f6);
}

html[data-theme="light"] .login-card-portuario {
    box-shadow: 0 20px 60px rgba(15, 39, 66, 0.14);
}

html[data-theme="light"] .login-form-portuario label {
    color: #163252;
}

html[data-theme="light"] .login-footer-text {
    color: var(--text-soft);
}

/* =========================
   LAYOUT INTERNO
========================= */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0f172a, #111c33);
    border-right: 1px solid var(--border-color);
    padding: 24px 18px;
}

html[data-theme="light"] .sidebar {
    background: linear-gradient(180deg, #edf4fb, #dbe8f6);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
}

.sidebar-brand h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.sidebar-brand small {
    color: var(--text-soft);
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-menu a {
    text-decoration: none;
    color: var(--text-main);
    background: transparent;
    border: 1px solid transparent;
    padding: 12px 14px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-menu a:hover {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
}

html[data-theme="light"] .sidebar-menu a {
    color: #1f2d3d;
}

html[data-theme="light"] .sidebar-menu a:hover {
    background: rgba(11, 116, 200, 0.1);
    border-color: rgba(11, 116, 200, 0.18);
    color: #0b74c8;
}

.main-content {
    flex: 1;
    padding: 22px;
}

.topbar {
    background: linear-gradient(135deg, #131c31, #182742);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

html[data-theme="light"] .topbar {
    background: linear-gradient(135deg, #ffffff, #eef5fc);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

html[data-theme="light"] .topbar h1 {
    color: #163252;
}

.subtitle {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-main);
    font-weight: 600;
}

.page-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 24px;
}

html[data-theme="light"] .page-content {
    background: linear-gradient(180deg, #ffffff, #f4f8fe);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

/* =========================
   COMPONENTES
========================= */
.card-panel {
    background: linear-gradient(180deg, #16213a, #182742);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] .card-panel {
    background: linear-gradient(180deg, #ffffff, #f3f8fe);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.card-panel h5,
.card-panel h4 {
    color: #e0f2fe;
}

html[data-theme="light"] .card-panel h5,
html[data-theme="light"] .card-panel h4 {
    color: #163252;
}

.text-muted-custom {
    color: var(--text-soft);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border: none;
    border-radius: 12px;
    padding: 10px 18px;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0369a1, #0284c7);
}

.btn-outline-light {
    border-radius: 12px;
}

html[data-theme="light"] .btn-outline-light {
    color: #163252;
    border-color: rgba(11, 116, 200, 0.24);
    background: #ffffff;
}

html[data-theme="light"] .btn-outline-light:hover,
html[data-theme="light"] .btn-outline-light:focus {
    color: #0b74c8;
    border-color: rgba(11, 116, 200, 0.36);
    background: rgba(11, 116, 200, 0.08);
}

/* =========================
   FORMULARIOS
========================= */
.form-control,
.form-select,
textarea {
    background: #0f172a !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select,
html[data-theme="light"] textarea {
    background: #ffffff !important;
    color: #1f2d3d !important;
    border-color: var(--border-color) !important;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

.sigop-search-autocomplete {
    position: relative;
}

.sigop-search-autocomplete-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: 0 18px 36px rgba(2, 8, 23, 0.35);
}

html[data-theme="light"] .sigop-search-autocomplete-menu {
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(15, 39, 66, 0.14);
}

.sigop-search-autocomplete-item {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    font-size: 14px;
    transition: background 0.18s ease, color 0.18s ease;
}

.sigop-search-autocomplete-item:hover,
.sigop-search-autocomplete-item.is-active {
    background: rgba(14, 165, 233, 0.14);
    color: #ffffff;
}

html[data-theme="light"] .sigop-search-autocomplete-item:hover,
html[data-theme="light"] .sigop-search-autocomplete-item.is-active {
    background: rgba(11, 116, 200, 0.1);
    color: #0b74c8;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
}

/* =========================
   TABLAS
========================= */
.table {
    color: var(--text-main);
}

.table thead th {
    background: #0f172a;
    color: #7dd3fc;
    border-color: var(--border-color);
}

html[data-theme="light"] .table thead th {
    background: #eaf2fb;
    color: #0b74c8;
}

.table td {
    border-color: var(--border-color);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }
}

/* =========================
   TABLAS OSCURAS
========================= */

.tabla-contenedor {
    background: #111c33;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
}

html[data-theme="light"] .tabla-contenedor {
    background: #f7fbff;
}

.table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
}

.sigop-table-scroll {
    position: relative;
    width: 100%;
}

.sigop-configurable-table {
    margin-bottom: 0;
}

.sigop-table-wide {
    width: max-content;
}

.sigop-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
    position: relative;
}

.sigop-table-toolbar-title {
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
}

.sigop-table-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 100%;
}

.sigop-table-toolbar-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sigop-table-toolbar-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sigop-table-toolbar-icon svg {
    width: 14px;
    height: 14px;
}

.sigop-column-trigger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding: 0;
    line-height: 1;
    border-radius: 12px;
    background: linear-gradient(180deg, #16213a, #182742);
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}

html[data-theme="light"] .sigop-column-trigger {
    background: linear-gradient(180deg, #ffffff, #edf4fb);
    border-color: rgba(11, 116, 200, 0.25);
    color: #163252;
}

.sigop-column-trigger:hover,
.sigop-column-trigger:focus {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.35);
    color: #7dd3fc;
}

html[data-theme="light"] .sigop-column-trigger:hover,
html[data-theme="light"] .sigop-column-trigger:focus {
    background: rgba(11, 116, 200, 0.12);
    border-color: rgba(11, 116, 200, 0.35);
    color: #0b74c8;
}

.sigop-column-modal {
    --bs-modal-bg: #16213a;
    --bs-modal-color: #e2e8f0;
    --bs-modal-border-color: rgba(148, 163, 184, 0.18);
    background: linear-gradient(180deg, #16213a, #182742) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    color: var(--text-main) !important;
}

html[data-theme="light"] .sigop-column-modal {
    --bs-modal-bg: #f7faff;
    --bs-modal-color: #1f2d3d;
    --bs-modal-border-color: rgba(148, 163, 184, 0.22);
    background: linear-gradient(180deg, #ffffff, #f3f8fe) !important;
    box-shadow: 0 20px 48px rgba(15, 39, 66, 0.16);
}

.sigop-column-modal .modal-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 16px 18px 12px 18px;
}

.sigop-column-modal .modal-title {
    color: #e0f2fe;
    font-size: 18px;
    font-weight: 700;
}

html[data-theme="light"] .sigop-column-modal .modal-title {
    color: #163252;
}

.sigop-column-modal .modal-body {
    background: transparent !important;
    padding: 14px 18px 18px 18px;
}

.sigop-column-modal .modal-header,
.sigop-column-modal .modal-body,
.sigop-column-modal .modal-footer {
    color: #e2e8f0 !important;
}

html[data-theme="light"] .sigop-column-modal .modal-header,
html[data-theme="light"] .sigop-column-modal .modal-body,
html[data-theme="light"] .sigop-column-modal .modal-footer {
    color: #1f2d3d !important;
}

.sigop-column-modal .btn-outline-light {
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.32);
    background: transparent;
}

html[data-theme="light"] .sigop-column-modal .btn-outline-light {
    color: #163252;
    border-color: rgba(11, 116, 200, 0.24);
}

.sigop-column-modal .btn-outline-light:hover,
.sigop-column-modal .btn-outline-light:focus {
    color: #7dd3fc;
    border-color: rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.12);
}

html[data-theme="light"] .sigop-column-modal .btn-outline-light:hover,
html[data-theme="light"] .sigop-column-modal .btn-outline-light:focus {
    color: #0b74c8;
    border-color: rgba(11, 116, 200, 0.35);
    background: rgba(11, 116, 200, 0.08);
}

.sigop-column-modal .btn-primary {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border: none;
}

.sigop-column-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.9;
}

html[data-theme="light"] .sigop-column-modal .btn-close {
    filter: none;
    opacity: 0.75;
}

.sigop-column-quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sigop-column-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 12px;
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.sigop-column-option {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .sigop-column-option {
    color: #1f2d3d;
    background: rgba(11, 116, 200, 0.06);
}

.sigop-column-option span {
    color: #e2e8f0;
}

html[data-theme="light"] .sigop-column-option span {
    color: #1f2d3d;
}

.sigop-column-option input {
    accent-color: var(--primary);
}

.table {
    margin-bottom: 0;
    color: var(--text-main) !important;
}

.table thead th {
    background: #0f172a !important;
    color: #7dd3fc !important;
    border-color: var(--border-color) !important;
    padding: 14px 12px;
}

html[data-theme="light"] .table thead th {
    background: #eaf2fb !important;
    color: #0b74c8 !important;
}

.table tbody td {
    background: #131c31 !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
    padding: 14px 12px;
}

html[data-theme="light"] .table tbody td {
    background: #ffffff !important;
    color: #1f2d3d !important;
}

.table-hover tbody tr:hover td {
    background: #1e2d4a !important;
}

html[data-theme="light"] .table-hover tbody tr:hover td {
    background: #eef5fc !important;
}

.fila-vacia {
    background: #131c31 !important;
    color: var(--text-soft) !important;
    font-size: 16px;
}

html[data-theme="light"] .fila-vacia {
    background: #ffffff !important;
}

.fila-vacia strong {
    color: #7dd3fc;
}

/* =========================
   TARJETAS DE PUERTOS
========================= */

.puerto-card {
    display: block;
    cursor: pointer;
    width: 100%;
}

.puerto-card input {
    display: none;
}

.puerto-card-content {
    background: #0f172a;
    border: 1px solid #2c3d5e;
    border-radius: 16px;
    padding: 16px 18px;
    min-height: 92px;
    transition: all 0.2s ease;
}

.puerto-card:hover .puerto-card-content {
    background: #17233b;
    border-color: #0ea5e9;
}

.puerto-card input:checked + .puerto-card-content {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(37, 99, 235, 0.15));
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.12);
}

.puerto-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.puerto-check-fake {
    width: 20px;
    height: 20px;
    border: 2px solid #64748b;
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    background: #111827;
}

.puerto-card input:checked + .puerto-card-content .puerto-check-fake {
    background: #0ea5e9;
    border-color: #38bdf8;
}

.puerto-card input:checked + .puerto-card-content .puerto-check-fake::after {
    content: "✓";
    position: absolute;
    top: -4px;
    left: 3px;
    color: white;
    font-size: 17px;
    font-weight: 800;
}

.puerto-nombre {
    color: #e2e8f0;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.puerto-jefe {
    color: #93c5fd;
    font-size: 14px;
    line-height: 1.4;
    padding-left: 32px;
}

.puerto-jefe span {
    color: #ffffff;
    font-weight: 500;
}

html[data-theme="light"] .puerto-card-content {
    background: linear-gradient(135deg, #ffffff, #eef5fc);
    border-color: #cbd8ea;
    box-shadow: 0 8px 20px rgba(15, 39, 66, 0.05);
}

html[data-theme="light"] .puerto-card:hover .puerto-card-content {
    background: linear-gradient(135deg, #f8fbff, #e9f3fd);
    border-color: #0b74c8;
}

html[data-theme="light"] .puerto-card input:checked + .puerto-card-content {
    background: linear-gradient(135deg, #e1f1ff, #d9ecff);
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.14);
}

html[data-theme="light"] .puerto-check-fake {
    border-color: #94a3b8;
    background: #ffffff;
}

html[data-theme="light"] .puerto-nombre {
    color: #163252;
    font-weight: 700;
}

html[data-theme="light"] .puerto-jefe {
    color: #0b74c8;
}

html[data-theme="light"] .puerto-jefe span {
    color: #35506d;
    font-weight: 600;
}
/* =========================
   BADGE PUERTOS EN TABLA
========================= */

.puerto-badge {
    display: inline-block;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #bae6fd;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1.4;
}

html[data-theme="light"] .puerto-badge {
    background: rgba(11, 116, 200, 0.08);
    border-color: rgba(11, 116, 200, 0.22);
    color: #0b74c8;
    font-weight: 700;
}
/* =========================
   PAGINACIÓN
========================= */

.paginacion-contenedor {
    margin-top: 18px;
    padding: 14px 16px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.paginacion-info {
    color: var(--text-soft);
    font-size: 15px;
}

.paginacion-info strong {
    color: #e0f2fe;
}

.paginacion-botones {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-pagina {
    min-width: 42px;
    height: 42px;
    text-decoration: none !important;
    color: #bae6fd !important;
    background: #111c33;
    border: 1px solid #2c3d5e;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-pagina:hover {
    background: #1e2d4a;
    border-color: #0ea5e9;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.btn-pagina.activo {
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    border-color: #38bdf8;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.btn-pagina-texto {
    min-width: 92px;
    padding: 0 14px;
}
/* =========================
   PAGINACIÓN EMPRESAS
========================= */

.paginacion-contenedor {
    margin-top: 18px !important;
    padding: 14px 16px !important;
    background: #0f172a !important;
    border: 1px solid #26344f !important;
    border-radius: 14px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 16px !important;
    flex-wrap: wrap !important;
}

.paginacion-info {
    color: #94a3b8 !important;
    font-size: 15px !important;
}

.paginacion-info strong {
    color: #e0f2fe !important;
}

.paginacion-botones {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.paginacion-botones .btn-pagina {
    min-width: 34px !important;
    height: 34px !important;
    text-decoration: none !important;
    color: #bae6fd !important;
    background: #111c33 !important;
    border: 1px solid #2c3d5e !important;
    border-radius: 9px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    transition: all 0.2s ease !important;
}

.paginacion-botones .btn-pagina:hover {
    background: #1e2d4a !important;
    border-color: #0ea5e9 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.paginacion-botones .btn-pagina.activo {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

.paginacion-botones .btn-pagina-texto {
    min-width: 82px !important;
    height: 34px !important;
    padding: 0 12px !important;
}

.btn-pagina-puntos {
    background: transparent !important;
    border-color: transparent !important;
    color: #64748b !important;
    cursor: default !important;
    min-width: 28px !important;
}

.btn-pagina-puntos:hover {
    background: transparent !important;
    border-color: transparent !important;
    transform: none !important;
}

html[data-theme="light"] .paginacion-contenedor {
    background: linear-gradient(135deg, #ffffff, #eef5fc) !important;
    border: 1px solid #cbd8ea !important;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

html[data-theme="light"] .paginacion-info {
    color: #61758d !important;
}

html[data-theme="light"] .paginacion-info strong {
    color: #163252 !important;
}

html[data-theme="light"] .paginacion-botones .btn-pagina {
    color: #163252 !important;
    background: #ffffff !important;
    border: 1px solid #cbd8ea !important;
    box-shadow: 0 6px 14px rgba(15, 39, 66, 0.05);
}

html[data-theme="light"] .paginacion-botones .btn-pagina:hover {
    background: #eef5fc !important;
    border-color: #0b74c8 !important;
    color: #0b74c8 !important;
}

html[data-theme="light"] .paginacion-botones .btn-pagina.activo {
    background: linear-gradient(135deg, #0284c7, #0ea5e9) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

html[data-theme="light"] .btn-pagina-puntos {
    background: transparent !important;
    border-color: #d8e2f0 !important;
    color: #61758d !important;
    box-shadow: none !important;
}
/* =========================
   FICHA DE EMPRESA
========================= */

.detalle-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detalle-item {
    background: #0f172a;
    border: 1px solid #26344f;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.detalle-item span {
    color: #94a3b8;
    font-size: 14px;
}

.detalle-item strong {
    color: #e0f2fe;
    font-size: 15px;
    text-align: right;
}

.puertos-lista {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.puerto-info-card {
    background: #0f172a;
    border: 1px solid #26344f;
    border-radius: 16px;
    padding: 16px;
}

.puerto-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.puerto-icono {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

.puerto-info-header h6 {
    margin: 0;
    color: #e0f2fe;
    font-size: 16px;
}

.puerto-info-header small {
    color: #94a3b8;
}

.puerto-info-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.puerto-info-body div {
    background: #111c33;
    border-radius: 12px;
    padding: 12px;
}

.puerto-info-body span {
    display: block;
    color: #93c5fd;
    font-size: 13px;
    margin-bottom: 4px;
}

.puerto-info-body strong {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.alerta-sistema {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
    border-radius: 14px;
    padding: 14px 16px;
}

.acciones-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.accion-card {
    text-decoration: none;
    color: #e2e8f0;
    background: #0f172a;
    border: 1px solid #26344f;
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.accion-card:hover {
    color: #ffffff;
    background: #1e2d4a;
    border-color: #0ea5e9;
    transform: translateY(-2px);
}

.accion-card span {
    font-size: 24px;
}

.accion-card strong {
    display: block;
    color: #e0f2fe;
    margin-bottom: 4px;
}

.accion-card small {
    color: #94a3b8;
    font-size: 13px;
}

@media (max-width: 992px) {
    .acciones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .acciones-grid {
        grid-template-columns: 1fr;
    }

    .detalle-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .detalle-item strong {
        text-align: left;
    }
}
/* =========================
   DÍAS DE VENCIMIENTO
========================= */

.dias-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.dias-vigente {
    background: rgba(34, 197, 94, 0.13);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #86efac;
}

.dias-proxima {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.40);
    color: #fcd34d;
}

.dias-hoy {
    background: rgba(250, 204, 21, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.45);
    color: #fef08a;
}

.dias-vencida {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

/* =========================
   INPUT DATE / CALENDARIO
========================= */

.input-date-wrapper {
    position: relative;
}

input[type="date"],
.input-date,
.form-control[type="date"] {
    color-scheme: dark;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 14px) center !important;
    background-size: 18px 18px !important;
    padding-right: 52px !important;
}

input[type="date"] {
    cursor: text;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: none;
    opacity: 0;
    width: 30px;
    height: 30px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 0;
}

.acciones-convenio {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
/* =========================
   TIPO DOCUMENTO
========================= */

.tipo-doc-badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.30);
    color: #bae6fd;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
/* =========================
   ALERTAS DEL SISTEMA
========================= */

.alerta-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #fecaca;
    border-radius: 16px;
    padding: 16px 18px;
}

.alerta-error strong {
    color: #ffffff;
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.alerta-error p {
    margin: 0;
    color: #fca5a5;
}
/* =========================
   BADGES ORIGEN VENCIMIENTO
========================= */

.origen-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.origen-disposicion {
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #bae6fd;
}

html[data-theme="light"] .origen-disposicion {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.28);
    color: #0b74c8;
}

.origen-documento {
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #e9d5ff;
}

html[data-theme="light"] .origen-documento {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.28);
    color: #8b5cf6;
}
/* =========================
   DASHBOARD / PANEL PRINCIPAL
========================= */

.dashboard-card {
    background: linear-gradient(135deg, #0f172a, #17233b);
    border: 1px solid #26344f;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 110px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .dashboard-card {
    background: linear-gradient(135deg, #ffffff, #eef5fc);
    border-color: #cbd8ea;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.dashboard-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.28);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
}

.dashboard-card span {
    display: block;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 4px;
}

html[data-theme="light"] .dashboard-card span {
    color: #61758d;
}

.dashboard-card strong {
    display: block;
    color: #e0f2fe;
    font-size: 34px;
    line-height: 1;
}

html[data-theme="light"] .dashboard-card strong {
    color: #163252;
}

.dashboard-card-warning .dashboard-card-icon {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.35);
}

.dashboard-card-danger .dashboard-card-icon {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
}

.panel-access-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-access-item {
    text-decoration: none;
    color: #e2e8f0;
    background: #0f172a;
    border: 1px solid #26344f;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

html[data-theme="light"] .panel-access-item {
    color: #163252;
    background: #ffffff;
    border-color: #cbd8ea;
}

.panel-access-item:hover {
    color: #ffffff;
    background: #1e2d4a;
    border-color: #0ea5e9;
    transform: translateY(-2px);
}

html[data-theme="light"] .panel-access-item:hover {
    color: #0b74c8;
    background: #eef5fc;
    border-color: #0b74c8;
}

.panel-access-item > span {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.panel-access-item strong {
    display: block;
    color: #e0f2fe;
    margin-bottom: 3px;
}

html[data-theme="light"] .panel-access-item strong {
    color: #163252;
}

.panel-access-item small {
    color: #94a3b8;
    font-size: 13px;
}

html[data-theme="light"] .panel-access-item small {
    color: #61758d;
}
.origen-convenio {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}
.origen-convenio {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}
/* =========================
   TARJETAS DE RESUMEN REPORTES
========================= */

.reporte-card {
    background: linear-gradient(135deg, #0f172a, #17233b);
    border: 1px solid #26344f;
    border-radius: 18px;
    padding: 18px;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

html[data-theme="light"] .reporte-card {
    background: linear-gradient(135deg, #ffffff, #eef5fc);
    border-color: #cbd8ea;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.reporte-card span {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 8px;
}

html[data-theme="light"] .reporte-card span {
    color: #61758d;
}

.reporte-card strong {
    color: #e0f2fe;
    font-size: 32px;
    line-height: 1;
}

html[data-theme="light"] .reporte-card strong {
    color: #163252;
}

.reporte-card-success {
    border-color: rgba(34, 197, 94, 0.35);
}

.reporte-card-success strong {
    color: #bbf7d0;
}

.reporte-card-warning {
    border-color: rgba(245, 158, 11, 0.4);
}

html[data-theme="light"] .reporte-card-warning {
    border-color: rgba(217, 119, 6, 0.35);
    background: linear-gradient(135deg, #fffdf5, #fff4d6);
}

.reporte-card-warning strong {
    color: #fde68a;
}

html[data-theme="light"] .reporte-card-warning strong {
    color: #b45309;
}

.reporte-card-danger {
    border-color: rgba(239, 68, 68, 0.4);
}

html[data-theme="light"] .reporte-card-danger {
    border-color: rgba(220, 38, 38, 0.32);
    background: linear-gradient(135deg, #fff7f7, #ffe1e1);
}

.reporte-card-danger strong {
    color: #fecaca;
}

html[data-theme="light"] .reporte-card-danger strong {
    color: #b91c1c;
}

html[data-theme="light"] .list-group-item {
    border-color: #d8e2f0 !important;
}

html[data-theme="light"] .badge.bg-warning.text-dark {
    color: #7c2d12 !important;
    font-weight: 700;
}

html[data-theme="light"] .badge.bg-danger {
    font-weight: 700;
}

html[data-theme="light"] .badge.bg-success {
    font-weight: 700;
}

.reporte-print-resumen {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.reporte-print-resumen span {
    background: #0f172a;
    border: 1px solid #26344f;
    border-radius: 999px;
    padding: 7px 12px;
    color: #94a3b8;
    font-size: 13px;
}

.reporte-print-resumen strong {
    color: #e0f2fe;
}

html[data-theme="light"] .reporte-print-resumen span {
    background: linear-gradient(135deg, #eef5fc, #ffffff);
    border-color: #cbd8ea;
    color: #35506d;
    box-shadow: 0 6px 14px rgba(15, 39, 66, 0.05);
}

html[data-theme="light"] .reporte-print-resumen strong {
    color: #163252;
}
/* =========================
   IMPRESIÓN / PDF
========================= */

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
    }

    .page-content,
    .card-panel,
    .reporte-print,
    .tabla-contenedor {
        background: #ffffff !important;
        border: none !important;
        box-shadow: none !important;
        color: #000000 !important;
    }

    .reporte-encabezado h4,
    .reporte-encabezado p,
    .reporte-resumen span,
    .reporte-resumen strong,
    .reporte-print-resumen span,
    .reporte-print-resumen strong {
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
    }

    .table {
        color: #000000 !important;
        border-collapse: collapse !important;
        width: 100% !important;
        font-size: 12px !important;
    }

    .table thead th {
        background: #e5e7eb !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }

    .table tbody td {
        background: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #000000 !important;
    }

    .badge,
    .puerto-badge,
    .origen-badge {
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        font-weight: 700 !important;
    }
}
/* =========================
   ROLES DE USUARIO
========================= */

.rol-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.rol-admin {
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #bae6fd;
}

html[data-theme="light"] .rol-admin {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.28);
    color: #0b74c8;
}

.rol-carga {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.40);
    color: #fcd34d;
}

html[data-theme="light"] .rol-carga {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(217, 119, 6, 0.28);
    color: #b45309;
}

.rol-consulta {
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #e9d5ff;
}

html[data-theme="light"] .rol-consulta {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.28);
    color: #8b5cf6;
}

.rol-jefe-puerto {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

html[data-theme="light"] .rol-jefe-puerto {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(22, 163, 74, 0.28);
    color: #15803d;
}
/* =========================
   AUDITORÍA
========================= */

.auditoria-modulo {
    display: inline-block;
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    color: #bae6fd;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.auditoria-accion {
    display: inline-block;
    background: rgba(148, 163, 184, 0.14);
    border: 1px solid rgba(148, 163, 184, 0.30);
    color: #cbd5e1;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.auditoria-crear {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
    color: #bbf7d0;
}

.auditoria-editar {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.40);
    color: #fcd34d;
}

.auditoria-eliminar {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.alerta-info {
    background: rgba(14, 165, 233, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #bae6fd;
    border-radius: 16px;
    padding: 16px 18px;
}

.alerta-info strong {
    color: #ffffff;
}

html[data-theme="light"] .alerta-info {
    background: linear-gradient(135deg, #e6f4ff, #d8efff);
    border-color: rgba(11, 116, 200, 0.22);
    color: #35506d;
}

html[data-theme="light"] .alerta-info strong {
    color: #163252;
}

html[data-theme="light"] .alerta-info .form-check-label {
    color: #35506d;
}

html[data-theme="light"] .alerta-info .form-check-label strong {
    color: #163252;
}

html[data-theme="light"] .alerta-info .form-check-label span {
    color: #4f6b89;
    font-weight: 500;
}

/* =========================================================
   LAYOUT FIJO: SIDEBAR + TOPBAR
   ========================================================= */

html,
body {
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
}

body {
    margin: 0;
}

/* Contenedor general */
.app-layout {
    height: 100vh !important;
    max-height: 100vh !important;
    display: flex !important;
    overflow: hidden !important;
}

/* Barra lateral fija */
.sidebar {
    width: 260px !important;
    min-width: 260px !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-shrink: 0 !important;
}

/* Contenido derecho */
.main-content {
    flex: 1 !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 22px !important;
}

/* Barra superior fija */
.topbar {
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 100 !important;
    margin-bottom: 22px !important;
}

/* Solo esta parte se mueve */
.page-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 24px !important;
    padding-bottom: 40px !important;
}

/* Scroll más prolijo */
.sidebar::-webkit-scrollbar,
.page-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.page-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
}

.sidebar::-webkit-scrollbar-thumb,
.page-content::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.page-content::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.55);
}

/* Responsive: en pantallas chicas vuelve a comportamiento normal */
@media (max-width: 992px) {
    html,
    body {
        height: auto;
        overflow: auto !important;
    }

    .app-layout {
        height: auto !important;
        max-height: none !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    .sidebar {
        width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .main-content {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .page-content {
        overflow: visible !important;
    }
}
