:root {
    --bg: #070b16;
    --bg2: #0b1020;
    --card: rgba(17, 24, 39, 0.88);
    --card2: rgba(15, 23, 42, 0.94);
    --border: rgba(148, 163, 184, 0.18);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted2: #64748b;
    --primary: #7c3aed;
    --primary2: #2563eb;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #f59e0b;
    --shadow: 0 22px 70px rgba(0, 0, 0, .35);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 58, 237, .26), transparent 34%),
        radial-gradient(circle at top right, rgba(37, 99, 235, .22), transparent 32%),
        radial-gradient(circle at bottom, rgba(34, 197, 94, .08), transparent 32%),
        linear-gradient(135deg, #050816 0%, #08101f 45%, #050816 100%);
    color: var(--text);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black, transparent 78%);
}

a {
    color: #c4b5fd;
    text-decoration: none;
}

a:hover {
    color: #ffffff;
}

header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    padding: 18px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(7, 11, 22, .78);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

header strong {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    letter-spacing: -.02em;
}

header strong::before {
    content: "⚡";
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    box-shadow: 0 12px 30px rgba(124, 58, 237, .35);
}

header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

header nav a,
header nav span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 9px 13px;
    border-radius: 999px;
    color: #e5e7eb;
    background: rgba(15, 23, 42, .65);
    border: 1px solid rgba(148, 163, 184, .13);
    font-size: 14px;
}

header nav a:hover {
    background: rgba(124, 58, 237, .24);
    border-color: rgba(196, 181, 253, .35);
    transform: translateY(-1px);
}

main {
    width: min(1180px, calc(100% - 36px));
    margin: 44px auto 80px;
    position: relative;
    z-index: 1;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1;
    letter-spacing: -.055em;
}

h2 {
    margin: 0 0 18px;
    font-size: 24px;
    letter-spacing: -.03em;
}

h3 {
    margin-top: 0;
}

p {
    color: #cbd5e1;
}

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

.card {
    position: relative;
    overflow-x: auto;
    background: linear-gradient(180deg, rgba(17, 24, 39, .92), rgba(15, 23, 42, .90));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 35%, rgba(124,58,237,.09));
    opacity: .75;
}

.card > * {
    position: relative;
    z-index: 1;
}

.card:hover {
    border-color: rgba(196, 181, 253, .38);
    box-shadow: 0 24px 90px rgba(0, 0, 0, .45);
}

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

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 22px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 720px;
}

th {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    padding: 0 16px 8px;
    background: transparent;
    border: 0;
}

td {
    padding: 17px 16px;
    color: #e5e7eb;
    background: rgba(2, 6, 23, .46);
    border-top: 1px solid rgba(148, 163, 184, .12);
    border-bottom: 1px solid rgba(148, 163, 184, .12);
}

tr td:first-child {
    border-left: 1px solid rgba(148, 163, 184, .12);
    border-radius: 16px 0 0 16px;
}

tr td:last-child {
    border-right: 1px solid rgba(148, 163, 184, .12);
    border-radius: 0 16px 16px 0;
}

tbody tr {
    transition: transform .18s ease, filter .18s ease;
}

tbody tr:hover {
    transform: translateY(-2px);
    filter: brightness(1.12);
}

.code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 128px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 34px;
    letter-spacing: 5px;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(124, 58, 237, .32), rgba(37, 99, 235, .22));
    border: 1px solid rgba(196, 181, 253, .26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 35px rgba(124, 58, 237, .13);
}

button,
.btn-link,
.refresh-btn,
.small-btn,
.danger-btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    color: white;
    font-weight: 800;
    border-radius: 14px;
    padding: 13px 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary2));
    box-shadow: 0 12px 30px rgba(37, 99, 235, .23);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

button:hover,
.btn-link:hover,
.refresh-btn:hover,
.small-btn:hover,
.danger-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 16px 44px rgba(124, 58, 237, .34);
}

button:active,
.btn-link:active,
.refresh-btn:active,
.small-btn:active,
.danger-btn:active {
    transform: translateY(0);
}

.small-btn {
    width: auto;
    margin: 0;
    padding: 11px 15px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 12px 28px rgba(34, 197, 94, .18);
}

.copy-btn {
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.danger-btn {
    width: auto;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 12px 28px rgba(239, 68, 68, .18);
}

.refresh-btn {
    width: auto;
    margin-top: 10px;
}

.btn-link {
    display: inline-flex;
    text-decoration: none;
}

label {
    display: block;
    margin-top: 14px;
    margin-bottom: 7px;
    color: #dbeafe;
    font-weight: 800;
    font-size: 14px;
}

input,
select {
    width: 100%;
    padding: 13px 14px;
    color: var(--text);
    background: rgba(2, 6, 23, .52);
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 14px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus {
    border-color: rgba(196, 181, 253, .68);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .18);
    background: rgba(2, 6, 23, .72);
}

select option {
    color: #111827;
}

.alert {
    padding: 15px 17px;
    border-radius: 16px;
    margin: 18px 0;
    border: 1px solid transparent;
}

.error {
    background: rgba(239, 68, 68, .12);
    color: #fecaca;
    border-color: rgba(239, 68, 68, .28);
}

.success {
    background: rgba(34, 197, 94, .12);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, .28);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-box {
    width: min(430px, 100%);
    padding: 34px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(17, 24, 39, .94), rgba(15, 23, 42, .92));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-box h1 {
    font-size: 42px;
    margin-bottom: 10px;
}

.login-box p {
    color: var(--muted);
    margin-top: 0;
}

.login-box button {
    width: 100%;
    margin-top: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 180px 180px;
    gap: 16px;
    align-items: end;
}

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

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

.inline-form input,
.inline-form select {
    width: auto;
    min-width: 130px;
    margin: 0;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
    color: #cbd5e1;
}

.check-label input {
    width: auto;
    margin: 0;
}

.mailbox-box {
    background: rgba(2, 6, 23, .34);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    margin-top: 20px;
}

.mailbox-actions {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.assign-box {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

.assign-box .check-label {
    margin-right: 18px;
    margin-bottom: 10px;
}

.settings-form {
    max-width: 560px;
}

.settings-form > div {
    margin-bottom: 20px;
}

.settings-form button {
    max-width: 250px;
}

.qc-trail-dot {
    position: fixed;
    width: 5px;
    height: 5px;
    pointer-events: none;
    z-index: 9999;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(196, 181, 253, .38), rgba(124, 58, 237, .05));
    box-shadow: 0 0 8px rgba(124, 58, 237, .28);
    animation: qcTrailFade .38s ease-out forwards;
}

@keyframes qcTrailFade {
    from {
        opacity: .45;
        scale: 1;
    }
    to {
        opacity: 0;
        scale: 1.8;
    }
}

@media (max-width: 920px) {
    header {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding: 18px;
    }

    header nav {
        justify-content: flex-start;
    }

    main {
        width: min(100% - 24px, 1180px);
        margin-top: 28px;
    }

    .top-row,
    .grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .form-grid,
    .mail-form {
        grid-template-columns: 1fr;
    }

    .code {
        font-size: 28px;
        letter-spacing: 3px;
        min-width: 110px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .qc-trail-dot {
        display: none;
    }
}

/* Smooth cursor glow */
.qc-trail-dot {
    display: none !important;
}

.qc-cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 170px;
    height: 170px;
    pointer-events: none;
    z-index: 9998;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    opacity: 0;
    background: radial-gradient(circle, rgba(124, 58, 237, .16), rgba(37, 99, 235, .08), transparent 68%);
    filter: blur(10px);
    transition: opacity .25s ease, width .2s ease, height .2s ease;
    mix-blend-mode: screen;
}

.qc-cursor-glow.is-visible {
    opacity: .55;
}

.qc-cursor-glow.is-hovering {
    width: 220px;
    height: 220px;
    opacity: .72;
}

@media (max-width: 920px) {
    .qc-cursor-glow {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qc-cursor-glow {
        display: none;
    }
}

/* Wyłączenie efektów myszy */
.qc-trail-dot,
.qc-cursor-glow {
    display: none !important;
}

/* Większe odstępy i czytelniejsze formularze */
main {
    margin-top: 54px;
}

.card {
    margin-bottom: 28px;
    padding: 34px;
}

.card + .card {
    margin-top: 30px;
}

.form-grid,
.mail-form {
    row-gap: 30px;
    column-gap: 24px;
}

label {
    margin-bottom: 10px;
}

input,
select {
    min-height: 52px;
}

.mailbox-box {
    padding: 28px;
    margin-top: 28px;
}

.mailbox-box h3 {
    margin-bottom: 20px;
}

.mailbox-box p {
    margin-bottom: 28px;
}

.mailbox-actions {
    margin-top: 28px;
    margin-bottom: 28px;
}

.assign-box {
    margin-top: 28px;
    padding-top: 24px;
}

h1 {
    margin-bottom: 24px;
}

h2 {
    margin-bottom: 28px;
}

/* Większy oddech na stronie skrzynek */
body:has(form.mail-form) .card {
    margin-bottom: 34px;
}

body:has(form.mail-form) .mail-form {
    margin-top: 8px;
}

/* ===== Poprawki UI: checkboxy, selecty, panel admina ===== */

/* Ładniejsze checkboxy */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    min-height: 28px;
    margin: 0;
    border-radius: 9px;
    border: 2px solid rgba(148, 163, 184, .35);
    background: rgba(2, 6, 23, .65);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: .18s ease;
    position: relative;
}

input[type="checkbox"]:hover {
    border-color: rgba(196, 181, 253, .8);
    box-shadow: 0 0 0 5px rgba(124, 58, 237, .12);
}

input[type="checkbox"]:checked {
    border-color: rgba(34, 197, 94, .75);
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 10px 28px rgba(34, 197, 94, .18);
}

input[type="checkbox"]:checked::after {
    content: "";
    width: 8px;
    height: 15px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.check-label {
    gap: 12px;
    color: #dbeafe;
    font-weight: 800;
}

/* Ładniejsze selecty */
select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 52px;
    padding-right: 46px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .76)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23c4b5fd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: auto, 18px;
    border: 1px solid rgba(148, 163, 184, .25);
    color: #f8fafc;
    font-weight: 700;
}

select:hover {
    border-color: rgba(196, 181, 253, .52);
}

select:focus {
    border-color: rgba(196, 181, 253, .85);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .20);
}

select option {
    background: #111827;
    color: #f8fafc;
    padding: 14px;
}

/* Tabele - większy oddech */
.inline-form {
    gap: 14px;
}

.inline-form input,
.inline-form select {
    min-height: 50px;
}

td {
    padding-top: 22px;
    padding-bottom: 22px;
}

th {
    padding-bottom: 14px;
}

/* Panel admina - równe, większe kafelki */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 30px;
    max-width: 980px;
    align-items: stretch;
}

.dashboard-card {
    min-height: 255px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 38px;
}

.dashboard-card h2 {
    font-size: 30px;
    margin-bottom: 20px;
}

.dashboard-card p {
    font-size: 18px;
    margin-bottom: 28px;
}

.dashboard-card .btn-link {
    width: fit-content;
    min-width: 230px;
    justify-content: center;
    padding: 15px 22px;
    font-size: 16px;
}

/* Lepiej ustawiony panel admina */
body:has(.dashboard-grid) main {
    max-width: 1200px;
}

body:has(.dashboard-grid) h1 {
    margin-bottom: 22px;
}

body:has(.dashboard-grid) main > p {
    font-size: 18px;
    margin-bottom: 30px;
}

/* Na telefonie kafelki jeden pod drugim */
@media (max-width: 920px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .dashboard-card {
        min-height: auto;
    }
}

/* Panel admina - większe i równe kafelki */
body:has(.dashboard-grid) main {
    width: min(1360px, calc(100% - 80px));
    max-width: none;
}

.dashboard-grid {
    width: 100%;
    max-width: none !important;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 36px;
    align-items: stretch;
}

.dashboard-card {
    width: 100%;
    min-height: 310px;
    padding: 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card h2 {
    font-size: 34px;
    margin-bottom: 28px;
}

.dashboard-card p {
    font-size: 20px;
    margin-bottom: 34px;
}

.dashboard-card .btn-link {
    min-width: 270px;
    padding: 17px 26px;
    font-size: 17px;
    justify-content: center;
}

@media (max-width: 920px) {
    body:has(.dashboard-grid) main {
        width: min(100% - 24px, 1180px);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .dashboard-card {
        min-height: auto;
        padding: 30px;
    }
}

/* FIX: równe kafelki w panelu admina */
body:has(.dashboard-grid) main {
    width: min(1500px, calc(100% - 90px));
    max-width: none;
}

.dashboard-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 42px !important;
    width: 100% !important;
    max-width: none !important;
    align-items: stretch !important;
}

/* To naprawia problem, że drugi kafelek był niżej */
.dashboard-grid .card + .card,
.dashboard-grid .dashboard-card + .dashboard-card {
    margin-top: 0 !important;
}

.dashboard-card {
    min-height: 330px !important;
    height: 100% !important;
    width: 100% !important;
    padding: 46px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.dashboard-card h2 {
    font-size: 36px !important;
    margin: 0 0 34px !important;
}

.dashboard-card p {
    font-size: 22px !important;
    margin: 0 0 42px !important;
}

.dashboard-card .btn-link {
    min-width: 300px !important;
    width: fit-content !important;
    padding: 18px 28px !important;
    font-size: 18px !important;
}

@media (max-width: 920px) {
    body:has(.dashboard-grid) main {
        width: min(100% - 24px, 1180px);
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .dashboard-card {
        min-height: auto !important;
    }
}

/* Klikalne logo QuickCode */
.brand-link {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    text-decoration: none;
    border-radius: 16px;
    transition: transform .16s ease, opacity .16s ease;
}

.brand-link:hover {
    color: #ffffff;
    opacity: .92;
    transform: translateY(-1px);
}

.brand-link strong {
    color: #ffffff;
}

/* FIX checkboxów - równo wycentrowany ptaszek */
input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 11px !important;
    border: 2px solid rgba(148, 163, 184, .35) !important;
    background: rgba(2, 6, 23, .65) !important;
    cursor: pointer !important;
    position: relative !important;
    display: inline-block !important;
    vertical-align: middle !important;
    transition: .18s ease !important;
}

input[type="checkbox"]::after {
    content: "" !important;
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    width: 18px !important;
    height: 18px !important;
    transform: translate(-50%, -50%) scale(.75) !important;
    opacity: 0 !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 18px 18px !important;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 6L9 17L4 12' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    transition: .16s ease !important;
}

input[type="checkbox"]:checked {
    border-color: rgba(34, 197, 94, .75) !important;
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    box-shadow: 0 10px 28px rgba(34, 197, 94, .18) !important;
}

input[type="checkbox"]:checked::after {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1) !important;
}

input[type="checkbox"]:hover {
    border-color: rgba(196, 181, 253, .8) !important;
    box-shadow: 0 0 0 5px rgba(124, 58, 237, .12) !important;
}

.check-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
}

/* FIX: równe checkboxy i wyrównanie w jednej linii */
input[type="checkbox"] {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 8px !important;
    vertical-align: middle !important;
    flex: 0 0 26px !important;
}

input[type="checkbox"]::after {
    width: 15px !important;
    height: 15px !important;
    background-size: 15px 15px !important;
}

.check-label {
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Wyrównanie formularzy w tabelach */
.inline-form {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 56px !important;
}

.inline-form input,
.inline-form select {
    height: 50px !important;
    min-height: 50px !important;
}

.inline-form button,
.small-btn,
.danger-btn {
    min-height: 48px !important;
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Wyrównanie checkbox + przyciski w skrzynkach */
.mailbox-box .check-label {
    height: 48px !important;
    align-self: center !important;
}

.mailbox-box button {
    min-height: 48px !important;
}

/* Przypisywanie użytkowników - wszystko w jednej linii */
.assign-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
}

.assign-box h4 {
    width: 100%;
    margin-bottom: 4px;
}

.assign-box .check-label {
    height: 48px !important;
}

/* Status aktywna obok przycisku Zapisz */
.mail-form > div:last-child {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.mail-form > div:last-child button {
    width: auto;
    margin-top: 0;
}

/* Tabela użytkowników - checkbox równo z tekstem */
td .check-label {
    height: 50px !important;
}

/* Szybszy panel użytkownika - loading */
.loading-box {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px;
    border-radius: 18px;
    background: rgba(2, 6, 23, .34);
    border: 1px solid rgba(148, 163, 184, .14);
}

.loading-box p,
.empty-box p {
    margin-bottom: 0;
}

.loader {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 4px solid rgba(148, 163, 184, .22);
    border-top-color: #8b5cf6;
    animation: qcSpin .8s linear infinite;
    flex: 0 0 auto;
}

.empty-box {
    padding: 26px;
    border-radius: 18px;
    background: rgba(2, 6, 23, .34);
    border: 1px solid rgba(148, 163, 184, .14);
}

.empty-box h3 {
    margin-bottom: 8px;
}

@keyframes qcSpin {
    to {
        transform: rotate(360deg);
    }
}

/* QUICK MAIL ALIGNMENT START */
.quick-mail-page main {
    max-width: 1180px;
    margin: 0 auto;
}

.quick-mail-page .card {
    padding: 34px;
}

.quick-mail-page .mail-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 24px;
    align-items: start;
}

.quick-mail-page .mail-form > div {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.quick-mail-page .mail-form label {
    min-height: 22px;
    margin: 0 0 10px 0;
    display: flex;
    align-items: flex-end;
    line-height: 1.2;
}

.quick-mail-page .mail-form input,
.quick-mail-page .mail-form select {
    width: 100%;
    height: 52px;
    box-sizing: border-box;
    margin: 0;
}

.quick-mail-page .mail-form .muted {
    margin: 10px 0 0 0;
    min-height: 38px;
    line-height: 1.35;
}

.quick-mail-page .mail-form button {
    width: 100%;
    height: 52px;
    margin: 0;
    white-space: nowrap;
}

.quick-mail-page .mail-form > div:last-child {
    grid-column: 3;
    align-self: end;
    justify-content: flex-end;
}

.quick-mail-page .mailbox-box {
    margin-top: 18px;
}

@media (max-width: 1000px) {
    .quick-mail-page .mail-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-mail-page .mail-form > div:last-child {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .quick-mail-page .mail-form {
        grid-template-columns: 1fr;
    }

    .quick-mail-page .card {
        padding: 22px;
    }
}
/* QUICK MAIL ALIGNMENT END */

/* QUICK MAIL FINAL LAYOUT FIX */
body.quick-mail-page main {
    max-width: 1180px !important;
    margin: 0 auto !important;
}

body.quick-mail-page h1 {
    margin-bottom: 14px !important;
}

body.quick-mail-page main > p {
    margin-bottom: 18px !important;
}

body.quick-mail-page .card {
    padding: 34px !important;
}

body.quick-mail-page .mail-form {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
}

body.quick-mail-page .mail-form > div {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    align-self: start !important;
}

body.quick-mail-page .mail-form label {
    display: block !important;
    height: 22px !important;
    margin: 0 0 10px 0 !important;
    padding: 0 !important;
    line-height: 22px !important;
    font-size: 14px !important;
}

body.quick-mail-page .mail-form input,
body.quick-mail-page .mail-form select {
    display: block !important;
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

body.quick-mail-page .mail-form .muted {
    display: block !important;
    height: 42px !important;
    margin: 10px 0 0 0 !important;
    line-height: 20px !important;
    overflow: hidden !important;
}

body.quick-mail-page .mail-form > div:nth-child(1),
body.quick-mail-page .mail-form > div:nth-child(2),
body.quick-mail-page .mail-form > div:nth-child(3) {
    grid-row: 1 !important;
}

body.quick-mail-page .mail-form > div:nth-child(4),
body.quick-mail-page .mail-form > div:nth-child(5),
body.quick-mail-page .mail-form > div:nth-child(6) {
    grid-row: 2 !important;
}

body.quick-mail-page .mail-form > div:nth-child(7),
body.quick-mail-page .mail-form > div:nth-child(8),
body.quick-mail-page .mail-form > div:nth-child(9) {
    grid-row: 3 !important;
}

body.quick-mail-page .mail-form > div:nth-child(9) {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    padding-top: 32px !important;
}

body.quick-mail-page .mail-form button {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    margin: 0 !important;
    padding: 0 18px !important;
    white-space: nowrap !important;
}

body.quick-mail-page .mailbox-box {
    margin-top: 16px !important;
}

@media (max-width: 1000px) {
    body.quick-mail-page .mail-form {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    body.quick-mail-page .mail-form > div {
        grid-row: auto !important;
    }

    body.quick-mail-page .mail-form > div:nth-child(9) {
        padding-top: 0 !important;
    }
}

@media (max-width: 700px) {
    body.quick-mail-page .mail-form {
        grid-template-columns: 1fr !important;
    }

    body.quick-mail-page .card {
        padding: 22px !important;
    }
}
/* QUICK MAIL FINAL LAYOUT FIX END */


/* QUICK MAIL REAL FINAL GRID FIX */
body.quick-mail-page .mail-form {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    column-gap: 24px !important;
    row-gap: 28px !important;
    align-items: end !important;
}

body.quick-mail-page .mail-form > input[type="hidden"] {
    display: none !important;
}

body.quick-mail-page .mail-form > div {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(1),
body.quick-mail-page .mail-form > div:nth-of-type(2),
body.quick-mail-page .mail-form > div:nth-of-type(3) {
    grid-row: 1 !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(4),
body.quick-mail-page .mail-form > div:nth-of-type(5),
body.quick-mail-page .mail-form > div:nth-of-type(6) {
    grid-row: 2 !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(7),
body.quick-mail-page .mail-form > div:nth-of-type(8),
body.quick-mail-page .mail-form > div:nth-of-type(9) {
    grid-row: 3 !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(1),
body.quick-mail-page .mail-form > div:nth-of-type(4),
body.quick-mail-page .mail-form > div:nth-of-type(7) {
    grid-column: 1 !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(2),
body.quick-mail-page .mail-form > div:nth-of-type(5),
body.quick-mail-page .mail-form > div:nth-of-type(8) {
    grid-column: 2 !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(3),
body.quick-mail-page .mail-form > div:nth-of-type(6),
body.quick-mail-page .mail-form > div:nth-of-type(9) {
    grid-column: 3 !important;
}

body.quick-mail-page .mail-form label {
    display: block !important;
    height: 22px !important;
    line-height: 22px !important;
    margin: 0 0 10px 0 !important;
}

body.quick-mail-page .mail-form input:not([type="hidden"]),
body.quick-mail-page .mail-form select {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

body.quick-mail-page .mail-form .muted {
    margin: 10px 0 0 0 !important;
    min-height: 40px !important;
    line-height: 20px !important;
}

body.quick-mail-page .mail-form > div:nth-of-type(9) {
    align-self: end !important;
}

body.quick-mail-page .mail-form button {
    width: 100% !important;
    height: 52px !important;
    margin: 0 !important;
}

@media (max-width: 1000px) {
    body.quick-mail-page .mail-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.quick-mail-page .mail-form > div {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

@media (max-width: 700px) {
    body.quick-mail-page .mail-form {
        grid-template-columns: 1fr !important;
    }
}
/* QUICK MAIL REAL FINAL GRID FIX END */

