/* ==========================================================
   VARIABLES
========================================================== */

:root {
    --blue: #3c91b7;
    --blue-dark: #287da3;
    --blue-light: #eaf4f8;

    --text: #262626;
    --muted: #727272;

    --border: #d6d6d6;
    --border-light: #e8e8e8;

    --surface: #ffffff;
    --surface-soft: #f4f4f4;

    --danger: #d9534f;
    --success: #4f9b67;

    --page-width: 1850px;
    --page-space: 32px;

    --shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}


/* ==========================================================
   RESET
========================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--text);

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 13px;

    background-color: #eeeeee;
    background-image:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.42) 0,
            rgba(255, 255, 255, 0.42) 3px,
            rgba(220, 220, 220, 0.28) 3px,
            rgba(220, 220, 220, 0.28) 6px
        );
}

a {
    color: #1d6da0;
    text-decoration: none;
}

a:hover {
    color: #154f75;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* ==========================================================
   ANCHO GENERAL DE LA APLICACIÓN
========================================================== */

.boxcoin-container,
.system-header,
.main-nav,
.boxcoin-panel {
    width: calc(100% - var(--page-space));
    max-width: var(--page-width);
    margin-right: auto;
    margin-left: auto;
}

.boxcoin-container {
    width: calc(100% - var(--page-space));
}


/* ==========================================================
   LOGO
========================================================== */

.boxcoin-brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;

    gap: 10px;

    /* Protege las esquinas del rombo rotado */
    margin-left: 5px;
    padding: 5px 7px;

    color: #111111;

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    letter-spacing: -0.5px;

    overflow: visible;
}

.boxcoin-brand:hover {
    color: #111111;
}

.boxcoin-logo-shape {
    display: inline-block;
    flex: 0 0 23px;

    width: 23px;
    height: 23px;

    margin: 3px;

    background-color: var(--blue);

    border-radius: 2px;

    transform: rotate(45deg);
    transform-origin: center;
}

.boxcoin-brand-blue {
    color: var(--blue);
}


/* ==========================================================
   ENCABEZADO GENERAL
========================================================== */

.system-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    min-height: 62px;
    padding: 10px 6px 8px;

    overflow: visible;
}

.system-userbar {
    display: flex;
    align-items: center;

    gap: 8px;

    min-height: 38px;
    padding: 0 14px;

    background-color: #ffffff;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);

    font-size: 12px;
    white-space: nowrap;
}

.system-userbar strong {
    color: #111111;
}

.system-userbar-separator {
    color: #b8b8b8;
}

.system-userbar form {
    display: inline;
    margin: 0;
}

.system-userbar button {
    padding: 0;

    color: #1d6da0;

    background: transparent;

    border: 0;

    cursor: pointer;
}

.system-userbar button:hover {
    color: #154f75;
}


/* ==========================================================
   MENÚ PRINCIPAL
========================================================== */

.main-nav {
    display: flex;
    align-items: stretch;

    min-height: 44px;

    margin-bottom: 12px;

    background-color: #ffffff;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}

.main-nav-link {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    min-width: max-content;
    min-height: 44px;
    padding: 0 18px;

    color: #333333;

    border-right: 1px solid var(--border-light);

    font-size: 14px;

    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.main-nav-link:hover {
    color: #111111;

    background-color: #f7f7f7;
}

.main-nav-link.active {
    color: #111111;

    background-color: #ffffff;
}

.main-nav-link.active::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: 0;
    left: 0;

    height: 3px;

    background-color: var(--blue);
}


/* ==========================================================
   MENÚ PRINCIPAL — DESPLEGABLE "HERRAMIENTAS"
========================================================== */

.main-nav-dropdown {
    position: relative;
}

.main-nav-dropdown-toggle {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 18px;

    border-right: 1px solid var(--border-light);

    font-size: 14px;
    color: #333333;

    cursor: pointer;
    user-select: none;

    gap: 6px;

    list-style: none;
}

.main-nav-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.main-nav-dropdown-toggle::marker {
    content: "";
}

.main-nav-dropdown-arrow {
    font-size: 10px;
}

.main-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 20;

    min-width: 200px;

    background-color: #ffffff;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}

.main-nav-dropdown-item {
    display: block;

    padding: 11px 16px;

    color: #333333;

    border-bottom: 1px solid var(--border-light);

    font-size: 14px;
    text-decoration: none;
}

.main-nav-dropdown-item:last-child {
    border-bottom: none;
}

.main-nav-dropdown-item:hover {
    background-color: #f7f7f7;
}


/* ==========================================================
   PANEL GENERAL
========================================================== */

.boxcoin-panel {
    margin-bottom: 24px;

    background-color: #ffffff;

    border: 1px solid var(--border);

    box-shadow: var(--shadow);
}

.boxcoin-panel-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;

    min-height: 50px;

    background-color: #f5f5f5;

    border-bottom: 1px solid var(--border);
}

.boxcoin-panel-title {
    display: flex;
    align-items: center;

    margin: 0;
    padding: 0 18px;

    font-size: 19px;
    font-weight: 400;
}

.boxcoin-panel-body {
    padding: 18px;
}


/* ==========================================================
   PESTAÑAS
========================================================== */

.panel-tabs {
    display: flex;

    margin-left: auto;
}

.panel-tab {
    display: flex;
    align-items: center;

    padding: 0 20px;

    color: #15649b;

    background-color: #f5f5f5;

    border-left: 1px solid var(--border);

    font-size: 13px;
}

.panel-tab.active {
    position: relative;

    color: #333333;

    background-color: #ffffff;
}

.panel-tab.active::before {
    content: "";

    position: absolute;

    top: -1px;
    right: -1px;
    left: -1px;

    height: 1px;

    background-color: #ffffff;
}


/* ==========================================================
   BOTONES
========================================================== */

.btn-boxcoin {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    padding: 0 16px;

    color: #ffffff;

    background:
        linear-gradient(
            to bottom,
            #54aae0,
            #318ec8
        );

    border: 1px solid #2782bb;
    border-radius: 4px;

    box-shadow:
        inset 0 1px rgba(255, 255, 255, 0.35),
        0 1px 3px rgba(0, 0, 0, 0.2);

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.btn-boxcoin:hover {
    color: #ffffff;

    background:
        linear-gradient(
            to bottom,
            #459dd4,
            #277fb5
        );
}

.btn-boxcoin-danger {
    background: var(--danger);
    border-color: #bd3f3b;
}


/* ==========================================================
   FORMULARIOS
========================================================== */

.form-row {
    margin-bottom: 14px;
}

.form-row label {
    display: block;

    margin-bottom: 5px;

    color: #444444;

    font-size: 13px;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    min-height: 38px;

    padding: 7px 10px;

    color: #222222;

    background-color: #ffffff;

    border: 1px solid #c8c8c8;
    border-radius: 3px;

    outline: none;
}

.form-row textarea {
    min-height: 90px;

    resize: vertical;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    border-color: var(--blue);

    box-shadow: 0 0 0 2px rgba(60, 145, 183, 0.13);
}

.help-text {
    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 12px;
}

.error {
    margin-top: 5px;

    color: var(--danger);

    font-size: 12px;
}


/* ==========================================================
   TABLAS
========================================================== */

.boxcoin-table-wrapper {
    width: 100%;

    overflow-x: auto;
}

.boxcoin-table {
    width: 100%;

    border: 1px solid #cfcfcf;
    border-collapse: collapse;

    font-size: 13px;
}

.boxcoin-table th,
.boxcoin-table td {
    padding: 9px 10px;

    border-right: 1px solid #d5d5d5;
    border-bottom: 1px solid #d5d5d5;

    vertical-align: middle;
}

.boxcoin-table th {
    color: #333333;

    background-color: #eeeeee;

    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.boxcoin-table tbody tr:hover {
    background-color: #f8fbfc;
}

.boxcoin-table a {
    color: #1c70a6;
}

.boxcoin-table .current-row {
    background-color: #fff9e5;
}


/* ==========================================================
   ORDENAMIENTO DE TABLAS AL HACER CLIC EN EL TÍTULO
   (aplicado por JS a cualquier tabla del sistema, no solo
   a las que usan la clase .boxcoin-table)
========================================================== */

th.col-ordenable {
    cursor: pointer;
    user-select: none;
}

th.col-ordenable:hover {
    text-decoration: underline;
}

th.col-ordenable-activa {
    color: #1c6ea4;
}

.col-orden-flecha {
    margin-left: 4px;

    font-size: 10px;
}


/* ==========================================================
   PANTALLAS MEDIANAS
========================================================== */

@media (max-width: 900px) {

    :root {
        --page-space: 20px;
    }

    .system-header {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
        padding-top: 10px;
    }

    .system-userbar {
        width: 100%;

        overflow-x: auto;
    }

    .main-nav-link {
        padding: 0 14px;

        font-size: 13px;
    }

    .boxcoin-panel-header {
        flex-direction: column;
    }

    .panel-tabs {
        width: 100%;
        margin-left: 0;

        overflow-x: auto;
    }

    .panel-tab {
        min-height: 42px;

        border-top: 1px solid var(--border);
        border-left: 0;
        border-right: 1px solid var(--border);
    }

    .boxcoin-table {
        min-width: 720px;
    }
}


/* ==========================================================
   TELÉFONOS
========================================================== */

@media (max-width: 600px) {

    :root {
        --page-space: 12px;
    }

    body {
        font-size: 13px;
    }

    .system-header {
        min-height: auto;
        padding: 8px 3px;
    }

    .boxcoin-brand {
        margin-left: 4px;

        font-size: 21px;
    }

    .boxcoin-logo-shape {
        flex-basis: 20px;

        width: 20px;
        height: 20px;
    }

    .system-userbar {
        align-items: flex-start;
        flex-direction: column;

        gap: 5px;
        padding: 9px 12px;

        white-space: normal;
    }

    .system-userbar-separator {
        display: none;
    }

    .main-nav {
        min-height: 40px;
    }

    .main-nav-link {
        min-height: 40px;
        padding: 0 12px;
    }

    .boxcoin-panel-title {
        min-height: 45px;
        padding: 0 12px;

        font-size: 18px;
    }

    .boxcoin-panel-body {
        padding: 12px;
    }

    .panel-tab {
        padding: 0 15px;
    }

    .btn-boxcoin {
        min-height: 36px;
    }
}