* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family:
        Arial,
        "Noto Sans",
        sans-serif;
    background: #f3f4f6;
    color: #111827;
}

body {
    overflow-x: hidden;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.top-header,
.chat-header {
    height: 60px;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 20px;
    font-weight: 700;
}

.brand .material-icons {
    font-size: 27px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.icon-btn:hover {
    background: rgba(255,255,255,.12);
}

.auth-container,
.install-wrap {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card,
.install-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 22px;
    padding: 25px;
    box-shadow:
        0 15px 40px rgba(0,0,0,.10);
}

.logo-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #111827;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto;
}

.logo-circle .material-icons {
    font-size: 34px;
}

.auth-card h1,
.install-card h1 {
    text-align: center;
    margin-bottom: 5px;
}

.muted {
    text-align: center;
    color: #6b7280;
}

.tabs {
    display: flex;
    gap: 5px;
    margin: 25px 0;
    background: #f3f4f6;
    padding: 5px;
    border-radius: 12px;
}

.tab {
    flex: 1;
    border: 0;
    padding: 12px;
    border-radius: 9px;
    background: transparent;
}

.tab.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    font-weight: bold;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin: 13px 0 7px;
}

input,
select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 11px;
    padding: 12px 13px;
    outline: none;
    background: white;
}

input:focus,
select:focus {
    border-color: #111827;
}

.input-box {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d1d5db;
    border-radius: 11px;
    padding-left: 11px;
}

.input-box input {
    border: 0;
}

.main-btn {
    width: 100%;
    margin-top: 18px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: white;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.main-btn:hover {
    opacity: .92;
}

.alert {
    padding: 12px;
    border-radius: 11px;
    margin: 15px 0;
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.success {
    background: #dcfce7;
    color: #166534;
}

.warning {
    background: #fef3c7;
    color: #92400e;
}

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

.big-icon {
    font-size: 60px;
}

.danger-btn {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: 12px;
    background: #dc2626;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-body {
    height: 100dvh;
    overflow: hidden;
}

.chat-app {
    height: calc(100dvh - 60px);
    display: flex;
    flex-direction: column;
}

.profile-bar {
    min-height: 62px;
    padding: 10px 15px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-bar small {
    display: block;
    color: #6b7280;
    margin-top: 3px;
}

.quota {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: bold;
}

.target-section {
    background: white;
    padding: 10px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.target-row {
    display: flex;
    gap: 7px;
}

.verify-btn {
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: white;
    padding: 0 12px;
    display: flex;
    gap: 5px;
    align-items: center;
}

.good {
    color: #15803d;
    font-size: 13px;
    display: block;
    margin-top: 5px;
}

.bad {
    color: #dc2626;
    font-size: 13px;
    display: block;
    margin-top: 5px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f9fafb;
    scroll-behavior: auto;
}

.empty-chat {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    text-align: center;
}

.empty-chat .material-icons {
    font-size: 45px;
}

.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 9px;
}

.message.mine {
    align-items: flex-end;
}

.message.theirs {
    align-items: flex-start;
}

.bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 15px;
    word-break: break-word;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,.06);
}

.message.mine .bubble {
    background: #111827;
    color: white;
}

.message small {
    color: #9ca3af;
    font-size: 10px;
    margin: 3px 5px;
}

.composer {
    min-height: 64px;
    padding: 9px;
    background: white;
    display: flex;
    gap: 8px;
    border-top: 1px solid #e5e7eb;
}

.composer input {
    flex: 1;
    min-width: 0;
}

.send-btn {
    width: 48px;
    border: 0;
    border-radius: 50%;
    background: #111827;
    color: white;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 500;
    padding: 15px;
    overflow-y: auto;
}

.modal.show {
    display: block;
}

.modal-card {
    max-width: 700px;
    margin: 35px auto;
    background: white;
    border-radius: 20px;
    padding: 18px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.plan-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 15px;
    text-align: center;
}

.plan-card .material-icons {
    font-size: 32px;
}

.plan-card strong {
    font-size: 25px;
}

.upi-box {
    padding: 20px;
    text-align: center;
    border: 1px dashed #9ca3af;
    border-radius: 15px;
}

.install-popup {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 15px;
    background: #111827;
    color: white;
    padding: 13px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateY(150%);
    transition: .3s;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.install-popup.show {
    transform: translateY(0);
}

.install-popup div {
    flex: 1;
}

.install-popup small {
    display: block;
    opacity: .7;
    margin-top: 3px;
}

.install-popup button {
    border: 0;
    border-radius: 9px;
    padding: 9px 12px;
}

.close-btn {
    background: transparent !important;
    color: white;
}

.admin-container {
    max-width: 1300px;
    margin: auto;
    padding: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit,minmax(180px,1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat,
.admin-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 5px 20px rgba(0,0,0,.06);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat strong {
    font-size: 27px;
}

.admin-card {
    margin-bottom: 18px;
}

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

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

th,
td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f9fafb;
}

.small-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #111827;
    color: white;
}

@media (max-width:600px) {

    .auth-card,
    .install-card {
        padding: 20px;
    }

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

    .admin-container {
        padding: 10px;
    }
}