* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    color: #fff;
    background: radial-gradient(circle at 30% 20%, #202a55, #070812 65%);
}

.auth-page,
.dashboard,
.admin-page {
    min-height: 100vh;
}

.auth-page,
.dashboard {
    display: grid;
    place-items: center;
    padding: 32px;
}

.admin-page {
    padding: 28px;
}

.panel {
    width: min(520px, 100%);
    padding: 36px;
    border-radius: 18px;
    background: rgba(12, 14, 24, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

.panel.wide {
    width: min(920px, 100%);
}

h1 {
    margin: 0 0 28px;
    font-size: 40px;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-weight: 700;
}

input,
select,
button {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 10px;
    padding: 0 16px;
    font: inherit;
}

input,
select {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

button {
    margin-top: 22px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(90deg, #c016c9, #722ff0);
}

.pay-button {
    background: linear-gradient(90deg, #00b894, #0984e3);
}

.notice {
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(0, 184, 148, 0.18);
    border: 1px solid rgba(0, 184, 148, 0.45);
}

.mac {
    direction: ltr;
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.status-grid span {
    padding: 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.playlist-list {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.playlist-list h2 {
    margin: 0;
    font-size: 24px;
}

.playlist-item,
.playlist-admin-row {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.playlist-item button,
.playlist-admin-row button,
.playlist-admin-form button {
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0 12px;
    font-size: 14px;
}

.playlist-admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.playlist-admin-form input,
.playlist-admin-form select {
    min-height: 40px;
}

@media (max-width: 720px) {
    .status-grid {
        grid-template-columns: 1fr;
    }
}

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

.admin-header h1,
.admin-header p {
    margin: 0;
}

.logout-link {
    color: #fff;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stats-row div,
.admin-card {
    border-radius: 14px;
    background: rgba(12, 14, 24, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-row div {
    padding: 18px;
}

.stats-row strong {
    display: block;
    font-size: 34px;
}

.stats-row span {
    color: rgba(255, 255, 255, 0.72);
}

.admin-card {
    padding: 22px;
    margin-bottom: 24px;
}

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

.admin-card-header h2 {
    margin: 0;
}

.admin-search,
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-search input {
    width: 220px;
}

.admin-search button,
.admin-search a,
.bulk-actions button {
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
}

.admin-search a {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
}

.bulk-actions {
    justify-content: flex-start;
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    font-weight: 700;
}

.danger,
.bulk-actions .danger {
    background: linear-gradient(90deg, #d63031, #b71540);
}

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

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-devices-table {
    min-width: 1280px;
}

th,
td {
    text-align: right;
    vertical-align: top;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    color: #9fffea;
}

.ltr {
    direction: ltr;
    text-align: left;
}

.select-col {
    width: 42px;
    text-align: center;
}

.select-col input {
    width: 18px;
    min-height: 18px;
    height: 18px;
    padding: 0;
}

td small {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.62);
}

.inline-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.inline-actions input {
    width: 56px;
    min-height: 32px;
    padding: 0 8px;
}

.inline-actions button {
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
}

.inline-actions .danger {
    background: linear-gradient(90deg, #d63031, #b71540);
}

.admin-page input,
.admin-page select {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 12px;
}

.playlist-admin-row {
    gap: 6px;
    padding: 8px;
    border-radius: 8px;
}

.playlist-admin-row strong {
    font-size: 13px;
}

.playlist-admin-row small.ltr {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-admin-row form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.playlist-admin-row label,
.playlist-admin-form label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    white-space: nowrap;
    font-size: 12px;
}

.playlist-admin-row input[type="checkbox"],
.playlist-admin-form input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    height: 16px;
    padding: 0;
}

.playlist-admin-form {
    grid-template-columns: 110px 86px minmax(150px, 1.3fr) minmax(130px, 1fr) 90px 90px 76px 70px;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.playlist-admin-form input,
.playlist-admin-form select {
    min-width: 0;
    min-height: 32px;
}

.playlist-admin-form button,
.playlist-admin-row button {
    min-height: 32px;
    padding: 0 9px;
    border-radius: 8px;
    font-size: 12px;
}

.playlist-form-row td {
    padding-top: 6px;
    padding-bottom: 12px;
    background: rgba(255, 255, 255, 0.025);
}

.playlist-admin-form-wide {
    display: grid;
    grid-template-columns: 150px 86px 220px 200px 100px 100px 70px 72px;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0;
    justify-content: start;
}

.playlist-admin-form-wide input,
.playlist-admin-form-wide select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
}

.playlist-admin-form-wide label {
    justify-content: center;
    min-height: 34px;
    padding: 0 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
}

.playlist-admin-form-wide button {
    width: 100%;
    min-height: 34px;
    margin: 0;
}

@media (max-width: 900px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-card-header,
    .admin-search,
    .bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-search input,
    .admin-search button,
    .admin-search a,
    .bulk-actions button {
        width: 100%;
    }
}
