/**
 * Lanys Dashlets Styles
 * Стили для кастомных дашлетов портала
 * 
 * Источник дизайна: dashboard-full2.html (адаптировано)
 */

/* =============================================================================
   CSS VARIABLES
   ============================================================================= */
:root {
    --dashlet-bg: rgba(61, 68, 120, 0.5);
    --dashlet-radius: 16px;
    --dashlet-padding: 24px;
    --dashlet-title-size: 22px;
    --dashlet-amount-size: 32px;
    --dashlet-label-color: #8b8fab;
    --dashlet-text-color: #ffffff;
    --dashlet-btn-radius: 10px;
    --dashlet-btn-refill-bg: rgba(78, 84, 143, 0.5);
    --dashlet-btn-refill-hover: rgba(78, 84, 143, 0.65);
    --dashlet-btn-green-gradient: linear-gradient(90deg, #6ee56e 0%, #3bc33b 100%);
    --dashlet-btn-green-hover: linear-gradient(90deg, #7ff57f 0%, #4cd44c 100%);
    --dashlet-positive-color: #5dd75d;
    --dashlet-negative-color: #ff5b5b;
    --dashlet-border-color: rgba(139, 143, 171, 0.25);
    --dashlet-row-border-color: rgba(139, 143, 171, 0.15);
    --dashlet-card-bg: rgba(78, 84, 143, 0.3);
    --dashlet-card-hover: rgba(78, 84, 143, 0.5);
}

/* =============================================================================
   PORTAL DASHLET CONTAINER - FULL HEIGHT
   ============================================================================= */
.main-portal .dashlet:has(.lanys-dashlet) {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-portal .dashlet:has(.lanys-dashlet) .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

.main-portal .dashlet:has(.lanys-dashlet) .panel-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0;
    border-radius: var(--dashlet-radius);
    overflow: hidden;
}

.main-portal .dashlet:has(.lanys-dashlet) .panel-heading {
    display: none;
}

/* =============================================================================
   DASHLET BASE
   ============================================================================= */
.lanys-dashlet {
    background: var(--dashlet-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--dashlet-radius);
    padding: var(--dashlet-padding);
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   HEADER
   ============================================================================= */
.lanys-dashlet__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.lanys-dashlet__header .lanys-dashlet__title {
    margin-bottom: 0;
}

.lanys-dashlet__link {
    color: var(--dashlet-positive-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    flex-shrink: 0;
}

.lanys-dashlet__link:hover {
    text-decoration: underline;
    color: var(--dashlet-positive-color);
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */
.lanys-dashlet__title {
    color: var(--dashlet-text-color);
    font-size: var(--dashlet-title-size);
    font-weight: 700;
    margin: 0 0 12px 0;
    letter-spacing: -0.3px;
    flex-shrink: 0;
}

.lanys-dashlet__id-label {
    color: var(--dashlet-label-color);
    font-size: 12px;
    font-weight: 400;
    margin-bottom: 2px;
    flex-shrink: 0;
}

.lanys-dashlet__id-value {
    color: var(--dashlet-text-color);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.lanys-dashlet__amount {
    color: var(--dashlet-text-color);
    font-size: var(--dashlet-amount-size);
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.lanys-dashlet__section-label {
    color: var(--dashlet-text-color);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    margin-top: 24px;
}

.lanys-dashlet__empty {
    color: var(--dashlet-label-color);
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =============================================================================
   ICONS
   ============================================================================= */
.lanys-dashlet__icon {
    width: 36px;
    height: 36px;
    margin-bottom: 12px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.lanys-dashlet__icon--wallet {
    background-image: url('/client/custom/img/wallet-02.svg');
}

.lanys-dashlet__icon--chart {
    background-image: url('/client/custom/img/bitcoin-up-02.svg');
}

/* =============================================================================
   SECTIONS (for Investment dashlet)
   ============================================================================= */
.lanys-dashlet__section {
    margin-bottom: 20px;
}

.lanys-dashlet__section:last-of-type {
    margin-bottom: 20px;
}

/* =============================================================================
   CONTENT AREA - FLEX GROW
   ============================================================================= */
.lanys-dashlet__content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* =============================================================================
   TABLE (for Transactions dashlet)
   ============================================================================= */
.lanys-dashlet__table {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
}

.lanys-dashlet__table-header {
    display: grid;
    grid-template-columns: 90px 90px 1fr;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--dashlet-border-color);
    flex-shrink: 0;
    min-width: 280px;
}

.lanys-dashlet__table-header .lanys-dashlet__table-cell {
    color: var(--dashlet-label-color);
    font-size: 13px;
    font-weight: 500;
}

.lanys-dashlet__table-body {
    flex: 1;
    min-width: 280px;
}

.lanys-dashlet__table-row {
    display: grid;
    grid-template-columns: 90px 90px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--dashlet-row-border-color);
}

.lanys-dashlet__table-row:last-child {
    border-bottom: none;
}

.lanys-dashlet__table-cell {
    color: var(--dashlet-text-color);
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lanys-dashlet__table-cell--action {
    white-space: normal;
}

.lanys-dashlet__table-cell--sum {
    font-weight: 600;
}

.lanys-dashlet__sum--positive {
    color: var(--dashlet-positive-color);
}

.lanys-dashlet__sum--negative {
    color: var(--dashlet-negative-color);
}

/* =============================================================================
   PACKAGES LIST (for InvestPackages dashlet)
   ============================================================================= */
.lanys-dashlet__packages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.lanys-dashlet__package-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--dashlet-card-bg);
    border-radius: 12px;
    padding: 16px 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lanys-dashlet__package-card:hover {
    background: var(--dashlet-card-hover);
    text-decoration: none;
}

.lanys-dashlet__package-name {
    color: var(--dashlet-text-color);
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lanys-dashlet__package-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    margin-left: 16px;
}

.lanys-dashlet__package-sum {
    color: var(--dashlet-positive-color);
    font-size: 16px;
    font-weight: 700;
}

.lanys-dashlet__package-date {
    color: var(--dashlet-label-color);
    font-size: 12px;
    margin-top: 4px;
}

/* =============================================================================
   BUTTONS - PUSH TO BOTTOM
   ============================================================================= */
.lanys-dashlet__buttons {
    margin-top: auto;
    flex-shrink: 0;
}

.lanys-dashlet__btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.lanys-dashlet__btn-row:last-child {
    margin-bottom: 0;
}

.lanys-dashlet__btn {
    border: none;
    border-radius: var(--dashlet-btn-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 12px 16px;
    color: var(--dashlet-text-color);
    text-align: center;
}

.lanys-dashlet__btn--half {
    flex: 1;
    min-width: 0;
}

.lanys-dashlet__btn--full {
    width: 100%;
}

.lanys-dashlet__btn--refill {
    background: var(--dashlet-btn-refill-bg);
}

.lanys-dashlet__btn--refill:hover {
    background: var(--dashlet-btn-refill-hover);
}

.lanys-dashlet__btn--green {
    background: var(--dashlet-btn-green-gradient);
}

.lanys-dashlet__btn--green:hover {
    background: var(--dashlet-btn-green-hover);
}

/* =============================================================================
   RESPONSIVE - LARGE SCREENS (1200px+)
   ============================================================================= */
@media (min-width: 1200px) {
    .lanys-dashlet {
        --dashlet-padding: 28px;
        --dashlet-title-size: 26px;
        --dashlet-amount-size: 38px;
    }

    .lanys-dashlet__icon {
        width: 42px;
        height: 42px;
    }

    .lanys-dashlet__section-label {
        font-size: 20px;
    }

    .lanys-dashlet__btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .lanys-dashlet__table-header,
    .lanys-dashlet__table-row {
        grid-template-columns: 110px 110px 1fr;
        gap: 16px;
    }

    .lanys-dashlet__table-cell {
        font-size: 15px;
    }

    .lanys-dashlet__package-card {
        padding: 18px 24px;
    }

    .lanys-dashlet__package-name {
        font-size: 16px;
    }

    .lanys-dashlet__package-sum {
        font-size: 18px;
    }
}

/* =============================================================================
   RESPONSIVE - MEDIUM SCREENS (768px - 1199px)
   ============================================================================= */
@media (min-width: 768px) and (max-width: 1199px) {
    .lanys-dashlet {
        --dashlet-padding: 24px;
        --dashlet-title-size: 22px;
        --dashlet-amount-size: 32px;
    }

    .lanys-dashlet__table-header,
    .lanys-dashlet__table-row {
        grid-template-columns: 95px 95px 1fr;
        gap: 14px;
    }
}

/* =============================================================================
   RESPONSIVE - SMALL SCREENS (480px - 767px)
   ============================================================================= */
@media (min-width: 480px) and (max-width: 767px) {
    .lanys-dashlet {
        --dashlet-padding: 20px;
        --dashlet-radius: 14px;
        --dashlet-title-size: 20px;
        --dashlet-amount-size: 28px;
    }

    .lanys-dashlet__icon {
        width: 32px;
        height: 32px;
        margin-bottom: 10px;
    }

    .lanys-dashlet__section-label {
        font-size: 16px;
        margin-top: 20px;
    }

    .lanys-dashlet__btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .lanys-dashlet__btn-row {
        gap: 8px;
    }

    .lanys-dashlet__table-cell {
        font-size: 13px;
    }

    .lanys-dashlet__link {
        font-size: 13px;
    }

    .lanys-dashlet__package-card {
        padding: 14px 16px;
    }

    .lanys-dashlet__package-name {
        font-size: 14px;
    }

    .lanys-dashlet__package-sum {
        font-size: 15px;
    }
}

/* =============================================================================
   RESPONSIVE - EXTRA SMALL SCREENS (<480px)
   ============================================================================= */
@media (max-width: 479px) {
    .lanys-dashlet {
        --dashlet-padding: 16px;
        --dashlet-radius: 12px;
        --dashlet-title-size: 18px;
        --dashlet-amount-size: 24px;
    }

    .lanys-dashlet__id-label {
        font-size: 11px;
    }

    .lanys-dashlet__id-value {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .lanys-dashlet__icon {
        width: 28px;
        height: 28px;
        margin-bottom: 8px;
    }

    .lanys-dashlet__amount {
        margin-bottom: 16px;
    }

    .lanys-dashlet__section {
        margin-bottom: 16px;
    }

    .lanys-dashlet__section-label {
        font-size: 15px;
        margin-top: 16px;
        margin-bottom: 10px;
    }

    .lanys-dashlet__btn-row {
        flex-direction: column;
        gap: 8px;
    }

    .lanys-dashlet__btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .lanys-dashlet__btn--half {
        width: 100%;
    }

    .lanys-dashlet__link {
        font-size: 12px;
    }

    /* Table - keep as table, smaller font */
    .lanys-dashlet__table-header .lanys-dashlet__table-cell,
    .lanys-dashlet__table-cell {
        font-size: 12px;
    }

    /* Package cards - stacked */
    .lanys-dashlet__packages-list {
        gap: 10px;
    }

    .lanys-dashlet__package-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 14px 16px;
        gap: 8px;
    }

    .lanys-dashlet__package-info {
        align-items: flex-start;
        margin-left: 0;
        flex-direction: row;
        gap: 12px;
        width: 100%;
    }

    .lanys-dashlet__package-name {
        font-size: 14px;
        white-space: normal;
    }

    .lanys-dashlet__package-sum {
        font-size: 15px;
    }

    .lanys-dashlet__package-date {
        margin-top: 0;
    }
}
