:root {
    --blue: #3f66f0;
    --blue-dark: #254bd2;
    --bg: #17191f;
    --line: #d9dce5;
    --text: #181b24;
    --muted: #6f7480;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top, #30343d, var(--bg));
    color: var(--text);
}

a {
    color: var(--blue);
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.transfer-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.brand {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.brand img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    border-radius: 50%;
}

.brand-wide img {
    width: 210px;
    height: auto;
    max-height: 120px;
    border-radius: 0;
}

.top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    font-size: 14px;
}

.top-actions a {
    color: var(--muted);
    text-decoration: none;
}

.upload-form {
    display: grid;
    gap: 14px;
}

.upload-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.captcha-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
    min-height: 78px;
}

input,
textarea,
select {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 2px;
    font: inherit;
    outline: none;
    color: var(--text);
    background: transparent;
}

select {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.file-box {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 118px;
    overflow: hidden;
    border-radius: 12px;
    background: #e9efff;
    color: var(--text) !important;
    display: grid !important;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.file-box input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.file-box strong {
    display: block;
    margin-top: 8px;
    font-size: 16px;
}

.file-box small {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

.upload-progress {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid #dbe3ff;
    border-radius: 14px;
    background: #f6f8ff;
}

.bucket {
    position: relative;
    width: 64px;
    height: 76px;
    overflow: hidden;
    border: 4px solid #93a8ef;
    border-top-width: 2px;
    border-radius: 8px 8px 18px 18px;
    background: #fff;
    box-shadow: inset 0 0 0 3px rgba(63, 102, 240, 0.06);
}

.bucket::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 34px;
    height: 12px;
    border: 3px solid #93a8ef;
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    transform: translate(-50%, -100%);
}

.bucket-fill {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 0;
    background: linear-gradient(180deg, #62c7ff, var(--blue));
    transition: height 180ms ease-out;
}

.bucket-fill::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -10%;
    width: 120%;
    height: 10px;
    border-radius: 50%;
    background: #8ed9ff;
    animation: water-wave 1.2s ease-in-out infinite alternate;
}

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe5f5;
}

.progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #62c7ff, var(--blue));
    transition: width 180ms ease-out;
}

.upload-progress p {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.upload-progress .upload-error {
    color: #b42318;
    font-weight: 400;
    text-align: center;
}

.upload-progress.has-error .progress-bar,
.upload-progress.has-error .bucket-fill {
    background: #dc2626;
}

button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@keyframes water-wave {
    from {
        transform: translateX(-3px) rotate(-1deg);
    }
    to {
        transform: translateX(3px) rotate(1deg);
    }
}

button,
.copy-btn,
.whatsapp-btn {
    border: 0;
    border-radius: 14px;
    padding: 15px 18px;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

button:hover,
.copy-btn:hover,
.whatsapp-btn:hover {
    background: var(--blue-dark);
}

.admin-link {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: var(--muted);
    text-decoration: none;
}

.flash {
    position: fixed;
    top: 16px;
    left: 50%;
    width: min(420px, calc(100% - 32px));
    transform: translateX(-50%);
    background: #fff4e0;
    border: 1px solid #ffd38c;
    border-radius: 12px;
    padding: 10px 14px;
    z-index: 10;
}

.flash p {
    margin: 0;
}

.success-card {
    text-align: center;
}

.login-card h1,
.login-card .muted {
    text-align: center;
}

h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.muted {
    color: var(--muted);
}

.share-box {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin: 18px 0;
}

.share-box input {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #1fb859;
}

.wa-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: #25d366;
    font-size: 11px;
    font-weight: 800;
}

.admin-page {
    width: min(1200px, 100%);
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #eef0f5;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
    overflow-wrap: anywhere;
}

th {
    background: #f7f8fb;
}

.filename-cell,
.share-link-cell,
.text-cell {
    max-width: 220px;
}

.filename-cell span,
.share-link-cell a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.share-link-cell a {
    word-break: break-all;
}

.text-cell div {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.message-cell div {
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge.active {
    color: #0c7d3a;
    background: #e8f8ef;
}

.badge.expired {
    color: #b42318;
    background: #fff0ee;
}

.badge.inactive {
    color: #5f2933;
    background: #fbe9ed;
}

.action-cell {
    min-width: 130px;
}

.action-cell form {
    margin-top: 10px;
}

.small-danger,
.small-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 105px;
    border-radius: 8px;
    padding: 9px 12px;
    color: #fff;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.small-danger {
    background: #dc2626;
}

.small-danger:hover {
    background: #b91c1c;
}

.small-success {
    background: #16a34a;
}

.small-success:hover {
    background: #15803d;
}

.empty {
    text-align: center;
    color: var(--muted);
}

@media (max-width: 560px) {
    .page {
        padding: 16px;
        align-items: flex-start;
    }

    .share-box {
        grid-template-columns: 1fr;
    }

    .admin-page {
        padding: 14px;
    }
}
