
/* ================================================= */
/* =============== ESTILOS GENERALES =============== */
/* ================================================= */

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
}

.custom-navbar {
    background: linear-gradient(60deg, #FF6633, #FFCC33, #99CC33);
}

.logo-container img {
    object-fit: contain;
}

.card {
    border-radius: 15px;
}

.content {
    background-color: #f5f7fa;
}


/* ================================================= */
/* =================== SIDEBAR ===================== */
/* ================================================= */

.sidebar {
    width: 220px;
    min-width: 220px;
    min-height: 100vh;
    background-color: #2c2c2c;
    color: white;
    transition: transform 0.3s ease;
}

.sidebar-links {
    padding: 16px 12px;
}

.sidebar .nav-link,
.sidebar-links .nav-link {
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar-links .nav-link:hover {
    color: white;
    background-color: #444;
}

.sidebar-links .nav-link.active {
    color: white;
    background-color: #444;
    border-left: 4px solid #99CC33;
}


/* ================================================= */
/* ================= BOTONES ARTÍCULOS ============= */
/* ================================================= */

.table-hover tbody tr:hover {
    background-color: #f1f1f1;
}

.btn-editar {
    border: 1px solid #99CC33;
    color: #6BA539;
    background: white;
    border-radius: 10px;
    transition: 0.2s;
}

.btn-editar:hover {
    color: white;
    background: #99CC33;
}

.btn-eliminar {
    border: 1px solid #E8743B;
    color: #E8743B;
    background: white;
    border-radius: 10px;
}

.btn-eliminar:hover {
    color: white;
    background: #E8743B;
}


/* ================================================= */
/* ============== CREATE / EDIT ART ================ */
/* ================================================= */

.create-body {
    background-color: #f5f7fa;
}

.create-body .container {
    max-width: 1200px;
}

.create-card {
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.form-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2D3436;
}

.form-subtitle {
    color: #6c757d;
    margin-bottom: 0;
}

.custom-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2D3436;
}

.custom-group .input-group-text {
    background-color: white;
    border-right: none;
    border-radius: 14px 0 0 14px;
}

.custom-group .custom-input {
    border-left: none;
}

.custom-input {
    height: 58px;
    border-radius: 14px;
    border: 1px solid #dfe4ea;
    transition: all 0.2s ease;
}

.custom-input:focus {
    border-color: #6BA539;
    box-shadow: 0 0 0 0.2rem rgba(107, 165, 57, 0.15);
}

.btn-harvest {
    background: linear-gradient(60deg, #FF6633, #FFCC33, #99CC33);
    padding: 12px 22px;
    font-weight: 600;
    border: none;
    color: white;
    border-radius: 6px;
    transition: 0.25s ease;
}

.btn-harvest:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    color: white;
}


/* ================================================= */
/* ================= VALIDACIONES ================== */
/* ================================================= */

.input-error {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, .15);
}

.invalid-feedback {
    font-size: 0.90rem;
    margin-top: 6px;
}


/* ================================================= */
/* ============ CUENTA CORRIENTE =================== */
/* ================================================= */

.cc-page .app-layout {
    display: flex;
    min-height: calc(100vh - 68px);
}

.cc-page .content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
    background-color: #f5f7fa;
}

.cc-page .cc-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2D3436;
}

.cc-page .cc-card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.cc-page .cc-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cc-page .cc-label {
    font-weight: 600;
    color: #2D3436;
    margin-bottom: 8px;
}

.cc-page .cc-input {
    height: 46px;
    border-radius: 12px;
    border: 1px solid #dfe4ea;
}

.cc-page .cc-input:focus {
    border-color: #99CC33;
    box-shadow: 0 0 0 0.15rem rgba(153, 204, 51, 0.15);
}

.cc-page .cc-check-box {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
    background-color: #fff;
}

.cc-page .cc-check-box .form-check-input {
    margin-top: 0;
}

.cc-page .cc-check {
    accent-color: #99CC33;
}

.cc-page .btn-buscar {
    height: 46px;
    background: linear-gradient(60deg, #FF6633, #FFCC33, #99CC33);
    border: none;
    color: white;
    border-radius: 10px;
    padding: 10px 24px;
    font-weight: 600;
    transition: 0.2s ease;
}

.cc-page .btn-buscar:hover {
    color: white;
    transform: translateY(-1px);
}

.cc-page .cc-table-wrapper {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid #e9ecef;
    overflow-x: auto;
}

.cc-page .cc-table {
    margin-bottom: 0;
    min-width: 850px;
}

.cc-page .cc-table thead th {
    background-color: #2c2c2c;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: none;
}

.cc-page .cc-table tbody td {
    vertical-align: middle;
    white-space: nowrap;
}

.cc-page .cc-table tbody tr:hover {
    background-color: #f8f9fa;
}

.cc-page .cc-type-badge {
    display: inline-block;
    min-width: 38px;
    text-align: center;
    padding: 4px 8px;
    border-radius: 999px;
    background-color: #f1f3f5;
    color: #495057;
    font-size: 0.85rem;
    font-weight: 600;
}

.cc-page .cc-saldo-anterior-row td {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #2D3436;
}

.cc-page .cc-saldo-anterior {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
}

.cc-page .cc-saldo-anterior-label,
.cc-page .cc-saldo-anterior-valor {
    font-weight: 700;
    color: #2D3436;
}


/* ================================================= */
/* ================ DATATABLE CC =================== */
/* ================================================= */

.cc-page .dt-container {
    font-size: 0.95rem;
}

.cc-page .dt-search input,
.cc-page .dt-length select {
    border-radius: 10px;
    border: 1px solid #dfe4ea;
}

.cc-page .dt-search input:focus,
.cc-page .dt-length select:focus {
    border-color: #99CC33;
    box-shadow: 0 0 0 0.15rem rgba(153, 204, 51, 0.15);
    outline: none;
}

.cc-page .dt-info {
    color: #6c757d;
}

.cc-page .pagination {
    margin-bottom: 0;
}

.cc-page .page-link {
    color: #495057;
}

.cc-page .page-item.active .page-link {
    background-color: #444;
    border-color: #444;
}

.cc-page .cc-export-mobile {
    display: none;
}


/* ================================================= */
/* ============ RESPONSIVE GENERAL ================= */
/* ================================================= */

@media (max-width: 991px) {

    .sidebar {
        position: fixed;
        top: 68px;
        left: 0;
        width: 220px;
        min-width: 220px;
        height: calc(100vh - 68px);
        z-index: 9999;
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        width: 100%;
    }

    .cc-page .app-layout {
        display: block;
    }

    .cc-page .content {
        padding: 1rem;
    }
}


/* ================================================= */
/* =========== CUENTA CORRIENTE MOBILE ============= */
/* ================================================= */

@media (max-width: 767px) {

    .cc-page .dt-layout-row {
        gap: 12px;
    }

    .cc-page .dt-search,
    .cc-page .dt-length {
        width: 100%;
    }

    .cc-page .dt-search input,
    .cc-page .dt-length select {
        width: 100%;
    }

    .cc-page .cc-label {
        font-size: 0.82rem;
        margin-bottom: 5px;
    }

    .cc-page .cc-input {
        height: 42px;
        font-size: 0.85rem;
        padding-left: 8px;
        padding-right: 8px;
    }

    .cc-page .cc-check-box {
        height: 42px;
    }

    .cc-page .btn-buscar {
        height: 42px;
    }

    .cc-page .cc-saldo-anterior {
        padding: 10px 12px;
        gap: 12px;
    }

    .cc-page .cc-saldo-anterior-label {
        flex-shrink: 0;
        font-size: 0.9rem;
    }

    .cc-page .cc-saldo-anterior-valor {
        text-align: right;
        font-size: 0.9rem;
        overflow-wrap: anywhere;
    }

    .cc-page .cc-export-mobile {
        display: block;
        margin-top: 16px;
    }

    .cc-page .cc-export-mobile .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .cc-page .cc-export-mobile .dt-button {
        flex: 1 1 auto;
    }
}


/* ================================================= */
/* ======== CUENTA CORRIENTE - HAMBURGUESA ========= */
/* ================================================= */

.cc-page #toggleSidebar {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #2d3436;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    flex-shrink: 0;
}

.cc-page #toggleSidebar:hover,
.cc-page #toggleSidebar:focus {
    background-color: #f5f7fa;
    color: #2d3436;
}

.cc-page #toggleSidebar .bi {
    font-size: 1.5rem;
}


/* ================================================= */
/* ======= CUENTA CORRIENTE - VERTICAL ============= */
/* ================================================= */

@media (max-width: 767px) and (orientation: portrait) {

    .cc-page .cc-table {
        min-width: 0;
        width: 100% !important;
        table-layout: fixed;
        font-size: 0.75rem;
    }

    /* Ocultar Tipo, Nro Comp, Debe y Haber */
    .cc-page .cc-table .cc-columna-detalle,
    .cc-page .cc-table thead th:nth-child(3),
    .cc-page .cc-table thead th:nth-child(4),
    .cc-page .cc-table thead th:nth-child(5),
    .cc-page .cc-table thead th:nth-child(6) {
        display: none !important;
    }

    /* Fecha */
    .cc-page .cc-table th:nth-child(1),
    .cc-page .cc-table td:nth-child(1) {
        width: 26%;
        white-space: nowrap;
    }

    /* Concepto */
    .cc-page .cc-table th:nth-child(2),
    .cc-page .cc-table td:nth-child(2) {
        width: 37%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Saldo */
    .cc-page .cc-table th:nth-child(7),
    .cc-page .cc-table td:nth-child(7) {
        width: 37%;
        white-space: nowrap;
        text-align: right;
        font-size: 0.7rem;
    }

    .cc-page .cc-table th,
    .cc-page .cc-table td {
        padding: 8px 3px;
    }

    .cc-page .cc-input {
        min-width: 0;
        width: 100%;
    }

    .cc-page input[type="date"] {
        font-size: 0.75rem;
        padding-left: 4px;
        padding-right: 2px;
    }
}


/* ================================================= */
/* ======= CUENTA CORRIENTE - HORIZONTAL =========== */
/* ================================================= */

@media (max-width: 991px) and (orientation: landscape) {

    .cc-page .cc-table {
        width: 100% !important;
        min-width: 850px;
        table-layout: auto;
    }

    .cc-page .cc-table th,
    .cc-page .cc-table td {
        white-space: nowrap;
    }
}


/* ================================================= */
/* ===== CUENTA CORRIENTE - PRESENTACIÓN MÓVIL ===== */
/* ================================================= */

@media (max-width: 767px),
       (max-width: 991px) and (orientation: landscape) {

    .cc-page #totalMovimientos,
    .cc-page .dt-info {
        display: none;
    }

    .cc-page .cc-export-mobile {
        display: block;
        margin-top: 16px;
    }

    .cc-page .cc-export-mobile .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }

    .cc-page .cc-export-mobile .dt-button {
        flex: 1 1 auto;
    }

    .cc-page .dt-paging {
        width: 100%;
        overflow-x: auto;
    }
}


/* ================================================= */
/* ============ GRILLA DE ARTÍCULOS ================ */
/* ================================================= */

.art-page .content {
    min-width: 0;
}

.art-page .art-card {
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}


/* ================================================= */
/* ============== TOOLBAR ARTÍCULOS ================= */
/* ================================================= */

.art-page .art-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.art-page .art-toolbar-search {
    flex: 0 1 420px;
    min-width: 260px;
}

.art-page .art-buscador {
    width: 100%;
    height: 46px;
    border-radius: 12px;
    border: 1px solid #dfe4ea;
}

.art-page .art-buscador:focus {
    border-color: #99CC33;
    box-shadow: 0 0 0 0.15rem rgba(153, 204, 51, 0.15);
}

.art-page .art-toolbar-create {
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 12px;
}

.art-page .art-toolbar-create i {
    font-size: 1rem;
}

.art-page .art-toolbar-create-text {
    display: inline;
}


/* ================================================= */
/* ================= TABLA ARTÍCULOS =============== */
/* ================================================= */

.art-page .art-table-container {
    width: 100%;
    min-width: 0;
}

.art-page .art-table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed;
    margin-bottom: 0;
}

.art-page .art-table thead th {
    background-color: #2c2c2c;
    color: white;
    font-weight: 600;
    border-bottom: none;
    vertical-align: middle;
}

/* CodArt */
.art-page .art-table th:nth-child(1),
.art-page .art-table td:nth-child(1) {
    width: 110px;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    white-space: nowrap;
}

/* Artículo */
.art-page .art-table th:nth-child(2),
.art-page .art-table td:nth-child(2) {
    text-align: left;
    padding-left: 14px;
    padding-right: 14px;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Acciones */
.art-page .art-table th:nth-child(3),
.art-page .art-table td:nth-child(3) {
    width: 125px;
    text-align: center;
}


/* ================================================= */
/* ============== BOTONES DE ACCIÓN ================ */
/* ================================================= */

.art-page .art-acciones {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.art-page .art-acciones .btn {
    width: 35px;
    height: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0 !important;
}


/* ================================================= */
/* ================ DATATABLE ARTÍCULOS ============= */
/* ================================================= */

.art-page .dt-container {
    font-size: 0.95rem;
}

.art-page .dt-length select {
    border-radius: 10px;
    border: 1px solid #dfe4ea;
}

.art-page .dt-info {
    color: #6c757d;
}

.art-page .pagination {
    margin-bottom: 0;
}

.art-page .page-link {
    color: #495057;
}

.art-page .page-item.active .page-link {
    background-color: #444;
    border-color: #444;
}


/* ================================================= */
/* ================ ARTÍCULOS MOBILE =============== */
/* ================================================= */

@media (max-width: 767px) {

    .art-page .content {
        padding: 0.75rem !important;
    }

    .art-page .art-card .card-body {
        padding: 0.75rem;
    }

    /* Buscador y botón "+" en la misma fila */
    .art-page .art-toolbar {
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 8px;
    }

    .art-page .art-toolbar-search {
        flex: 1 1 auto;
        min-width: 0;
    }

    .art-page .art-toolbar-create {
        width: 46px;
        min-width: 46px;
        height: 46px;
        padding: 0;
        gap: 0;
    }

    .art-page .art-toolbar-create-text {
        display: none;
    }

    .art-page .art-toolbar-create i {
        font-size: 1.15rem;
        margin: 0;
    }

    /* Tabla compacta */
    .art-page .art-table {
        display: table !important;
        font-size: 0.75rem;
    }

    .art-page .art-table th,
    .art-page .art-table td {
        padding: 8px 4px;
        vertical-align: middle;
    }

    /* CodArt */
    .art-page .art-table th:nth-child(1),
    .art-page .art-table td:nth-child(1) {
        width: 72px;
        text-align: center;
        padding-left: 6px;
        padding-right: 6px;
    }

    /* Artículo */
    .art-page .art-table th:nth-child(2),
    .art-page .art-table td:nth-child(2) {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* Acciones */
    .art-page .art-table th:nth-child(3),
    .art-page .art-table td:nth-child(3) {
        width: 84px;
        text-align: center;
        padding-left: 2px;
        padding-right: 2px;
    }

    .art-page .art-acciones {
        gap: 4px;
    }

    .art-page .art-acciones .btn {
        width: 30px;
        height: 30px;
    }

    /* DataTables */
    .art-page .dt-layout-row {
        gap: 12px;
    }

    .art-page .dt-info {
        display: none;
    }

    .art-page .dt-paging {
        width: 100%;
        overflow-x: auto;
    }
}


/* ================================================= */
/* ========== EXPORTACIONES DE ARTÍCULOS =========== */
/* ================================================= */

/* Presentación general */
.art-page .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.art-page .dt-buttons .btn {
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Contenedor móvil oculto en escritorio */
.art-page .art-export-mobile {
    display: none;
}

/* Separación entre los controles de DataTables */
.art-page .dt-layout-row {
    gap: 12px;
}

/* ================================================= */
/* ======== EXPORTACIONES ARTÍCULOS MOBILE ========= */
/* ================================================= */

@media (max-width: 767px),
       (max-width: 991px) and (orientation: landscape) {

    /* Botones después de la tabla y la paginación */
    .art-page .art-export-mobile {
        display: block;
        width: 100%;
        margin-top: 16px;
    }

    .art-page .art-export-mobile .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        width: 100%;
    }

    .art-page .art-export-mobile .dt-buttons .btn {
        flex: 1 1 auto;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}