/* ==========================================================================
   CONFIG & VARIABLES
   ========================================================================== */
:root {
    /* --- HSL Color Tokens --- */
    --h: 217;
    /* Base Hue: Blue */
    --s: 91%;
    /* Base Saturation */

    --primary-h: var(--h);
    --primary-s: var(--s);
    --primary-l: 60%;

    --bg-color: hsl(var(--h), 30%, 98%);
    --card-bg: hsl(0, 0%, 100%);
    --text-main: hsl(var(--h), 20%, 15%);
    --text-muted: hsl(var(--h), 15%, 45%);
    --border-color: hsl(var(--h), 20%, 90%);
    --accent-color: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --header-bg: hsla(0, 0%, 100%, 0.8);

    /* --- Glassmorphism --- */
    --glass-bg: hsla(0, 0%, 100%, 0.7);
    --glass-border: hsla(0, 0%, 100%, 0.3);
    --glass-blur: 12px;

    /* --- Shadows --- */
    --shadow-flat: 0 1px 3px hsla(var(--h), 20%, 10%, 0.05);
    --shadow-float: 0 10px 25px -5px hsla(var(--h), 20%, 10%, 0.1), 0 8px 10px -6px hsla(var(--h), 20%, 10%, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --modal-overlay: hsla(var(--h), 20%, 5%, 0.4);

    --sidebar-bg: hsl(222, 47%, 11%);
    --sidebar-text: hsl(214, 32%, 91%);
    --sidebar-active: hsla(var(--h), 100%, 50%, 0.15);
}

[data-theme="dark"] {
    --bg-color: hsl(222, 47%, 7%);
    --card-bg: hsl(222, 47%, 11%);
    --text-main: hsl(214, 32%, 91%);
    --text-muted: hsl(215, 20%, 65%);
    --border-color: hsl(222, 47%, 18%);
    --header-bg: hsla(222, 47%, 11%, 0.8);

    /* --- Glassmorphism --- */
    --glass-bg: hsla(222, 47%, 11%, 0.7);
    --glass-border: hsla(222, 47%, 25%, 0.5);

    /* --- Shadows --- */
    --shadow-flat: 0 4px 6px hsla(0, 0%, 0%, 0.3);
    --shadow-float: 0 20px 40px hsla(0, 0%, 0%, 0.5);

    --modal-overlay: hsla(0, 0%, 0%, 0.7);

    --sidebar-bg: hsl(222, 47%, 4%);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s, color 0.3s;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
}

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px 0;
    box-shadow: var(--shadow-float);
    z-index: 50;
    /* Lowered from 1000 to avoid overlapping overlays */
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    /* overflow: hidden; */
    /* Removing this to allow flyouts */
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 24px 25px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar.collapsed .sidebar-header {
    padding: 24px 0;
    justify-content: center;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: -0.5px;
    margin: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar.collapsed .sidebar-header h1 {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    pointer-events: none;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle-sidebar:hover {
    background: var(--accent-color);
    color: white;
}

.sidebar.collapsed .btn-toggle-sidebar {
    transform: rotate(180deg);
}

.sidebar-header span {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-family: 'Monaco', monospace;
}

/* new */
.sidebar-menu {
    list-style: none;
    padding: 10px 12px;
    flex-grow: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.sidebar-item i {
    font-size: 1.1rem;
    min-width: 24px;
    display: flex;
    justify-content: center;
    transition: transform 0.2s ease;
}

.sidebar-item span {
    margin-left: 12px;
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar.collapsed .sidebar-item span {
    opacity: 0;
    transform: translateX(-10px);
    width: 0;
    margin: 0;
    pointer-events: none;
}

/* Active state (selected) */
.sidebar-item.active {
    background-color: var(--sidebar-active);
    color: var(--accent-color);
    box-shadow: inset 0 0 0 1px hsla(var(--h), var(--s), var(--primary-l), 0.2);
}

.sidebar-item.active i {
    transform: scale(1.1);
}

/* Hover effect */
.sidebar-item:hover:not(.active) {
    background-color: hsla(0, 0%, 100%, 0.05);
    color: #ffffff;
    transform: translateX(4px);
}

/* Hierarchical Sidebar / Submenu Styles */
.sidebar-group {
    margin-bottom: 8px;
    position: relative;
}

.sidebar-group .sidebar-item {
    margin-bottom: 0;
    /* Remove redundant margin inside groups */
}

.dropdown-icon {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    opacity: 0.5;
}

.sidebar-group.open .dropdown-icon {
    transform: none;
    /* No rotation for flyout style */
    color: var(--accent-color);
    opacity: 1;
}

.sidebar-group {
    position: relative;
}

.sidebar-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 10px;
    width: 220px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-float);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 60;
    padding: 10px;
}

.sidebar-group.open .sidebar-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(20px);
}

.sidebar.collapsed .sidebar-submenu {
    left: calc(var(--sidebar-collapsed-width) - 10px);
}

.sidebar-subitem {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar-subitem i {
    font-size: 0.9rem;
    min-width: 20px;
    margin-right: 12px;
    opacity: 0.7;
}

.sidebar-subitem:hover {
    background-color: hsla(0, 0%, 100%, 0.03);
    color: #ffffff;
}

.sidebar-subitem.active {
    color: var(--accent-color);
    background-color: hsla(var(--h), var(--s), var(--primary-l), 0.1);
}


/* Custom Instant Tooltip for Collapsed Sidebar */
.sidebar.collapsed .sidebar-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    margin-left: 10px;
    background: #1e293b;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 60;
    transition: none;
    /* Instant appearance */
}

.sidebar.collapsed .sidebar-item:hover::after {
    opacity: 1;
    visibility: visible;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.sidebar.collapsed .sidebar-footer {
    padding: 20px 0;
    display: flex;
    justify-content: center;
}

.sidebar-footer .nav-text {
    transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-footer .nav-text {
    display: none;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Pulsing status dot */
.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    /* Green */
    border-radius: 50%;
    box-shadow: 0 0 8px #22c55e;
}

/* end of new */
.logo {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    font-size: 1.2rem;
}

nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: 0.3s;
    opacity: 0.7;
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    opacity: 1;
    background: var(--sidebar-active);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 25px;
}

/* ==========================================================================
   MAIN CONTENT & TOP BAR
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-bar {
    height: 64px;
    min-height: 64px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-action {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 0;
}

.top-bar-action:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px hsla(var(--h), var(--s), var(--primary-l), 0.2);
}

.top-bar-action .shortcut {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s;
    pointer-events: none;
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.top-bar-action:hover .shortcut {
    opacity: 1;
    bottom: -28px;
}

.top-bar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px 6px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.user-profile-trigger:hover {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-flat);
}

.user-avatar-mini {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px hsla(var(--h), var(--s), var(--primary-l), 0.2);
}

.user-info-mini {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-info-mini #top-bar-username {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.user-info-mini #top-bar-role {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}











/* ==========================================================================
   BULK ACTIONS TOOLBAR
   ========================================================================== */
.bulk-toolbar {
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-info {
    font-weight: 600;
    color: var(--text-main);
}

.bulk-btns {
    display: flex;
    gap: 10px;
}

.btn-bulk {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}

.btn-bulk-edit {
    background-color: var(--accent-color);
    color: white;
}

.btn-bulk-edit:hover {
    background-color: #0873c4;
    transform: translateY(-1px);
}

.btn-bulk-delete {
    background-color: #ef4444;
    color: white;
}

.btn-bulk-delete:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.btn-bulk-clear {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-bulk-clear:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

/* Checkbox styling in table */
#printers-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.search-container {
    background: var(--bg-color);
    padding: 8px 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    width: 300px;
}

.search-container input {
    border: none;
    background: transparent;
    margin-left: 10px;
    outline: none;
    width: 100%;
    color: var(--text-main);
}

/* ==========================================================================
   TABS & CANVAS
   ========================================================================== */
.tab-content {
    display: none;
    padding: 20px;
    height: calc(100vh - 70px);
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 0;
    border-bottom: 1px solid var(--glass-border);
    position: relative;
}

.content-tabs {
    display: flex;
    gap: 35px;
    margin-bottom: -1px;
    /* Overlap with border */
}

.content-tab {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 0 15px 0;
    position: relative;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.content-tab:hover {
    color: #ffffff;
}

.content-tab.active {
    color: var(--accent-light) !important;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.content-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
    border-radius: 4px 4px 0 0;
}

.canvas-container {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    height: 600px;
    position: relative;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   MODALS & FORMS
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay);
    backdrop-filter: blur(4px);
    overflow: hidden;
    /* Disable scroll on overlay */
}

/* Content container */
.modal-content {
    background-color: var(--card-bg);
    margin: 4vh auto;
    width: 92%;
    max-width: 1400px;
    max-height: 88vh;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-float);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    overflow: hidden;
    /* Fixes corner issues */
}

/* Header stays on top */
.modal-header {
    padding: 15px 25px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    /* Title on left, buttons on right */
    align-items: center;
    position: sticky;
    /* Stick header so buttons are always accessible */
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-save {
    background-color: var(--accent-color);
    color: #ffffff !important;
    border: none;
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-save:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px hsla(var(--h), var(--s), var(--primary-l), 0.3);
}

.btn-cancel {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 8px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cancel:hover {
    background-color: hsla(var(--h), 20%, 50%, 0.1);
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* KEY: Scrollable middle */
#edit-form {
    overflow-y: auto;
    /* Enables vertical scroll here only */
    padding: 5px 25px 25px 25px;
    flex-grow: 1;
    /* Takes all available space */
}

/* Scrollbar style (optional, better look in Dark Mode) */
#edit-form::-webkit-scrollbar {
    width: 8px;
}

#edit-form::-webkit-scrollbar-track {
    background: var(--bg-color);
}

#edit-form::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form Layouts */
.main-info-grid {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    /* Status takes what it needs, rest equally */
    gap: 30px;
    /* Increased spacing between sections */
    align-items: flex-end;
    /* Align fields to bottom */
    padding: 20px 0;
    margin-bottom: 20px;
}

.main-layout-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    /* Left column flexible, right column fixed */
    gap: 30px;
    align-items: start;
}

/* Container for "Active" checkbox */
.status-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 10px;
    /* Slight adjustment for inputs alignment */
}

.status-checkbox-group label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Checkbox styling for modern look */
.status-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #27ae60;
}

.form-section-header {
    border-bottom: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.logistics-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Larger spacing between Access and Location cards */
}

/* Cards within Modal */
/*.device-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    height: auto; /* Pozwól karcie dopasować się do zawartości 
    display: flex;
    flex-direction: column;
    gap: 10px;
}*/

.device-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    /* More space inside the card */
    height: auto;
    transition: box-shadow 0.3s;
}

.zebra-theme {
    border-left: 5px solid #f59e0b;
}

.lexmark-theme {
    border-left: 5px solid #3b82f6;
}

.system-theme {
    border-left: 5px solid #6366f1;
}

.location-theme {
    border-left: 5px solid #10b981;
}

/* Siatka dla Zebry (3 kolumny obok siebie) */
.zebra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    /* Force 3 columns */
    gap: 15px;
    margin-bottom: 25px;
}

/* Siatka dla Lexmarka (2 kolumny obok siebie) */
.lexmark-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px;
}

/* Responsiveness: items stack if screen is too small */
@media (max-width: 1200px) {
    .zebra-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .main-layout-container {
        grid-template-columns: 1fr;
    }
}

/* Inputs & Labels */
.form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-group input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-main);
    transition: 0.2s;
}

.form-group input:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(9, 132, 227, 0.2);
}

.ip-field {
    font-family: monospace;
    font-weight: bold;
    color: var(--accent-color) !important;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s, transform 0.2s;
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-main);
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.btn-add {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: filter 0.2s, transform 0.2s;
}

/* Universal danger/delete button */
.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-add:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

#theme-toggle {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

#theme-toggle:hover {
    background: var(--bg-color);
}

/* ==========================================================================
   REFRESH BUTTON
   ========================================================================== */
.btn-refresh {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-refresh:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-refresh:active {
    transform: translateY(0);
}

/* Add rotation effect on click if using FontAwesome icon */
.btn-refresh i {
    transition: transform 0.3s ease;
}

.btn-refresh:active i {
    transform: rotate(180deg);
}

/* Dark mode version (optional glow adjustment) */
[data-theme="dark"] .btn-refresh {
    box-shadow: 0 4px 12px rgba(9, 132, 227, 0.3);
}

/* Add this to CSS for spinning icon effect */
.spinning i {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   HEADER ACTIONS (PRZYKŁADOWE PRZYCISKI W NAGŁÓWKU)
   ========================================================================== */
.header-actions {
    display: flex;
    /* Układ obok siebie */
    flex-direction: row;
    /* Kierunek: rządek */
    align-items: center;
    /* Wyśrodkowanie w pionie */
    gap: 12px;
    /* Odstęp między przyciskami */
    flex-wrap: nowrap;
    /* Prevent wrapping to new line */
}

/* Section headers inside cards (with icons) */
.card-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 20px;
    /* Spacing from first input field */
    color: var(--text-main);
}

/* Kontener paska zakładek */
.modal-tabs {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    /*padding: 0 5px;*/
    padding-left: 25px;
    padding-right: 25px;
    /* For symmetry */
}

/* Przycisk zakładki */
.tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    cursor: pointer;
    position: relative;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    color: var(--text-main);
}

/* Aktywna zakładka z linią pod spodem */
.tab-btn.active {
    color: var(--accent-color);
}

.tab-btn.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 10px 10px 0 0;
}

/* Logika wyświetlania paneli */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-list-actions,
.group-editor-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   WORKSPACE EDITOR TABS
   ========================================================================== */
.editor-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Workspace Editor Specifics - Prevent modal overlays when integrated */
.editor-wrapper .modal-header {
    background: transparent;
    padding: 0 5px 15px 5px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.editor-wrapper .modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.editor-wrapper .modal-tabs {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 20px;
}

.editor-wrapper .tab-pane {
    padding: 0 !important;
}

.editor-wrapper form {
    background: transparent;
}

.editor-wrapper .modal-content {
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    width: 100%;
    max-width: 100%;
}

/* Logika dla głównych widoków (App Settings / Map Settings) */
.view-tab-content {
    display: none;
}

.view-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

/* Styl dla pola Notes */
.notes-container {
    padding: 5px 25px 25px 25px;
}

#notes-textarea {
    width: 100%;
    height: 300px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    padding: 15px;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

#notes-textarea:focus {
    border-color: var(--accent-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   MAP CONTAINER
   ========================================================================== */
/* style.css */
#warehouse-map-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Kontener ustawień */
#map-settings {
    padding: 20px;
    color: #e2e8f0;
    max-width: 450px;
}

.settings-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #f8fafc;
    border-bottom: 1px solid #334155;
    padding-bottom: 10px;
}

/* 3. KONTENER I NAWIGACJA TABÓW */
.settings-container {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--map-set-bg);
    color: var(--map-set-text);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--map-set-border);
    box-shadow: var(--shadow-sm);
    max-width: 450px;
    transition: background 0.3s ease, color 0.3s ease;
}

.settings-tabs-nav {
    display: flex;
    background: var(--map-set-card);
    border-bottom: 1px solid var(--map-set-border);
    padding: 8px 8px 0 8px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: transparent;
    color: var(--map-set-text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tab-btn i {
    font-size: 1rem;
}

.tab-btn:hover {
    background: var(--map-set-hover);
    color: var(--map-set-text);
}

.tab-btn.active {
    color: var(--accent-color) !important;
    background: rgba(59, 130, 246, 0.08) !important;
    border-bottom: 2px solid var(--accent-color) !important;
    opacity: 1 !important;
}

.tab-btn.active i {
    color: var(--accent-color);
    transform: scale(1.1);
}

/* 4. PANELE TREŚCI */
.tab-pane {
    display: none;
    padding: 16px;
    animation: mapFadeIn 0.25s ease-out;
}

.tab-pane.active {
    display: block;
}

@keyframes mapFadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 5. KARTY USTAWIEŃ (BENTO STYLE) */
.setting-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 10px;
    /* box-shadow removed */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.setting-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.setting-card:hover {
    /* transform removed */
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header i {
    font-size: 1rem;
    color: var(--map-set-accent);
    opacity: 0.9;
}

.card-header h4 {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-main);
    font-weight: 800;
    opacity: 0.9;
}

/* 6. MODERN INPUTS & CONTROLS */
.setting-control {
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    border-radius: 12px;
    transition: background 0.2s;
}

.setting-control:hover {
    background: rgba(255, 255, 255, 0.03);
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    opacity: 0.9;
}

.max-hint {
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.7;
    letter-spacing: 0.3px;
}

.settings-input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px 14px;
    transition: all 0.2s ease;
    min-width: 90px;
    justify-content: flex-end;
}

.settings-input-wrapper:focus-within {
    border-color: var(--map-set-accent);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.settings-number-input {
    background: transparent;
    border: none;
    color: #fff;
    width: 42px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
    outline: none;
    font-family: 'Outfit', sans-serif;
}

.input-unit {
    font-size: 0.75rem;
    color: var(--map-set-accent);
    font-weight: 700;
    opacity: 0.8;
}

/* Remove Arrows from Number Input */
.settings-number-input::-webkit-outer-spin-button,
.settings-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.settings-number-input[type=number] {
    -moz-appearance: textfield;
}

/* 7. PRZEŁĄCZNIKI (SWITCHES) */
.switch-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--map-set-border);
}

.switch-row:last-child {
    border-bottom: none;
}

.modern-switch {
    position: relative;
    width: 40px;
    height: 20px;
}

.modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* 8. PRZYCISKI AKCJI */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-modern {
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    color: #fff;
    transition: transform 0.1s, filter 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary {
    background: var(--map-set-text-muted);
}

.btn-danger {
    background: var(--map-set-danger);
}

.btn-modern:hover {
    filter: brightness(1.1);
}

.btn-modern:active {
    transform: scale(0.96);
}

/* Ukryj wszystkie panele w tym modalu */
#edit-modal .tab-pane {
    display: none !important;
}

/* Pokaż tylko ten, który ma klasę active */
#edit-modal .tab-pane.active {
    display: block !important;
}

/* Styl dla aktywnego guzika, żeby nie był szary */
#edit-modal .tab-btn.active {
    color: var(--map-set-accent, #3b82f6) !important;
    border-bottom: 2px solid var(--map-set-accent, #3b82f6) !important;
    opacity: 1 !important;
}

/* ==========================================================================
   TOAST SYSTEM
   ========================================================================== */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--accent-color);
    animation: slideInRight 0.3s forwards;
    transition: all 0.3s;
    min-width: 250px;
}

.toast-success {
    border-left-color: #2ecc71;
}

.toast-error {
    border-left-color: #e74c3c;
}

.toast-warning {
    border-left-color: #f1c40f;
}

.toast-icon {
    margin-right: 12px;
    font-size: 1.2rem;
}

.toast-success .toast-icon {
    color: #2ecc71;
}

.toast-error .toast-icon {
    color: #e74c3c;
}

.toast-warning .toast-icon {
    color: #f1c40f;
}

.toast-message {
    flex-grow: 1;
    font-size: 0.9rem;
    font-weight: 600;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.d-flex-col {
    display: flex;
    flex-direction: column;
}

.gap-15 {
    gap: 15px;
}

.gap-10 {
    gap: 10px;
}

.mb-15 {
    margin-bottom: 15px;
}

.mb-25 {
    margin-bottom: 25px;
}

.mb-10 {
    margin-bottom: 10px;
}

.font-bold {
    font-weight: 700;
}

.p-0 {
    padding: 0 !important;
}

.pb-20 {
    padding-bottom: 20px;
}

/* ==========================================================================
   QR CODE FEATURES
   ========================================================================== */
.qr-scanner-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

#qr-reader {
    border: none !important;
    background: #000;
}

#qr-reader__scan_region {
    background: #000;
}

#qr-reader__dashboard {
    padding: 20px !important;
    background: var(--bg-color);
    color: var(--text-main);
}

#qr-reader__dashboard button {
    background: var(--accent-color) !important;
    color: white !important;
    border: none !important;
    padding: 8px 15px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    margin-top: 10px !important;
}

#qr-reader select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 15px;
}

#btn-download-qr {
    display: flex;
    align-items: center;
    gap: 8px;
}

#qrcode img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   MOBILE INTERFACE (FOR SCREENS < 768px)
   ========================================================================== */
.mobile-app-container {
    display: none;
    /* Hidden on Desktop */
    flex-direction: column;
    height: 100vh;
    background: #0f172a;
    color: #f1f5f9;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .app-container {
        display: none !important;
    }

    .modal-overlay,
    .modal {
        display: none !important;
    }

    /* Hide desktop modals on mobile */
    .mobile-app-container {
        display: flex;
    }
}

.m-tab-content {
    display: none;
    flex-direction: column;
    height: calc(100vh - 70px);
    padding: 20px;
    overflow-y: auto;
}

.m-tab-content.active {
    display: flex;
}

/* Mobile Header */
.m-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 20px;
}

.m-header.sticky-header {
    position: sticky;
    top: 0;
    background: #0f172a;
    z-index: 100;
}

.m-logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: #3b82f6;
}

.m-logo small {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 400;
}

.m-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bottom Navigation */
.m-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 60;
}

.m-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
    gap: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: 0.3s;
}

.m-nav-item.active {
    color: #3b82f6;
}

.m-nav-scan-btn {
    margin-top: -40px;
    /* Floating look */
    background: #3b82f6;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 5px solid #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    cursor: pointer;
}

.m-nav-scan-btn i {
    font-size: 1.4rem;
    color: white;
}

/* Mobile Details Cards */
.m-info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
}

.m-info-card h5 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #3b82f6;
    margin-bottom: 10px;
}

.m-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.m-item {
    font-size: 0.85rem;
}

.m-item label {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    margin-bottom: 2px;
}

.m-item span {
    font-weight: 500;
    word-break: break-all;
}

/* Status Styles on Mobile */
.m-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
}

.m-status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.m-status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.m-scanner-wrap {
    margin-top: 10px;
}

.m-info-text {
    text-align: center;
    margin-top: 15px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.m-history-wrap {
    margin-top: 30px;
}

.m-section-title {
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.m-empty-text {
    color: #475569;
    font-size: 0.8rem;
}

/* ==========================================================================
   BENTO DASHBOARD STYLES
   ========================================================================== */

.bento-container {
    display: grid;
    grid-template-areas:
        "welcome welcome stat1 stat2"
        "welcome welcome stat3 stat4"
        "quick quick quick quick"
        "status status status status";
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto auto auto auto;
    gap: 20px;
    padding: 10px;
    animation: bentoFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.bento-tile {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-flat);
}

.bento-tile:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-float);
    border-color: hsla(var(--h), var(--s), var(--primary-l), 0.4);
}

/* Welcome Tile */
.tile-welcome {
    background: linear-gradient(135deg, hsl(var(--h), 90%, 60%) 0%, hsl(var(--h), 90%, 45%) 100%);
    color: white;
    border: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 10px 30px -10px hsl(var(--h), 90%, 50%, 0.5);
}

.tile-welcome h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.tile-welcome p {
    opacity: 0.9;
    font-size: 1rem;
    margin-bottom: 24px;
}

.clock-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#dashboard-clock {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: inherit;
}

#dashboard-date {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 500;
}

.welcome-bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 10rem;
    opacity: 0.1;
    transform: rotate(-15deg);
}

/* Stat Tiles */
.tile-stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.stat-icon-mini {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 4px;
    color: var(--text-main);
}

/* Activity Tile */
.tile-activity {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.bento-scroll {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 10px;
}

.bento-scroll::-webkit-scrollbar {
    width: 6px;
}

.bento-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Quick Tools Bento */
.quick-tools-bento {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.tool-btn-bento {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
}

.tool-btn-bento i {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.tool-btn-bento span {
    font-size: 0.85rem;
    font-weight: 600;
}

.tool-btn-bento:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

.tool-btn-bento:hover i,
.tool-btn-bento:hover span {
    color: white;
}

/* Status Tile */
.tile-status {
    background: rgba(46, 204, 113, 0.05);
    border-color: rgba(46, 204, 113, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    box-shadow: 0 0 0 rgba(46, 204, 113, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

/* Status dots for tables */
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

.dot-active {
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
    animation: pulse 2s infinite;
}

.dot-inactive {
    background: #94a3b8;
    box-shadow: none;
}

.status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
}

.text-active {
    color: #2ecc71;
}

.text-inactive {
    color: #94a3b8;
}

/* Stat Tile highlight on update */
.stat-updated {
    animation: statFlash 1.5s ease-out;
}

@keyframes statFlash {
    0% { background: rgba(46, 204, 113, 0.2); transform: scale(1.05); }
    100% { background: transparent; transform: scale(1); }
}

@keyframes bentoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 1200px) {
    .bento-container {
        grid-template-areas:
            "welcome welcome welcome welcome"
            "stat1 stat2 stat3 stat4"
            "quick quick quick quick"
            "status status status status";
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .bento-container {
        grid-template-areas:
            "welcome"
            "stat1"
            "stat2"
            "stat3"
            "stat4"
            "quick"
            "activity"
            "status";
        grid-template-columns: 1fr;
    }
}

/* Activity Feed Items */
.activity-item {
    display: flex;
    gap: 20px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-flat);
    animation: slideInActivity 0.4s ease-out both;
}

.activity-item:hover {
    background: var(--bg-color);
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-float);
    border-color: var(--accent-color);
}

.activity-item.type-update {
    border-left-color: #3b82f6;
}

.activity-item.type-create {
    border-left-color: #2ecc71;
}

.activity-item.type-delete {
    border-left-color: #ef4444;
}

.activity-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: hsla(var(--h), 20%, 50%, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: var(--accent-color);
}

.activity-content {
    flex-grow: 1;
}

.activity-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}

.activity-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.6;
    margin-top: 4px;
}

@keyframes slideInActivity {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   PHASE 3: LOGIN SCREEN STYLES
   ========================================================================== */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    background-color: hsl(222, 47%, 4%);
}

.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, hsla(var(--h), 90%, 60%, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 20% 80%, hsla(var(--h), 90%, 40%, 0.1) 0%, transparent 50%);
    z-index: -1;
}

.login-card {
    background: hsla(222, 47%, 10%, 0.7);
    backdrop-filter: blur(25px);
    border: 1px solid hsla(var(--h), 90%, 50%, 0.2);
    border-radius: 24px;
    padding: 45px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 100px -20px hsla(var(--h), 90%, 50%, 0.1);
    animation: loginCardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-color);
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s;
}

.input-wrapper input {
    width: 100%;
    background: hsla(222, 47%, 15%, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px 14px 48px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: hsla(222, 47%, 20%, 0.8);
    box-shadow: 0 0 0 4px hsla(var(--h), 90%, 50%, 0.1);
}

.input-wrapper input:focus+i {
    color: var(--accent-color);
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, hsl(var(--h), 90%, 60%) 0%, hsl(var(--h), 90%, 45%) 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin-top: 35px;
    box-shadow: 0 10px 20px -5px hsla(var(--h), 90%, 50%, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px hsla(var(--h), 90%, 50%, 0.5);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 35px;
    text-align: center;
    font-size: 0.75rem;
    color: hsla(0, 0%, 100%, 0.3);
}

/* Auth Success Animation */

/* --- FORCED FLYOUT OVERRIDE --- */
.sidebar-group .sidebar-submenu {
    position: absolute !important;
    left: 100% !important;
    top: 5px !important;
    margin-left: 15px !important;
    width: 240px !important;
    max-height: none !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    pointer-events: none;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(25px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    z-index: 9999 !important;
    /* Ensure it's above everything */
}

.sidebar-group.open .sidebar-submenu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(10px) !important;
    pointer-events: auto !important;
}

.sidebar-subitem {
    width: 100% !important;
    margin-left: 0 !important;
}

/* ==========================================================================
   BENTO EDITOR STYLES
   ========================================================================== */
.bento-header-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 25px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-flat);
}

.header-main-info {
    display: flex;
    gap: 40px;
}

.header-id-group,
.header-client-group {
    display: flex;
    flex-direction: column;
}

.header-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.header-id-input {
    font-size: 1.4rem;
    font-weight: 800;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--accent-color);
    padding: 0;
    outline: none;
    transition: 0.2s;
    width: 120px;
}

.header-id-input:focus {
    border-bottom-color: var(--accent-color);
}

.header-client-input {
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0;
    outline: none;
    width: 250px;
}

.header-status-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 8px 15px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
}

.status-badge-bento {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}

.status-badge-bento.active {
    color: #22c55e;
}

.compact-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.compact-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .4s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.switch-slider {
    background-color: #2ecc71;
}

input:checked+.switch-slider:before {
    transform: translateX(22px);
}

.bento-section {
    margin-bottom: 25px;
}

.bento-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-left: 5px;
}

.bento-section-title i {
    color: var(--accent-color);
}

.lexmark-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.zebra-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.device-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.device-card:hover {
    /* transform removed */
    box-shadow: var(--shadow-float);
    border-color: var(--accent-color);
}

.card-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.full-width-bento {
    width: 100%;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.bento-row-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.bento-section-title-mini {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.info-block {
    display: flex;
    flex-direction: column;
}

.form-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}

.form-grid-4-col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.form-group-row>div,
.form-grid-4-col>div {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 100px;
    /* Reduced to fit 4-col better */
}

.form-group-row label,
.form-grid-4-col label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.form-group-row input,
.form-grid-4-col input {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 100%;
    margin-top: 5px;
}

/* Modal Tabs & Panes */
.modal-tabs {
    display: flex;
    gap: 10px;
    padding: 0 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block;
}

/* Multi-Select Bento Styles */
.bento-multi-select {
    position: relative;
    width: 300px;
}

.multi-select-display {
    background: hsla(var(--h), 30%, 98%, 0.1);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.multi-select-display:hover {
    border-bottom-color: var(--accent-color);
}

.multi-select-display span {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 320px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    max-height: 350px;
    overflow-y: auto;
    padding: 8px;
    display: none;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.multi-select-dropdown.show {
    display: block;
}

.multi-option {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    padding: 10px 14px !important;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.multi-option:last-child {
    border-bottom: none;
}

.multi-option:hover {
    background: hsla(217, 100%, 50%, 0.1);
}

.multi-option input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-id {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
}

.option-group {
    font-size: 10px;
    font-weight: 800;
    background: var(--sidebar-bg);
    padding: 2px 8px;
    border-radius: 4px;
    color: white;
}

.option-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.multi-option input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.multi-option label {
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

/* ===================== COMMAND PALETTE ===================== */
.palette-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 2147483647 !important;
    /* Maximum 32-bit z-index */
    display: flex;
    justify-content: center;
    padding-top: 10vh;
    backdrop-filter: none !important;
}

.palette-container {
    width: 90%;
    max-width: 600px;
    background-color: #ffffff !important;
    border: 2px solid #000000 !important;
    border-radius: 8px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1a1a1a !important;
}

[data-theme="dark"] .palette-container {
    background-color: #1a1a1a !important;
    border-color: #444444 !important;
    color: #ffffff !important;
}

.palette-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #eeeeee;
    gap: 15px;
    background: #ffffff !important;
}

[data-theme="dark"] .palette-header {
    background: #1a1a1a !important;
    border-color: #333333;
}

.palette-search-icon {
    font-size: 1.5rem;
    color: #3b82f6 !important;
}

#palette-search-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    font-size: 1.4rem !important;
    color: inherit !important;
    font-weight: 700 !important;
}

#palette-search-input::placeholder {
    color: #888888 !important;
}

.palette-esc-badge {
    padding: 6px 10px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 900;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .palette-esc-badge {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8fafc;
}

.palette-results {
    max-height: 480px;
    overflow-y: auto;
    padding: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--palette-border) transparent;
}

.palette-results::-webkit-scrollbar {
    width: 6px;
}

.palette-results::-webkit-scrollbar-thumb {
    background: var(--palette-border);
    border-radius: 10px;
}

.palette-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
    background: #ffffff !important;
    color: #1a1a1a !important;
}

[data-theme="dark"] .palette-result-item {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border-color: #222222;
}

.palette-result-item:hover,
.palette-result-item.active {
    background: #f0f7ff !important;
}

[data-theme="dark"] .palette-result-item:hover,
[data-theme="dark"] .palette-result-item.active {
    background: #1e293b !important;
}

.palette-result-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2ff;
    color: #3b82f6;
    border-radius: 6px;
    font-size: 1rem;
}

.palette-result-item.active .palette-result-icon {
    background: #3b82f6;
    color: #ffffff;
}

.palette-result-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.palette-result-title {
    font-size: 1rem;
    font-weight: 700;
}

.palette-result-subtitle {
    font-size: 0.8rem;
    color: #666666;
}

[data-theme="dark"] .palette-result-subtitle {
    color: #999999;
}

.palette-category-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.palette-result-item.active .palette-category-badge {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.palette-footer {
    padding: 12px 20px;
    background: var(--palette-item-hover);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--palette-border);
}

.palette-footer-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--palette-subtext);
}

.palette-key-hint kbd {
    background: #ffffff;
    border: 1px solid #cccccc;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.7rem;
    color: #333333;
    box-shadow: 0 2px 0 #cccccc;
}

[data-theme="dark"] .palette-key-hint kbd {
    background: #333333;
    border-color: #555555;
    color: #ffffff;
    box-shadow: 0 2px 0 #000000;
}

.palette-btn-mini {
    background: var(--palette-bg);
    border: 1px solid var(--palette-border);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--palette-text);
}

.palette-btn-mini:hover {
    border-color: var(--palette-accent);
    color: var(--palette-accent);
}

.palette-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--palette-subtext);
}

/* ===================== MAP ADVANCED UI ===================== */
.map-live-feed {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 300px;
    max-height: 200px;
    background: var(--palette-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--palette-border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.feed-header {
    padding: 10px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 1px solid var(--palette-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(59, 130, 246, 0.05);
}

.feed-list {
    flex: 1;
    overflow-y: auto;
    padding: 5px 0;
}

.feed-item {
    padding: 8px 15px;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feed-item:last-child {
    border: none;
}

.feed-time {
    color: var(--palette-subtext);
    margin-right: 8px;
}

.feed-msg {
    color: var(--palette-text);
}

/* Status Pulses (Helper classes if needed outside canvas) */
.pulse-blue {
    animation: pulseBlue 2s infinite;
}

@keyframes pulseBlue {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}