* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: #0f172a;
}

a {
    color: #2563eb;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
}

.sidebar {
    background: #111827;
    color: #fff;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.menu {
    display: grid;
    gap: 10px;
}

.menu-item,
.ghost-btn,
.range-btn,
button[type="submit"] {
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

.menu-item {
    text-align: left;
    padding: 12px 14px;
    background: #1f2937;
    color: #d1d5db;
}

.menu-item.active {
    background: #2563eb;
    color: #fff;
}

.sidebar-foot {
    font-size: 14px;
    color: #9ca3af;
}

.main {
    background: #f8fafc;
    padding: 24px;
}

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

.topbar h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.topbar p {
    margin: 0;
    color: #64748b;
}

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

.badge {
    padding: 8px 12px;
    background: #e2e8f0;
    border-radius: 999px;
    color: #334155;
}

.ghost-btn {
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-decoration: none;
    white-space: nowrap;
}

.auth-grid,
.cards,
.grid-3,
.package-list {
    display: grid;
    gap: 16px;
}

.auth-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.package-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card {
    margin-top: 16px;
}

.contact-card img {
    display: block;
    width: 100%;
    max-width: 280px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.hidden-purchase-btn {
    display: none !important;
}

.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 20px;
}

.metric span {
    display: block;
    color: #64748b;
    margin-bottom: 8px;
}

.metric strong {
    font-size: 22px;
}

.form {
    display: grid;
    gap: 12px;
}

.inline-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
}

button[type="submit"],
.section-title button,
.api-key-item button {
    padding: 12px 16px;
    background: #2563eb;
    color: #fff;
}

.actions,
.inline-actions,
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}


.table-actions-wrap {
    flex-wrap: wrap;
}

.table-input {
    min-width: 190px;
}

.inline-actions {
    flex-wrap: wrap;
}

.inline-actions input {
    min-width: 220px;
}

.pagination-bar {
    justify-content: space-between;
    margin-top: 16px;
}

.danger-btn {
    background: #dc2626 !important;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.setting-card,
.payment-flow-box {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #f8fafc;
}

.payment-flow-box {
    margin-bottom: 16px;
}

.payment-flow-box h3,
.setting-card h3 {
    margin-top: 0;
}

.payment-flow-list {
    margin: 0;
    padding-left: 20px;
    color: #334155;
}

.payment-flow-list li {
    margin-bottom: 8px;
}

.switch-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.switch-line input {
    width: auto;
}

.section-title,
.api-key-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    font-size: 14px;
}

.pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 12px;
    overflow: auto;
    min-height: 80px;
}

.form-hint {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.download-box {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed #93c5fd;
    border-radius: 12px;
    background: #eff6ff;
}

.download-box a {
    font-weight: 600;
}

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

.cashier-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}

.cashier-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
}

.cashier-qr img {
    max-width: 100%;
    height: auto;
    display: block;
}

.cashier-info p {
    margin: 0 0 12px;
    word-break: break-all;
}

.single-page-layout {
    min-height: 100vh;
    display: block;
}

.single-page-main {
    width: min(960px, 100%);
    margin: 0 auto;
}

.message {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #dbeafe;
    color: #1d4ed8;
}

.api-key-list {
    display: grid;
    gap: 12px;
}

.api-key-item {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
}

.package-item {
    border: 1px solid #dbeafe;
    background: #eff6ff;
    padding: 16px;
    border-radius: 12px;
}

.package-item button {
    margin-top: 8px;
}

.tab,
.hidden {
    display: none;
}

.tab.active {
    display: block;
}

@media (max-width: 980px) {
    .layout,
    .auth-grid,
    .cards,
    .package-list,
    .inline-form,
    .grid-3,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .cashier-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}
