﻿﻿/* =============================================================================
   CritMC Admin Panel — Light Theme
   ============================================================================= */

/* Site tab panels — ukryte domyślnie, widoczne tylko z klasą sp-active */
.site-tab-panel           { display: none !important; }
.site-tab-panel.sp-active { display: block !important; }

:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1a2e;
    --bg-sidebar-hover: rgba(255,255,255,0.07);
    --bg-sidebar-active: rgba(255,255,255,0.12);
    --bg-topbar: #ffffff;

    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-sidebar: rgba(255,255,255,0.75);
    --text-sidebar-active: #ffffff;

    --border: #e5e7eb;
    --border-strong: #d1d5db;

    --accent: #ff1744;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;

    --color-ban: #ef4444;
    --color-mute: #f59e0b;
    --color-unban: #10b981;
    --color-unmute: #10b981;
    --color-kick: #6366f1;
    --color-warn: #f97316;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);

    --sidebar-width: 260px;
    --topbar-height: 60px;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.2s ease;

    --font: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* =============================================================================
   LOGIN SCREEN
   ============================================================================= */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 1rem;
}

.login-box {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-crit {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--accent);
}

.login-logo-mc {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--text-primary);
}

.login-logo-sub {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.3rem;
}

.login-field {
    margin-bottom: 1.2rem;
}

.login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.login-field label i {
    margin-right: 0.4rem;
    color: var(--accent);
}

.login-field input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.login-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,23,68,0.1);
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    width: 100%;
    padding-right: 2.8rem;
}

.pw-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.2rem;
    transition: color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pw-toggle:hover {
    color: var(--accent);
}

.login-error {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    color: #ef4444;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-btn:hover {
    background: #d50032;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255,23,68,0.35);
}

/* =============================================================================
   LAYOUT
   ============================================================================= */

.admin-panel {
    display: flex;
    min-height: 100vh;
}

/* =============================================================================
   SIDEBAR
   ============================================================================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.5px;
}

.sl-crit {
    color: var(--accent);
}

.sl-mc {
    color: #ffffff;
}

.sidebar-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.2rem;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.8rem;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 0.5rem;
    margin-bottom: 0.5rem;
}

.nav-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: transparent;
    border: none;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    margin-bottom: 0.2rem;
    position: relative;
}

.nav-btn i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.nav-btn.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    border-left: 3px solid var(--accent);
}

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    min-width: 1.3rem;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.su-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.su-info {
    min-width: 0;
}

.su-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.su-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    margin-top: 0.1rem;
}

.logout-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(239,68,68,0.2);
    border-color: rgba(239,68,68,0.4);
    color: #ef4444;
}

/* =============================================================================
   MAIN CONTENT
   ============================================================================= */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    min-width: 0;
}

/* TOPBAR */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    justify-content: space-between;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(16,185,129,0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.offline {
    background: #9ca3af;
}

.status-dot.loading {
    background: var(--accent-yellow);
    animation: pulse-yellow 1.5s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 4px rgba(16,185,129,0.4); }
    50% { box-shadow: 0 0 10px rgba(16,185,129,0.7); }
}
@keyframes pulse-yellow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* PAGES */
.page {
    display: none;
    padding: 1.5rem;
    flex: 1;
    animation: pageIn 0.25s ease forwards;
    min-width: 0;
    overflow-x: hidden;
}

.page.active {
    display: block;
}

/* Duplikat animacji usunięty - jest już w .page { animation: pageIn... } */

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.page-header p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* =============================================================================
   FILTERS BAR
   ============================================================================= */

.filters-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
    align-items: center;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.filter-search i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-search input {
    width: 100%;
    padding: 0.62rem 0.9rem 0.62rem 2.4rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-search input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.filter-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.filter-group select,
.filter-group input[type="date"] {
    padding: 0.62rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition);
    font-family: var(--font);
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
    border-color: var(--accent-blue);
}

/* =============================================================================
   TABLE CARD
   ============================================================================= */

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead tr {
    border-bottom: 1.5px solid var(--border);
    background: #f9fafb;
}

.data-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: rgba(59,130,246,0.03);
    transition: background 0.15s ease;
}

.table-loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
    font-size: 0.95rem;
}

.table-loading i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.table-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem !important;
    font-size: 0.95rem;
}

/* Player cell */
.player-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-head {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    image-rendering: pixelated;
    flex-shrink: 0;
}

.player-name {
    font-weight: 700;
    color: var(--text-primary);
}

.player-uuid {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 0.1rem;
    font-family: monospace;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-vip     { background: rgba(252,132,251,0.12); color: #c026d3; border: 1px solid rgba(192,38,211,0.2); }
.badge-boss    { background: rgba(59,130,246,0.1); color: #2563eb; border: 1px solid rgba(37,99,235,0.2); }
.badge-crit    { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.badge-chatmod { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.badge-pomocnik{ background: rgba(16,185,129,0.12); color: #047857; border: 1px solid rgba(4,120,87,0.25); }
.badge-moderator{ background: rgba(139,92,246,0.1); color: #7c3aed; border: 1px solid rgba(124,58,237,0.2); }
.badge-admin   { background: rgba(239,68,68,0.12); color: #b91c1c; border: 1px solid rgba(185,28,28,0.25); }
.badge-zarzadzajacy { background: rgba(255,23,68,0.12); color: #ff1744; border: 1px solid rgba(255,23,68,0.3); }
.badge-default { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }

.badge-online  { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.badge-offline { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.badge-banned  { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.badge-muted   { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }

.badge-action-ban    { background: rgba(239,68,68,0.1); color: #dc2626; border: 1px solid rgba(220,38,38,0.2); }
.badge-action-unban  { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.badge-action-mute   { background: rgba(245,158,11,0.1); color: #d97706; border: 1px solid rgba(217,119,6,0.2); }
.badge-action-unmute { background: rgba(16,185,129,0.1); color: #059669; border: 1px solid rgba(5,150,105,0.2); }
.badge-action-kick   { background: rgba(99,102,241,0.1); color: #4f46e5; border: 1px solid rgba(79,70,229,0.2); }
.badge-action-warn   { background: rgba(249,115,22,0.1); color: #ea580c; border: 1px solid rgba(234,88,12,0.2); }

/* Table action btns */
.tbl-btn {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.tbl-btn:hover {
    background: var(--bg);
    border-color: var(--accent);
    color: var(--accent);
}

.tbl-btn.tbl-btn-green:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.tbl-btn.tbl-btn-red:hover {
    border-color: var(--color-ban);
    color: var(--color-ban);
}

/* =============================================================================
   MODAL
   ============================================================================= */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease forwards;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.3);
    color: #ef4444;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.modal-player-info {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.modal-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.modal-field input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font);
}

.modal-field input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Action buttons in modal */
.action-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg);
    color: var(--text-secondary);
    border-color: var(--border);
}

.action-btn:hover, .action-btn.selected {
    color: #fff;
}

.ban-btn:hover, .ban-btn.selected     { background: var(--color-ban); border-color: var(--color-ban); color:#fff; }
.unban-btn:hover, .unban-btn.selected  { background: var(--color-unban); border-color: var(--color-unban); color:#fff; }
.mute-btn:hover, .mute-btn.selected   { background: var(--color-mute); border-color: var(--color-mute); color:#fff; }
.unmute-btn:hover, .unmute-btn.selected{ background: var(--color-unmute); border-color: var(--color-unmute); color:#fff; }
.kick-btn:hover, .kick-btn.selected   { background: var(--color-kick); border-color: var(--color-kick); color:#fff; }
.warn-btn:hover, .warn-btn.selected   { background: var(--color-warn); border-color: var(--color-warn); color:#fff; }
.alts-btn:hover, .alts-btn.selected   { background: #8b5cf6; border-color: #8b5cf6; color:#fff !important; }
.message-btn:hover, .message-btn.selected { background: #3b82f6; border-color: #3b82f6; color:#fff !important; }

/* Duration buttons */
.duration-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.dur-btn {
    padding: 0.4rem 0.8rem;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.dur-btn:hover, .dur-btn.selected {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.dur-btn.perm-btn:hover, .dur-btn.perm-btn.selected {
    background: var(--color-ban);
    border-color: var(--color-ban);
    color: #fff;
}

.modal-msg {
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
}

.modal-msg.success {
    background: rgba(16,185,129,0.1);
    border: 1px solid rgba(16,185,129,0.25);
    color: #059669;
}

.modal-msg.error {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    color: #dc2626;
}

.modal-submit-btn {
    padding: 0.85rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font);
}

.modal-submit-btn:hover {
    background: #d50032;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,23,68,0.35);
}

.modal-submit-btn:disabled {
    background: var(--border-strong);
    color: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* =============================================================================
   TOAST NOTIFICATIONS
   ============================================================================= */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.25s ease forwards;
    min-width: 260px;
    max-width: 360px;
}

.toast.toast-success { border-left: 3px solid var(--accent-green); }
.toast.toast-success i { color: var(--accent-green); }
.toast.toast-error   { border-left: 3px solid var(--color-ban); }
.toast.toast-error i { color: var(--color-ban); }
.toast.toast-info    { border-left: 3px solid var(--accent-blue); }
.toast.toast-info i  { color: var(--accent-blue); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .page {
        padding: 1rem;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input[type="date"] {
        flex: 1;
    }

    .action-btns {
        justify-content: flex-start;
    }
}

/* Przycisk powrotu do strony głównej */
.back-to-main-btn {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.9rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}

.back-to-main-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.back-to-main-btn span {
    display: none;
}

@media (min-width: 640px) {
    .back-to-main-btn span {
        display: inline;
    }
}

/* Grid strony Nadaj karę */
.action-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .action-page-grid {
        grid-template-columns: 1fr;
    }
}

/* Przycisk Sprawdź */
.check-btn:hover, .check-btn.selected {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #fff;
}

.badge-action-check {
    background: rgba(14,165,233,.1);
    color: #0284c7;
    border: 1px solid rgba(2,132,199,.2);
}

/* Statystyki — karty overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 900px) {
    .stats-overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .stats-overview { grid-template-columns: 1fr; }
}

/* Online pulse w tabeli */
.badge-online i {
    animation: pulse-online 2s ease-in-out infinite;
}
@keyframes pulse-online {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Multikonta modal popup style */
.alts-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 480px;
    animation: modalIn 0.2s ease forwards;
}

.alts-popup h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alts-popup .alt-account {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 0.9rem;
}

.alts-popup .alt-account:last-child {
    margin-bottom: 0;
}

.modal-field.message-field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text-primary);
    background: var(--bg-card);
    outline: none;
    resize: vertical;
    min-height: 80px;
    font-family: var(--font);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.modal-field.message-field textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* =============================================================================
   SKLEP
   ============================================================================= */

.shop-media-preview {
    width: 100%;
    max-height: 260px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: var(--bg);
    margin-bottom: .75rem;
}

.shop-media-preview img,
.shop-media-preview video {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-sm);
}

/* =============================================================================
   STRONA INFORMACJE — karty statusu
   ============================================================================= */

.info-status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.info-status-card:hover {
    box-shadow: var(--shadow-md);
}

/* =============================================================================
   PANEL "NADAJ KARĘ" — lista graczy
   ============================================================================= */

#ap-players-list > div:last-child {
    border-bottom: none !important;
}

#ap-players-list > div:hover {
    background: var(--bg) !important;
}

/* =============================================================================
   OGÓLNE POPRAWKI WIZUALNE
   ============================================================================= */

/* Lepsze scrollbary */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Płynniejsze przejścia kart */
.table-card {
    transition: box-shadow 0.2s ease;
}
.table-card:hover {
    box-shadow: var(--shadow-md);
}

/* Lepsze focus dla inputów */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* Animacja fade - przeniesiona do .page { animation: ... } */

/* Badge dla graczy online — pulsowanie */
.badge-online i.fa-circle {
    animation: pulse-online 2s ease-in-out infinite;
}

/* Przycisk "Wykonaj akcję" — lepszy wygląd */
#page-action button[onclick="apSubmit()"] {
    transition: all 0.2s ease;
}
#page-action button[onclick="apSubmit()"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(255,23,68,0.35);
}

/* Tabela sklepu — podgląd media w kolumnie */
#shop-items-tbody img {
    transition: transform 0.15s ease;
}
#shop-items-tbody tr:hover img {
    transform: scale(1.1);
}

/* Modal — lepsza animacja */
.modal-box {
    animation: modalIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(-12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Nav badge — animacja przy zmianie */
.nav-badge {
    transition: all 0.3s ease;
}

/* Topbar — shadow przy scrollu (via JS) */
.topbar.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.1);
}

/* Filtry — lepsza responsywność */
.filters-bar {
    align-items: flex-start;
}

/* Tabela — zaznaczony wiersz */
.data-table tbody tr.selected {
    background: rgba(59,130,246,0.06);
}

/* Strona info — tabela danych sesji */
#info-session-table td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
#info-session-table tr:last-child td {
    border-bottom: none;
}

/* Przyciski site-tab — lepsza responsywność */
@media (max-width: 600px) {
    .site-tab-btn span {
        display: none;
    }
    .site-tab-btn {
        padding: .5rem .75rem;
    }
}

/* Logi akcji — kolorowe tło wierszy */
.badge-action-ban     { font-weight: 700; }
.badge-action-mute    { font-weight: 700; }
.badge-action-kick    { font-weight: 700; }
.badge-action-warn    { font-weight: 700; }
.badge-action-unban   { font-weight: 700; }
.badge-action-unmute  { font-weight: 700; }
.badge-action-check   { font-weight: 700; }

/* =============================================================================
   SKLEP — KARTY PRODUKTÓW
   ============================================================================= */

.shop-product-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.shop-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.shop-product-card .card-media {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
    font-size: 3rem;
    flex-shrink: 0;
}

.shop-product-card .card-media img,
.shop-product-card .card-media video {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.shop-product-card .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.shop-product-card .card-name {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.shop-product-card .card-desc {
    font-size: .78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-product-card .card-price {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-top: auto;
}

.shop-product-card .card-price-main {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent);
}

.shop-product-card .card-price-old {
    font-size: .8rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.shop-product-card .card-price-currency {
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.shop-product-card .card-footer {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: .5rem;
    background: var(--bg);
}

.shop-product-card .card-badge {
    position: absolute;
    top: .6rem;
    right: .6rem;
}

.shop-product-card .card-status-hidden {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: .05em;
    pointer-events: none;
    border-radius: var(--radius);
}


/* =============================================================================
   RICH TEXT EDITOR (Aktualności)
   ============================================================================= */

.rte-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: .82rem;
    transition: all .15s ease;
    flex-shrink: 0;
    padding: 0;
}

.rte-btn:hover {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--accent);
}

.rte-btn.active {
    background: rgba(59,130,246,.1);
    border-color: rgba(59,130,246,.3);
    color: #3b82f6;
}

#news-editor:empty:before {
    content: attr(placeholder);
    color: var(--text-secondary);
    pointer-events: none;
}

#news-editor:focus {
    box-shadow: inset 0 0 0 2px rgba(59,130,246,.15);
}

#news-editor img {
    max-width: 100%;
    border-radius: 8px;
    margin: .4rem 0;
}

/* =============================================================================
   SKLEP — KATEGORIE (zakładki)
   ============================================================================= */

.shop-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s ease;
    font-family: var(--font);
    white-space: nowrap;
}

.shop-cat-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,23,68,.04);
}

.shop-cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.shop-cat-btn.active[data-cat="ranga"] { background: #8b5cf6; border-color: #8b5cf6; }
.shop-cat-btn.active[data-cat="klucz"] { background: #f59e0b; border-color: #f59e0b; }
.shop-cat-btn.active[data-cat="zestaw"]{ background: #3b82f6; border-color: #3b82f6; }
.shop-cat-btn.active[data-cat="item"]  { background: #10b981; border-color: #10b981; }

/* =============================================================================
   SKLEP — zakładki kategorii
   ============================================================================= */

.shop-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    font-family: var(--font);
    white-space: nowrap;
}

.shop-cat-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(255,23,68,.04);
}

.shop-cat-btn.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
}

.shop-cat-btn[data-cat="ranga"].active  { background: #8b5cf6; border-color: #8b5cf6; }
.shop-cat-btn[data-cat="klucz"].active  { background: #f59e0b; border-color: #f59e0b; }
.shop-cat-btn[data-cat="zestaw"].active { background: #3b82f6; border-color: #3b82f6; }
.shop-cat-btn[data-cat="item"].active   { background: #10b981; border-color: #10b981; }

/* Gwiazdki rzadkości */
.rarity-stars-edit {
    display: flex;
    gap: .25rem;
    margin-top: .4rem;
}
.rarity-star {
    cursor: pointer;
    font-size: 1.2rem;
    color: #d1d5db;
    transition: color .1s;
}
.rarity-star.active { color: #f59e0b; }
.rarity-star:hover  { color: #f59e0b; }

/* Modal sklepu — sekcje */
.shop-modal-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .9rem 1rem;
    margin-bottom: .8rem;
}
.shop-modal-section-title {
    font-size: .72rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .7rem;
}

/* Podgląd mediów w modalu sklepu */
.shop-modal-media-preview {
    width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border);
    background: var(--bg);
    margin-top: .5rem;
    display: none;
}
.shop-modal-media-preview img,
.shop-modal-media-preview video {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

/* Poradniki strona */
#page-guides .table-card:hover {
    transform: none;
}

/* =============================================================================
   SKLEP — NADAWANIE PRODUKTÓW
   ============================================================================= */

.shop-grant-item-btn {
    padding: .45rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    font-family: var(--font);
    white-space: nowrap;
}

.shop-grant-item-btn:hover {
    background: var(--bg);
}

.shop-grant-item-btn.selected {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
}

/* Historia nadań */
.shop-grant-entry {
    padding: .75rem 1.1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: .3rem;
    transition: background .1s;
}
.shop-grant-entry:last-child { border-bottom: none; }
.shop-grant-entry:hover { background: var(--bg); }

.shop-grant-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.shop-grant-badge {
    font-size: .68rem;
    font-weight: 800;
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}
.shop-grant-badge-pending  { background: rgba(245,158,11,.12); color: #d97706; border: 1px solid rgba(217,119,6,.25); }
.shop-grant-badge-executed { background: rgba(16,185,129,.1);  color: #059669; border: 1px solid rgba(5,150,105,.2); }
.shop-grant-badge-failed   { background: rgba(239,68,68,.1);   color: #dc2626; border: 1px solid rgba(220,38,38,.2); }

/* ── Sklep — wiersz produkt + ilość ── */
.sgib-row {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sgib-row .shop-grant-item-btn {
    flex: 1;
    justify-content: flex-start;
    white-space: nowrap;
}

.sgib-qty {
    width: 70px;
    padding: .45rem .6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    color: var(--text-primary);
    background: var(--bg);
    outline: none;
    font-family: var(--font);
    text-align: center;
    transition: border-color var(--transition);
    flex-shrink: 0;
}

.sgib-qty:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59,130,246,.1);
}

/* Historia nadań — rozszerzone szczegóły */
.shop-grant-entry {
    padding: .9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}
.shop-grant-entry:last-child { border-bottom: none; }
.shop-grant-entry:hover { background: rgba(59,130,246,.02); }
.shop-grant-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .3rem;
}
.shop-grant-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}
.shop-grant-badge-pending  { background:rgba(245,158,11,.1);  color:#d97706; border:1px solid rgba(217,119,6,.2); }
.shop-grant-badge-executed { background:rgba(16,185,129,.1);  color:#059669; border:1px solid rgba(5,150,105,.2); }
.shop-grant-badge-failed   { background:rgba(239,68,68,.1);   color:#dc2626; border:1px solid rgba(220,38,38,.2); }

/* Modal potwierdzenia rangi */
#rank-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#rank-confirm-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.8rem;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease forwards;
}
#rank-confirm-box h3 {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: .6rem;
    color: var(--text-primary);
}
#rank-confirm-box p {
    font-size: .9rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    line-height: 1.5;
}
#rank-confirm-box .confirm-btns {
    display: flex;
    gap: .6rem;
}

/* ── AI Asystent ── */
.ai-example {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .4rem .75rem;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    color: var(--text-secondary);
}
.ai-example:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139,92,246,.06);
}

/* Wiadomości w czacie */
.ai-msg {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    animation: pageIn .2s ease forwards;
}
.ai-msg-user { flex-direction: row-reverse; }
.ai-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.ai-msg-user .ai-msg-avatar  { background: var(--accent); color: #fff; }
.ai-msg-ai   .ai-msg-avatar  { background: linear-gradient(135deg,#8b5cf6,#3b82f6); color: #fff; }
.ai-msg-bubble {
    max-width: 75%;
    padding: .65rem .9rem;
    border-radius: 12px;
    font-size: .88rem;
    line-height: 1.5;
}
.ai-msg-user .ai-msg-bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-msg-ai .ai-msg-bubble {
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

/* Karta potwierdzenia akcji */
.ai-confirm-card {
    background: var(--bg-card);
    border: 2px solid rgba(139,92,246,.3);
    border-radius: 12px;
    padding: .9rem 1rem;
    margin-top: .35rem;
}
.ai-confirm-card-title {
    font-size: .8rem;
    font-weight: 700;
    color: #8b5cf6;
    text-transform: uppercase;
    margin-bottom: .5rem;
}
.ai-confirm-field {
    display: flex;
    gap: .5rem;
    font-size: .85rem;
    margin-bottom: .25rem;
}
.ai-confirm-field-label { color: var(--text-secondary); min-width: 80px; }
.ai-confirm-field-value { font-weight: 700; }
.ai-confirm-btns {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
}
.ai-confirm-yes {
    flex: 1;
    padding: .5rem;
    background: linear-gradient(135deg,#8b5cf6,#3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    font-size: .85rem;
    font-family: var(--font);
    transition: opacity .15s;
}
.ai-confirm-yes:hover { opacity: .88; }
.ai-confirm-no {
    padding: .5rem .9rem;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    font-size: .85rem;
    font-family: var(--font);
}
.ai-confirm-no:hover { border-color: #ef4444; color: #ef4444; }

/* Typing indicator */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: .5rem .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: fit-content;
}
.ai-typing span {
    width: 7px; height: 7px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: aiTyping 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiTyping {
    0%, 80%, 100% { transform: scale(.7); opacity: .5; }
    40%           { transform: scale(1);  opacity: 1; }
}

/* ── Ekwipunek gracza — sloty ── */
.inv-slot {
    width: 42px;
    height: 42px;
    border: 2px solid #1a1a2e;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    cursor: default;
    overflow: visible; /* żeby tooltip wystawał */
    transition: border-color .12s, transform .1s, box-shadow .12s;
    background: #0d0d1a;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 -2px 4px rgba(0,0,0,.4);
}
.inv-slot:hover {
    border-color: #ffffff;
    transform: scale(1.15);
    z-index: 50;
    box-shadow: 0 4px 14px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.2);
}
.inv-slot-empty {
    color: var(--text-secondary);
    font-size: .6rem;
    opacity: .2;
    border-color: #15151f;
}
.inv-slot-empty:hover {
    border-color: #15151f;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 -2px 4px rgba(0,0,0,.4);
}
.inv-slot-emoji {
    font-size: 1.15rem;
    line-height: 1;
    user-select: none;
}
.inv-slot-amt {
    position: absolute;
    bottom: -3px;
    right: 0px;
    font-size: .85rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000, 2px 2px 3px rgba(0,0,0,.8);
    pointer-events: none;
    font-family: 'Segoe UI', sans-serif;
}

/* Kolory tła wg tier */
.inv-slot-netherite { background: rgba(139,92,246,.18); border-color: rgba(139,92,246,.4); }
.inv-slot-diamond   { background: rgba(56,189,248,.15); border-color: rgba(56,189,248,.35); }
.inv-slot-gold      { background: rgba(251,191,36,.15);  border-color: rgba(251,191,36,.35); }
.inv-slot-iron      { background: rgba(156,163,175,.15); border-color: rgba(156,163,175,.3); }
.inv-slot-special   { background: rgba(245,158,11,.18);  border-color: rgba(245,158,11,.4); }
.inv-slot-weapon    { background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25); }
.inv-slot-armor     { background: rgba(59,130,246,.1);   border-color: rgba(59,130,246,.25); }
.inv-slot-utility   { background: rgba(99,102,241,.12);  border-color: rgba(99,102,241,.3); }
/* Mocniejsze kolory tier — wyraźne tła jak w MC */
.inv-slot-netherite { background: #2a1a3e; border-color: #4c1d95; box-shadow: inset 0 0 0 1px rgba(139,92,246,.3), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-diamond   { background: #0f2a3a; border-color: #0e7490; box-shadow: inset 0 0 0 1px rgba(56,189,248,.3), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-gold      { background: #3a2f0f; border-color: #a16207; box-shadow: inset 0 0 0 1px rgba(251,191,36,.3), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-iron      { background: #2a2a2a; border-color: #525252; box-shadow: inset 0 0 0 1px rgba(156,163,175,.25), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-special   { background: #3a1f0a; border-color: #c2410c; box-shadow: inset 0 0 0 1px rgba(245,158,11,.35), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-weapon    { background: #2a0f0f; border-color: #991b1b; box-shadow: inset 0 0 0 1px rgba(239,68,68,.25), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-armor     { background: #0f1a2a; border-color: #1e40af; box-shadow: inset 0 0 0 1px rgba(59,130,246,.25), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-utility   { background: #1a1a2e; border-color: #4338ca; box-shadow: inset 0 0 0 1px rgba(99,102,241,.3), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-slot-normal    { background: #0d0d1a; }

/* ─── Nowy ekwipunek: ikony itemów + tooltip CSS ────────────────── */
.inv-slot-img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.inv-slot-emoji-fallback {
    font-size: 1.05rem;
    line-height: 1;
    user-select: none;
}

/* Tooltip CSS-only — pokazuje się przy :hover na slocie (styl MC) */
.inv-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #100014;
    border: 2px solid #1a0028;
    box-shadow: 0 6px 20px rgba(0,0,0,.8), inset 0 0 0 1px #2a0040;
    border-radius: 0;
    padding: .55rem .7rem;
    min-width: 170px;
    max-width: 250px;
    z-index: 9999;
    font-family: 'Segoe UI', sans-serif;
    font-size: .74rem;
    color: #fff;
    line-height: 1.5;
    pointer-events: none;
    white-space: pre-wrap;
    text-align: left;
}
.inv-tooltip-name    { font-weight: 700; margin-bottom: .25rem; font-size: .85rem; }
.inv-tooltip-enchant { color: #b4a7ff; font-size: .72rem; line-height: 1.4; }
.inv-tooltip-lore    { color: #ff7bff; font-style: italic; font-size: .7rem; }
.inv-tooltip-meta    { color: #9ca3af; font-size: .68rem; margin-top: .35rem; border-top: 1px solid #2a0040; padding-top: .3rem; line-height: 1.5; }
.inv-tooltip-section { color: #fbbf24; font-size: .68rem; font-weight: 700; text-transform: uppercase; margin-top: .3rem; margin-bottom: .15rem; letter-spacing: .03em; }
.inv-tooltip-attr    { color: #60d394; font-size: .7rem; line-height: 1.4; }
.inv-tooltip-effect  { color: #ff8c69; font-size: .7rem; line-height: 1.4; }
.inv-slot:hover .inv-tooltip { display: block; }
/* Hotbar — złota ramka jak w MC */
.inv-grid-hotbar .inv-slot { border-color: #78350f; box-shadow: inset 0 0 0 1px rgba(251,191,36,.2), inset 0 -2px 4px rgba(0,0,0,.5); }
.inv-grid-hotbar .inv-slot:hover { border-color: #fbbf24; }

/* Layout grida ekwipunku jak w Minecraft */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(9, 42px);
    gap: 4px;
}
.inv-grid-armor {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Modal szczegółów gracza — powiększony (Problem 4) */
#player-detail-modal .modal-content,
#player-detail-modal .login-card {
    max-width: 92vw !important;
    width: 1100px !important;
    max-height: 92vh !important;
}
.player-detail-layout {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 980px) {
    .player-detail-layout { grid-template-columns: 1fr; }
}

/* Kolory rzadkości nazwy w tooltipie (jak w MC) */
.inv-rarity-netherite { color: #a0a0ec; }
.inv-rarity-diamond   { color: #55d5ff; }
.inv-rarity-gold      { color: #ffb340; }
.inv-rarity-special   { color: #ff8c00; }
.inv-rarity-common    { color: #ffffff; }

/* ── AI Chip buttons ──────────────────────────────────────────────── */
.ai-chip {
    padding: .5rem .75rem;
    background: rgba(139,92,246,.08);
    border: 1.5px solid rgba(139,92,246,.2);
    border-radius: 8px;
    color: #8b5cf6;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    transition: background .15s, border-color .15s, transform .12s, box-shadow .12s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: .35rem;
    justify-content: flex-start;
}
.ai-chip:hover {
    background: rgba(139,92,246,.16);
    border-color: rgba(139,92,246,.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(139,92,246,.15);
}

/* ── AI message bubble variants ──────────────────────────────────── */
.ai-msg-bubble-user {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6) !important;
    color: #fff !important;
}
.ai-msg-bubble-ai {
    background: var(--bg-card);
    border: 1px solid var(--border);
    line-height: 1.6;
}

/* ── AI page key setup panel ─────────────────────────────────────── */
#ai-api-setup {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

/* ── AI status indicator pulsar ──────────────────────────────────── */
@keyframes aiStatusPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
    50%       { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
.ai-status-ok {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #10b981;
    font-weight: 800;
}
.ai-status-ok::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: aiStatusPulse 2s infinite;
    flex-shrink: 0;
}
