/* ========== Wiadomosci — paleta jak login ========== */
.msg-shell {
    --msg-ink: #f3f4f6;
    --msg-muted: #9ca3af;
    --msg-line: #3a3a3a;
    --msg-panel: #2c2c2c;
    --msg-soft: #262626;
    --msg-input: #1f1f1f;
    --msg-canvas: #1a1a1a;
    --msg-accent: #c2410c;
    --msg-accent-hover: #ea580c;
    --msg-accent-soft: rgba(194, 65, 12, 0.18);
    --msg-accent-ring: rgba(194, 65, 12, 0.25);
    --msg-danger: #f87171;
    --msg-danger-bg: rgba(127, 29, 29, 0.35);
    --msg-surface: #222222;
    --msg-row-hover: #2a2a2a;

    display: flex;
    min-height: 70vh;
    max-height: calc(100vh - 160px);
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(194, 65, 12, 0.12), transparent 55%),
        linear-gradient(160deg, #1a1a1a 0%, #1e1e1e 50%, #222 100%);
    border: 1px solid var(--msg-line);
    border-radius: 12px;
    overflow: hidden;
    color: var(--msg-ink);
    line-height: 1.4;
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.msg-shell--compose .msg-main {
    display: none;
}

.msg-shell .btn-primary {
    background: var(--msg-accent);
    border-color: var(--msg-accent);
    color: #fff;
}

.msg-shell .btn-primary:hover,
.msg-shell .btn-primary:focus {
    background: var(--msg-accent-hover);
    border-color: var(--msg-accent-hover);
    color: #fff;
}

.msg-shell .btn-default {
    background: var(--msg-input);
    border-color: var(--msg-line);
    color: var(--msg-ink);
}

.msg-shell .btn-default:hover,
.msg-shell .btn-default:focus {
    background: var(--msg-panel);
    border-color: #4b4b4b;
    color: #fff;
}

.msg-shell .btn-link {
    color: var(--msg-muted);
}

.msg-shell .btn-link:hover {
    color: var(--msg-accent-hover);
}

.msg-shell .btn-danger {
    background: #b91c1c;
    border-color: #b91c1c;
}

.msg-shell .form-control {
    background: var(--msg-input);
    border-color: var(--msg-line);
    color: var(--msg-ink);
    box-shadow: none;
}

.msg-shell .form-control:focus {
    border-color: var(--msg-accent);
    box-shadow: 0 0 0 3px var(--msg-accent-ring);
    outline: none;
    background: #1a1a1a;
    color: var(--msg-ink);
}

.msg-shell .form-control::placeholder {
    color: #6b7280;
}

.msg-shell .pagination > li > a,
.msg-shell .pagination > li > span {
    background: var(--msg-input);
    border-color: var(--msg-line);
    color: var(--msg-muted);
}

.msg-shell .pagination > li > a:hover,
.msg-shell .pagination > li > span:hover {
    background: var(--msg-panel);
    border-color: #4b4b4b;
    color: var(--msg-ink);
}

.msg-shell .pagination > .active > a,
.msg-shell .pagination > .active > span,
.msg-shell .pagination > .active > a:hover,
.msg-shell .pagination > .active > span:hover {
    background: var(--msg-accent);
    border-color: var(--msg-accent);
    color: #fff;
}

.msg-shell .pagination > .disabled > a,
.msg-shell .pagination > .disabled > span {
    background: var(--msg-soft);
    border-color: var(--msg-line);
    color: #6b7280;
}

.msg-shell .table {
    color: var(--msg-ink);
}

.msg-shell .table > thead > tr > th {
    border-bottom-color: var(--msg-line);
    color: var(--msg-muted);
}

.msg-shell .table-striped > tbody > tr:nth-of-type(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.msg-shell .table-hover > tbody > tr:hover {
    background: var(--msg-row-hover);
}

.msg-shell .text-muted {
    color: var(--msg-muted) !important;
}

.msg-rail {
    width: 210px;
    flex-shrink: 0;
    background: rgba(38, 38, 38, 0.85);
    border-right: 1px solid var(--msg-line);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg-rail__compose {
    font-weight: 600;
    border-radius: 10px;
    height: 40px;
}

.msg-folders {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--msg-ink);
    text-decoration: none !important;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.msg-folder i {
    width: 18px;
    text-align: center;
    color: var(--msg-muted);
}

.msg-folder:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.msg-folder.active {
    background: var(--msg-accent-soft);
    color: #fdba74;
}

.msg-folder.active i {
    color: var(--msg-accent-hover);
}

.msg-badge {
    margin-left: auto;
    min-width: 20px;
    padding: 1px 7px;
    border-radius: 10px;
    background: var(--msg-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
}

.msg-push {
    margin-top: auto;
    padding: 12px;
    background: var(--msg-input);
    border: 1px solid var(--msg-line);
    border-radius: 10px;
}

.msg-push__title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--msg-ink);
    line-height: 1.35;
}

.msg-push__detail {
    font-size: 11px;
    color: var(--msg-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.msg-push .btn {
    margin-right: 4px;
    margin-bottom: 4px;
}

.msg-main {
    flex: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
}

.msg-list-pane {
    width: 38%;
    min-width: 280px;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--msg-line);
    background: rgba(34, 34, 34, 0.7);
}

.msg-list-pane__header {
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--msg-line);
    background: transparent;
    height: auto;
    line-height: 1.4;
}

.msg-list-pane__title {
    display: block;
    margin: 0 0 10px;
    padding: 0;
    font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--msg-ink);
    line-height: 1.3;
    background: none;
    height: auto;
}

.msg-list-pane__tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.msg-search {
    position: relative;
    flex: 1;
    min-width: 0;
}

.msg-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--msg-muted);
    font-size: 13px;
    pointer-events: none;
    z-index: 1;
}

.msg-search .form-control {
    padding-left: 30px;
    height: 34px;
    border-radius: 8px;
}

.msg-mark-all {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 8px;
}

.msg-feed {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.msg-row {
    display: flex;
    width: 100%;
    text-align: left;
    gap: 10px;
    padding: 12px 14px 12px 16px;
    border: 0;
    border-bottom: 1px solid rgba(58, 58, 58, 0.85);
    background: transparent;
    position: relative;
    transition: background 0.12s ease;
    color: inherit;
    outline: none;
}

.msg-row:hover {
    background: var(--msg-row-hover);
}

.msg-row:focus {
    outline: none;
}

.msg-row.is-active {
    background: var(--msg-accent-soft);
    box-shadow: inset 3px 0 0 var(--msg-accent);
}

.msg-row.is-unread .msg-row__author,
.msg-row.is-unread .msg-row__subject {
    font-weight: 700;
    color: #fff;
}

.msg-row__unread-dot {
    position: absolute;
    left: 6px;
    top: 22px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--msg-accent-hover);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.2);
}

.msg-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(194, 65, 12, 0.45), rgba(234, 88, 12, 0.2));
    color: #fed7aa;
    border: 1px solid rgba(194, 65, 12, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.msg-avatar--sm {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.msg-row__body {
    flex: 1;
    min-width: 0;
}

.msg-row__top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.msg-row__author {
    font-size: 13px;
    color: var(--msg-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-row__time {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--msg-muted);
}

.msg-row__subject {
    display: block;
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-list-pane__footer {
    padding: 8px;
    border-top: 1px solid var(--msg-line);
    text-align: center;
    background: transparent;
    color: inherit;
    font-weight: inherit;
    line-height: normal;
    font-size: inherit;
    margin: 0;
    border-radius: 0;
    height: auto;
}

.msg-list-pane__footer .pagination {
    margin: 0;
}

.msg-reader-pane {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: rgba(26, 26, 26, 0.55);
    overflow: hidden;
}

.msg-reader-back {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    font-weight: 600;
    color: #fdba74;
}

.msg-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--msg-muted);
    padding: 32px 16px;
    text-align: center;
}

.msg-empty i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.45;
    color: var(--msg-accent);
}

.msg-reader {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
    width: 100%;
    left: auto;
    right: auto;
    top: auto;
    padding: 0;
    border: 0;
}

.msg-reader__header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--msg-line);
    background: transparent;
    height: auto;
    line-height: 1.4;
}

.msg-reader__subject {
    display: block;
    margin: 0 0 14px;
    padding: 0;
    font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: #fff;
    background: none;
    height: auto;
}

.msg-chip-important {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--msg-danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--msg-danger);
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    position: relative;
    top: -2px;
    line-height: 1.4;
}

.msg-reader__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-reader__from {
    font-weight: 600;
    font-size: 14px;
    color: var(--msg-ink);
}

.msg-reader__date {
    font-size: 12px;
    color: var(--msg-muted);
}

.msg-seg {
    display: inline-flex;
    margin-top: 14px;
    border: 1px solid var(--msg-line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--msg-input);
}

.msg-seg__btn {
    border: 0;
    background: transparent;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--msg-muted);
}

.msg-seg__btn.active {
    background: var(--msg-accent);
    color: #fff;
}

.msg-reader__content,
.msg-reader__readers,
.msg-reader__delete {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    min-height: 0;
}

.msg-reader__content {
    font-size: 14px;
    line-height: 1.55;
    color: #d1d5db;
}

.msg-reader__content a {
    color: #fb923c;
}

.msg-reader__content a:hover {
    color: var(--msg-accent-hover);
}

.msg-readers-table {
    font-size: 12px;
    margin-bottom: 0;
}

.msg-compose {
    flex: 1;
    display: none;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: transparent;
}

.msg-shell--compose .msg-compose {
    display: flex;
}

.msg-compose__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--msg-line);
    background: transparent;
    height: auto;
    line-height: 1.4;
}

.msg-compose__title {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: #fff;
    background: none;
    height: auto;
    line-height: 1.3;
}

.msg-compose__form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px 0;
}

.msg-compose__error {
    color: var(--msg-danger);
    margin-bottom: 12px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--msg-danger-bg);
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.msg-compose__label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 8px;
    color: #d1d5db;
}

.msg-compose__count {
    font-weight: 500;
    color: var(--msg-muted);
    font-size: 12px;
}

.msg-group-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.msg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 10px;
    border: 1px solid var(--msg-line);
    border-radius: 20px;
    background: var(--msg-input);
    margin: 0;
    font-weight: 500;
    font-size: 12px;
    color: var(--msg-ink);
    cursor: pointer;
}

.msg-chip input {
    margin: 0;
}

.msg-chip.active {
    border-color: var(--msg-accent);
    background: var(--msg-accent-soft);
    color: #fdba74;
}

.msg-chip__more {
    border: 0;
    background: transparent;
    color: var(--msg-muted);
    padding: 0 2px;
}

.msg-chip__more:hover {
    color: var(--msg-accent-hover);
}

.msg-compose__field {
    margin-bottom: 12px;
}

.msg-compose__topic {
    height: 40px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px;
}

.msg-compose__editor {
    flex: 1;
    min-height: 220px;
}

.msg-compose__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 0 16px;
    margin-top: auto;
    margin-bottom: 0;
    background: linear-gradient(to top, #1a1a1a 70%, rgba(26, 26, 26, 0));
    border-top: 1px solid var(--msg-line);
    color: inherit;
    font-weight: inherit;
    line-height: normal;
    font-size: inherit;
    border-radius: 0;
    height: auto;
    z-index: auto;
}

.msg-important-toggle {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-weight: 400;
    max-width: 420px;
    color: var(--msg-ink);
}

.msg-important-toggle input {
    margin-top: 3px;
}

.msg-important-toggle strong {
    display: block;
    font-size: 13px;
}

.msg-important-toggle small {
    display: block;
    color: var(--msg-muted);
    font-size: 11px;
}

.msg-compose__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.msg-account-check {
    display: block;
    font-weight: 400;
    margin-bottom: 6px;
    cursor: pointer;
}

@media (max-width: 991px) {
    .msg-shell {
        flex-direction: column;
        max-height: none;
        min-height: 0;
    }

    .msg-rail {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 12px;
    }

    .msg-rail__compose {
        width: auto;
    }

    .msg-folders {
        flex-direction: row;
        flex: 1;
    }

    .msg-push {
        width: 100%;
        margin-top: 0;
    }

    .msg-main {
        flex-direction: column;
        min-height: 60vh;
    }

    .msg-list-pane {
        width: 100%;
        max-width: none;
        min-height: 50vh;
        border-right: 0;
        border-bottom: 1px solid var(--msg-line);
    }

    .msg-list-pane__tools {
        flex-wrap: wrap;
    }

    .msg-reader-pane {
        display: none;
        min-height: 60vh;
    }

    .msg-shell--reading .msg-list-pane {
        display: none;
    }

    .msg-shell--reading .msg-reader-pane {
        display: flex;
    }

    .msg-reader-back {
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .msg-shell--compose .msg-rail {
        display: none;
    }
}
