:root {
    --color-primary: #487FFF;
    --color-accent: #F89315;
    --color-success: #45B369;
    --color-background: #ffffff;
    --color-text: #111111;
    --color-muted: #6c6f7b;
    --color-border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 12px 24px rgba(16, 24, 40, 0.08);
    --transition: all 0.2s ease;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    gap: 24px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 24px;
    font-weight: 600;
}

.sidebar__logo {
    width: 24px;
    height: 24px;
    display: block;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-wrap: wrap;
}

.sidebar__link {
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
    transition: var(--transition);
}

.sidebar__link:hover,
.sidebar__link--active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    z-index: 999;
    display: none;
}

.burger {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.burger__line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    position: relative;
}

.burger__line+.burger__line {
    margin-top: 4px;
}

.burger img {
    width: 20px;
    height: 20px;
    display: block;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 32px 48px;
    gap: 24px;
}

.content__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.content__head-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.content__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(239, 71, 111, 0.12);
    border: 1px solid rgba(239, 71, 111, 0.2);
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(239, 71, 111, 0.2);
}

.logout-btn img {
    width: 22px;
    height: 22px;
    display: block;
}

.content__title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.content__subtitle {
    margin: 4px 0 0;
    color: var(--color-muted);
}

.content__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card--narrow {
    max-width: 440px;
    width: 100%;
    align-self: flex-start;
}

.card--fill {
    width: 100%;
}


.card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.card__title {
    margin: 0;
    font-size: 20px;
}

.card__subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 4px;
    width: 100%;
}

.card--stat {
    align-items: flex-start;
    gap: 4px;
}

.card__label {
    color: var(--color-muted);
    font-size: 14px;
}

.card__value {
    font-size: 28px;
    font-weight: 600;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: stretch;
}

.stack--gap-lg {
    gap: 32px;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid--two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid--form {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 420px));
    align-items: stretch;
}

.card--compact {
    max-width: 520px;
    width: 100%;
}

.table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.table__row {
    display: grid;
    grid-template-columns: 120px 1fr 160px 160px 160px;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    font-size: 14px;
}

.table__row--head {
    font-weight: 600;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table--wide .table__row {
    grid-template-columns: 90px 150px 200px 120px 160px 160px 220px auto;
}

.table--referral--payouts .table__row {
    grid-template-columns: 100px 230px 150px 120px 160px 230px;
}

.table--auto .table__row {
    grid-template-columns: auto auto auto auto auto auto auto auto;
}

.table--applications .table__row {
    grid-template-columns: 90px 0.6fr 0.5fr 0.5fr 130px 60px 60px 180px 140px 260px;
}

.table--applications .table__cell:last-child {
    white-space: normal;
}

/* Payout requests table */
.table--payout-requests .table__row {
    grid-template-columns: 90px 150px 1fr 150px 140px 140px 160px 220px;
}

.table__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.table__actions form {
    margin: 0;
}

.table__actions .btn {
    white-space: nowrap;
}


.table__row--empty {
    border-bottom: none;
    /* justify-content: center; */
}

.table__cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table__cell--empty {
    /* text-align: center; */
    width: 170px;
    white-space: normal;
    color: var(--color-muted);
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions--compact {
    gap: 8px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form__row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    color: var(--color-muted);
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 8px;
}

.filters--compact {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.filters__row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filters__actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
}

.filters__actions .btn {
    min-width: 120px;
    font-weight: 500;
}

.pagination {
    margin-top: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #dee2e6;
}

.pagination__info {
    color: var(--color-muted);
    font-size: 13px;
}

.pagination__controls {
    display: flex;
    gap: 8px;
}

.form__hint {
    margin-top: -4px;
    font-size: 13px;
    color: var(--color-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="time"],
textarea,
select {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    font-size: 15px;
    transition: var(--transition);
    background: #ffffff;
    resize: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(72, 127, 255, 0.2);
    resize: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    color: #ffffff;
}

.btn--primary {
    background: var(--color-primary);
}

.btn--primary:hover {
    background: #3668d8;
}

.btn--secondary {
    background: var(--color-success);
}

.btn--secondary:hover {
    background: #369a5b;
}

.btn--accent {
    background: var(--color-accent);
}

.btn--accent:hover {
    background: #dd7910;
}

.btn--danger {
    background: #ef476f;
}

.btn--danger:hover {
    background: #d3365b;
}

.btn--small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn--outline {
    background: #ffffff;
    color: var(--color-primary);
    border: 1px solid rgba(72, 127, 255, 0.4);
}

.btn--outline:hover {
    background: rgba(72, 127, 255, 0.08);
    color: var(--color-primary);
}

.btn--ghost {
    background: rgba(72, 127, 255, 0.12);
    color: var(--color-primary);
}

.btn--ghost:hover {
    background: rgba(72, 127, 255, 0.2);
}

.btn--icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
    background: rgba(239, 71, 111, 0.15);
    color: #ef476f;
}

.btn--icon:hover {
    background: rgba(239, 71, 111, 0.25);
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255, 71, 87, 0.12);
    color: #ef476f;
}

.text-muted {
    color: var(--color-muted);
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(72, 127, 255, 0.12);
    color: var(--color-primary);
}

.badge--primary {
    background: rgba(72, 127, 255, 0.18);
    color: var(--color-primary);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(72, 127, 255, 0.14);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
}

.tag input {
    margin: 0;
}

.tag--muted {
    background: rgba(17, 24, 39, 0.08);
    color: var(--color-muted);
}

.alert--success {
    background: rgba(69, 179, 105, 0.12);
    color: var(--color-success);
}

.table--admins .table__row {
    grid-template-columns: 120px 1.2fr 1fr 160px 140px 220px;
}

.form--inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form--inline input[type='password'] {
    flex: 1 1 180px;
}

.actions--stacked {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.actions--stacked .btn {
    width: 100%;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal--open {
    display: flex;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
}

.modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    padding: 28px;
    width: min(520px, 100%);
    max-height: min(90vh, 640px);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    animation: modal-fade-in 0.2s ease;
}

.modal__body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(90vh - 140px);
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal__title {
    margin: 0;
    font-size: 20px;
}

.modal__close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-muted);
}

.modal__section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal__section--columns {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}

.modal__section--columns>div {
    flex: 1 1 140px;
}

.modal__hint {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--color-muted);
    letter-spacing: 0.06em;
}

.modal__value {
    font-weight: 600;
    font-size: 16px;
}

.modal__code {
    padding: 12px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.04);
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    word-break: break-all;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
}

.modal-table th,
.modal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    font-size: 14px;
}

.modal-table th {
    text-transform: uppercase;
    font-size: 12px;
    color: var(--color-muted);
    letter-spacing: 0.04em;
}

.modal-table__time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.modal-table__actor {
    white-space: nowrap;
    color: var(--color-muted);
}

.modal__close:hover {
    color: var(--color-text);
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.list__item {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
}

.list__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.list__actions {
    margin: 0;
    display: flex;
    align-items: center;
}

.list__title {
    font-weight: 600;
    margin-bottom: 6px;
}

.list__meta {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.list__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.list__preview {
    font-size: 14px;
    color: var(--color-text);
}

.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(72, 127, 255, 0.12), rgba(69, 179, 105, 0.12));
}

.login__panel {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    width: min(420px, 90%);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login__panel h1 {
    margin: 0;
    font-size: 26px;
    text-align: center;
}

@media (max-width: 960px) {
    .layout {
        flex-direction: column;
    }

    /* Mobile nav via burger */
    .burger {
        display: inline-flex;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: var(--transition);
        width: 280px;
        z-index: 1000;
        padding: 24px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .sidebar__nav {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .sidebar--open {
        transform: translateX(0);
    }

    .sidebar--open~.sidebar-overlay {
        display: block;
    }

    .content {
        padding: 24px;
    }

    .grid--two {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    /* keep payouts history denser on tablets */
    .table--referral--payouts .table__row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* stack wide tables at this breakpoint */
    .table--wide .table__row,
    .table--applications .table__row {
        grid-template-columns: 1fr;
        padding: 12px 0;
        gap: 10px;
    }

    .table--wide .table__row--head,
    .table--applications .table__row--head {
        display: none;
    }

    .table--wide .table__cell {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        white-space: normal;
        padding: 4px 0;
    }

    .table--wide .table__cell::before {
        content: attr(data-label);
        font-weight: 700;
        color: #487fff;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 6px;
        display: block;
    }

    .table--wide .table__cell--empty::before {
        content: "";
    }

    .table--wide .actions,
    .table--wide .table__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .table--wide .actions .btn,
    .table--wide .table__actions .btn {
        width: 100%;
    }
}

/* Earlier stacking for payout requests on tablets */
@media (max-width: 960px) {
    .table--payout-requests .table__row {
        grid-template-columns: 1fr;
    }

    .table--payout-requests .table__row--head {
        display: none;
    }

    .table--payout-requests .table__cell {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

    .table--payout-requests .table__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .table--payout-requests .table__actions .btn {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .card--narrow {
        max-width: 100%;
    }

    .modal__content {
        width: min(100%, 520px);
    }

    .content {
        padding: 20px;
        gap: 20px;
    }

    .content__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .content__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .content__actions .btn {
        width: 100%;
    }

    .card {
        padding: 20px;
    }

    .grid--two,
    .grid--stats {
        grid-template-columns: 1fr;
    }

    .table {
        gap: 16px;
    }

    .table__row--head {
        display: none;
    }

    .table__row,
    .table--wide,
    .table--referral--payouts .table__row {
        grid-template-columns: 1fr;
        padding: 12px 0;
        gap: 10px;
    }

    .table__cell {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        white-space: normal;
        padding: 4px 0;
    }

    .table__cell::before {
        content: attr(data-label);
        font-weight: 700;
        color: #487fff;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        margin-bottom: 6px;
        display: block;
    }

    .table__cell--empty::before {
        content: "";
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .actions form,
    .actions .btn {
        width: 100%;
    }

    .form--inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form--inline input[type='password'] {
        width: 100%;
    }
}

@media (max-width: 540px) {
    .modal__content {
        padding: 24px;
        width: 100%;
    }

    .modal__section--columns {
        flex-direction: column;
    }

    .sidebar {
        gap: 12px;
    }

    .sidebar__brand {
        font-size: 20px;
    }

    .content__title {
        font-size: 24px;
    }

    .card__title {
        font-size: 18px;
    }

    .btn {
        padding: 10px 16px;
    }
}

.modal__section--center {
    align-items: center;
}

.modal__image {
    width: min(280px, 80%);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
}

.user__link {
    text-decoration: none;
    color: var(--color-primary);
}

.referral__payouts {
    position: relative;
}

/* Application List Improvements */
.table__row--hover {
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.table__row--hover:hover {
    background: rgba(72, 127, 255, 0.05);
    transform: translateX(2px);
}

.app-number {
    color: var(--color-primary);
    font-size: 15px;
    font-weight: 600;
}

.app-number--clickable {
    background: transparent;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.app-number--clickable:hover {
    background: rgba(72, 127, 255, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(72, 127, 255, 0.2);
}

.app-number--clickable:active {
    transform: translateY(0);
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-id {
    color: var(--color-text-muted);
    font-size: 13px;
}

.amount-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.amount-primary {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text);
}

.amount-secondary {
    font-size: 13px;
    color: var(--color-text-muted);
}

.timestamp {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: 2px solid transparent;
}

.status-badge--clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-badge--clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 0, 0, 0.1);
}

.status-badge--clickable:active {
    transform: translateY(0);
}

.status-badge--draft {
    background: #f0f0f0;
    color: #666;
}

.status-badge--waiting_acceptance {
    background: #fff3cd;
    color: #856404;
}

.status-badge--waiting_payment {
    background: #cce5ff;
    color: #004085;
}

.status-badge--payment_in_review {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge--payment_received {
    background: #d4edda;
    color: #155724;
}

.status-badge--completed {
    background: #28a745;
    color: white;
}

.status-badge--cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-badge--expired {
    background: #dc3545;
    color: white;
}

/* Method Badges */
.badge--method {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge--qr {
    background: #e7f3ff;
    color: #0066cc;
}

.badge--details {
    background: #f0f9ff;
    color: #0284c7;
}

/* Action Buttons */
.app-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.app-actions__primary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.app-actions__secondary {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(72, 127, 255, 0.1);
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn--success {
    background: #28a745;
    color: white;
}

.action-btn--success:hover {
    background: #218838;
}

.action-btn--complete {
    background: #487fff;
    color: white;
}

.action-btn--complete:hover {
    background: #3668d8;
}

.action-btn--danger {
    background: #ef476f;
    color: white;
}

.action-btn--danger:hover {
    background: #d3365b;
}

.action-btn--info {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.action-btn--info:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.action-btn--secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.action-btn--secondary:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Additional improvements */
.table__cell--actions {
    min-width: 280px;
}

.app-actions form {
    margin: 0;
    display: contents;
}

/* Smooth scrolling for modals */
.modal__body {
    scroll-behavior: smooth;
}

/* Hover effects */
.action-btn {
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Badge animations */
.badge--method {
    transition: all 0.2s ease;
}

.badge--method:hover {
    transform: scale(1.05);
}

/* File Icons (QR & Receipt) */
.table__cell--icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon {
    background: transparent;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: #6c757d;
}

.file-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.file-icon:active {
    transform: translateY(-1px) scale(1.05);
}

.file-icon--qr {
    color: #487fff;
}

.file-icon--qr:hover {
    background: rgba(72, 127, 255, 0.1);
    color: #3668d8;
}

.file-icon--pdf {
    color: #ef476f;
}

.file-icon--pdf:hover {
    background: rgba(239, 71, 111, 0.1);
    color: #d3365b;
}

.file-icon svg {
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.file-icon__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef476f;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.file-icon--empty {
    color: #dee2e6;
    font-size: 18px;
    font-weight: 300;
}

/* Modal improvements for images */
.modal__image--large {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 12px;
}

/* Receipts grid */
.receipts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    padding: 8px 0;
}

.receipt-item {
    display: flex;
}

.receipt-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    width: 100%;
}

.receipt-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(239, 71, 111, 0.25);
    border-color: #ef476f;
    color: #ef476f;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.receipt-link svg {
    color: #ef476f;
    filter: drop-shadow(0 2px 4px rgba(239, 71, 111, 0.2));
}

.receipt-link span {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* Responsive improvements */
@media (max-width: 960px) {
    .app-actions {
        gap: 10px;
    }

    .app-actions__primary,
    .app-actions__secondary {
        flex-direction: column;
        width: 100%;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .status-badge {
        display: inline-block;
        text-align: center;
    }

    .amount-display {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .table--applications .table__row {
        padding: 16px 0;
        gap: 12px;
    }

    .app-number {
        font-size: 16px;
    }

    .status-badge {
        font-size: 11px;
        padding: 5px 10px;
    }

    .receipts-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .receipt-link {
        padding: 16px 12px;
    }

    .modal__image--large {
        max-height: 60vh;
        padding: 8px;
    }

    .file-icon svg {
        width: 24px;
        height: 24px;
    }

    .table__cell--icon {
        padding: 4px 0;
    }
}

.referral__payouts__count {
    background: rgb(239, 71, 111);
    border-radius: 100%;
    width: 20px;
    height: 20px;
    text-align: center;
    position: absolute;
    top: -6px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
