/* Reset i podstawowe ustawienia */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #202020; /* Ciemne tło zewnętrzne */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Główny kontener aplikacji */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #d9d9d9; /* Jasnoszare tło aplikacji */
}

/* Górny biały panel (Pill) */
.top-pill {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    padding: 10px 15px;
    background-color: #ffffff;
    border-radius: 18px;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Badge (Top Left) */
.user-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background-color: #ffffff;
    padding: 12px 22px;
    border-radius: 14px;
    font-weight: 800;
    color: #1976d2; 
    font-size: 1.05rem;
    z-index: 25;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.menu-btn {
    width: 46px;
    height: 46px;
    background-color: #ffffff;
    border: 6px solid #dbdbdb;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #1976d2;
    transition: transform 0.1s, border-color 0.2s, color 0.2s;
}

.menu-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.menu-btn:hover {
    border-color: #c0c0c0;
}

.menu-btn:active {
    transform: scale(0.95);
}

.menu-btn.disabled {
    color: #b0b0b0;
    cursor: not-allowed;
    pointer-events: none;
}

/* Przestrzeń na zawartość (np. mapę) */
.main-content {
    width: 100%;
    height: calc(100% - 90px); /* Odejmujemy wysokość dolnego paska */
    position: relative;
    padding: 20px;
}

/* Canvas do rysowania mapy */
#mapCanvas {
    width: 100%;
    height: 100%;
    /* Możemy dodać border dla testów */
    /* border: 2px dashed #999; */
    border-radius: 8px;
}

/* Dolny pasek */
.bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background-color: #999999; /* Ciemniejszy szary */
}

/* Kontenery dla 7 doków w dolnym pasku */
.docks-bar {
    position: absolute;
    top: -35px; /* Wystaje w górę poza dolny pasek */
    left: 20px;
    right: 20px;
    height: 115px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Pozwalamy klikać tylko w same karty */
    gap: 15px;
}

.dock-card {
    flex: 1;
    height: 115px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border: 2px solid #dbdbdb;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    pointer-events: auto; /* Włączamy klikanie dla kart */
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.dock-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.dock-card.free {
    border-color: #2ecc71;
    background-color: #f4fbf7;
}

.dock-card.occupied {
    border-color: #e74c3c;
    background-color: #fdf5f5;
}

.dock-card.disabled {
    border-color: #cbd5e1;
    background: repeating-linear-gradient(
      45deg,
      #f8fafc,
      #f8fafc 10px,
      #f1f5f9 10px,
      #f1f5f9 20px
    );
    cursor: not-allowed;
    opacity: 0.85;
}

.dock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 4px;
}

.dock-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: #2c3e50;
    letter-spacing: 0.5px;
}

.dock-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dock-card.free .dock-status-dot {
    background-color: #2ecc71;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

.dock-card.occupied .dock-status-dot {
    background-color: #e74c3c;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.6);
}

.dock-card.disabled .dock-title {
    color: #94a3b8;
}

.dock-card.disabled .dock-status-dot {
    background-color: #cbd5e1;
    box-shadow: none;
}

.dock-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    width: 100%;
}

.dock-status-text {
    font-size: 0.8rem;
    font-weight: bold;
    color: #7f8c8d;
}

.driver-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin-bottom: 2px;
}

.driver-plate {
    font-size: 0.75rem;
    color: #e74c3c;
    font-family: monospace;
    font-weight: bold;
    background: rgba(231, 76, 60, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.driver-company {
    font-size: 0.7rem;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.dock-detail {
    font-size: 0.75rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    margin-top: 2px;
}

.dock-detail strong {
    color: #2c3e50;
}

/* Układ dwukolumnowy dla zajętego doku */
.dock-body-columns {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 1;
}

.dock-col-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    padding-right: 8px;
    height: 100%;
}

.dock-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-left: 8px;
    height: 100%;
}

.dock-col-label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dock-col-value {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2;
}

.dock-col-values-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-y: auto;
    max-height: 70px;
    gap: 3px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.dock-col-values-list::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.dock-col-values-list {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* --- Floating Left Toolbar --- */
.left-toolbar {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background-color: #f2f2f2;
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 30;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: none;
    background-color: #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s, transform 0.1s;
}

.tool-btn:hover {
    background-color: #ccc;
}

.tool-btn:active {
    transform: scale(0.95);
}

.tool-btn.active {
    background-color: #3498db;
    color: #fff;
}

.toolbar-separator {
    height: 2px;
    background-color: #ccc;
    margin: 5px 0;
}

.action-save-btn { background-color: #2ecc71; color: white; }
.action-save-btn:hover { background-color: #27ae60; }

.action-clear-btn { background-color: #e74c3c; color: white; }
.action-clear-btn:hover { background-color: #c0392b; }

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0,0,0,0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: #f2f2f2;
    padding: 30px;
    border-radius: 15px;
    width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-content h3 {
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.modal-content input, .modal-content select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-primary { background-color: #3498db; color: white; }
.btn-primary:hover { background-color: #2980b9; }

.btn-secondary { background-color: #95a5a6; color: white; }
.btn-secondary:hover { background-color: #7f8c8d; }

/* Settings Modal Specific */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.settings-card {
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-card h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
}

/* Switch Toggle Styling */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 46px !important;
    min-width: 46px !important;
    height: 24px !important;
    flex: none !important;
}

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

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

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

.switch-toggle input:checked + .slider-toggle {
    background-color: #f37b42;
}

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

.form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    font-weight: bold;
    color: #555;
    flex: 1;
}

.form-group input {
    flex: 1;
}

/* --- Context Menu --- */
.context-menu {
    position: absolute;
    background-color: #f2f2f2;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    padding: 5px 0;
    z-index: 1000;
    min-width: 200px;
    font-weight: 500;
}

.context-menu.hidden {
    display: none;
}

.menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.menu-item:hover {
    background-color: #e0e0e0;
}

.menu-item.danger {
    color: #e74c3c;
}

.menu-item.danger:hover {
    background-color: #fadbd8;
}

.menu-separator {
    height: 1px;
    background-color: #ccc;
    margin: 5px 0;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background-color: #1e1e2f;
    color: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    width: 380px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.toast-info { border-left: 6px solid #3498db; }
.toast.toast-success { border-left: 6px solid #2ecc71; }
.toast.toast-error { border-left: 6px solid #e74c3c; }
.toast.toast-warning { border-left: 6px solid #f39c12; }

.toast-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast-icon {
    font-size: 24px;
}

.toast-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: bold;
    font-size: 1.05rem;
}

.toast-message {
    font-size: 0.9rem;
    color: #ccc;
    white-space: pre-line; /* zachowuje entery w tekście */
}

.toast-btn {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-size: 0.85rem;
}

.toast-btn:active {
    transform: scale(0.95);
}

.toast-info .toast-btn { background: #2980b9; }
.toast-info .toast-btn:hover { background: #3498db; }

.toast-success .toast-btn { background: #27ae60; }
.toast-success .toast-btn:hover { background: #2ecc71; }

.toast-error .toast-btn { background: #c0392b; }
.toast-error .toast-btn:hover { background: #e74c3c; }

.toast-warning .toast-btn { background: #d68910; }
.toast-warning .toast-btn:hover { background: #f39c12; }

/* --- DB Manager (Grid.js) --- */
.db-manager-modal {
    width: 80vw;
    height: 80vh;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.db-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 0px;
}

/* GridJS Overrides for Bento style */
.gridjs-container {
    padding: 0 !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.gridjs-table {
    width: 100% !important;
}
.gridjs-th {
    background-color: #f7f7f7 !important;
    color: #555 !important;
    font-weight: bold !important;
    border: none !important;
    border-bottom: 2px solid #eee !important;
    padding: 12px 15px !important;
}
.gridjs-td {
    border: none !important;
    border-bottom: 1px solid #f2f2f2 !important;
    padding: 12px 15px !important;
    color: #444 !important;
}
.gridjs-tr:hover .gridjs-td {
    background-color: #fafafa !important;
}
.gridjs-footer {
    border: none !important;
    background-color: #f7f7f7 !important;
    padding: 15px !important;
    border-radius: 0 0 12px 12px !important;
}
.gridjs-search {
    margin: 15px !important;
    float: none !important;
    display: block !important;
}
.gridjs-search-input {
    width: 100% !important;
    max-width: none !important;
    border-radius: 8px !important;
    border: 1px solid #ccc !important;
    padding: 10px 15px !important;
    background-color: #f9f9f9 !important;
}

.action-btn-grid {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    margin-right: 5px;
    color: #e67e22; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.action-btn-grid.delete {
    color: #e74c3c; 
}
.action-btn-grid:hover {
    background: #eee;
    border-color: #ccc;
}

/* Dynamic Row Editor Styles */
.editor-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.editor-form-group label {
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}
.editor-form-group input,
.editor-form-group select {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
.editor-form-group input:focus,
.editor-form-group select:focus {
    border-color: #f37b42;
}
.editor-form-group input[readonly],
.editor-form-group input[disabled] {
    background-color: #eef2f5;
    color: #777;
    cursor: not-allowed;
    border-color: #ddd;
}

/* Modale o wymiarach 90vw i 90vh dla panelu głównego */
#adminPanelModal .modal-content,
#tablesOverviewModal .modal-content,
#userManagementModal .modal-content,
#settingsModal .modal-content {
    width: 90vw !important;
    height: 90vh !important;
    max-width: none !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
}

/* GridJS Table Custom Styling for Widescreen & Scrollability */
#gridjsContainer .gridjs {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

#gridjsContainer .gridjs-wrapper {
    flex: 1;
    overflow: auto !important;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

#gridjsContainer .gridjs-table {
    width: 100%;
    table-layout: auto !important;
}

#gridjsContainer .gridjs-th,
#gridjsContainer .gridjs-td {
    font-size: 0.8rem !important;
    padding: 10px 14px !important;
    white-space: nowrap !important;
    text-overflow: ellipsis;
    max-width: 280px;
    overflow: hidden;
    vertical-align: middle;
}

#gridjsContainer .gridjs-th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

#gridjsContainer .gridjs-td {
    color: #334155 !important;
}

#gridjsContainer .gridjs-head {
    margin-bottom: 12px !important;
}

#gridjsContainer .gridjs-footer {
    margin-top: 12px !important;
    border-top: 1px solid #e2e8f0 !important;
    background-color: #f8fafc !important;
}

/* --- Bocznym Panel Szczegółów Docku --- */
.dock-side-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    height: calc(100vh - 40px);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: -5px 5px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid #cbd5e1;
    z-index: 28;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    transform: translateX(420px);
    opacity: 0;
}

.dock-side-panel.hidden {
    transform: translateX(420px);
    opacity: 0;
    pointer-events: none;
}

.dock-side-panel:not(.hidden) {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    color: #64748b;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.panel-close-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.panel-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: 'Segoe UI', sans-serif;
}

.panel-section-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.panel-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.panel-info-label {
    font-weight: bold;
    color: #475569;
    font-size: 0.9rem;
}

.panel-info-value {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
}

.panel-badge-occupied {
    background-color: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.panel-badge-free {
    background-color: #f0fdf4;
    color: #22c55e;
    border: 1px solid #dcfce7;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.panel-loads-grid {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding: 12px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.panel-loads-col {
    flex: 1;
}

.panel-loads-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-load-item {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    word-break: break-all;
}

.panel-btn-release {
    width: 100%;
    padding: 12px;
    background-color: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
    transition: background-color 0.2s, transform 0.1s;
    margin-top: auto;
}

.panel-btn-release:hover {
    background-color: #dc2626;
}

.panel-btn-release:active {
    transform: scale(0.98);
}

.panel-btn-assign {
    width: 100%;
    padding: 12px;
    background-color: #f37b42;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(243, 123, 66, 0.2);
    transition: background-color 0.2s, transform 0.1s;
    margin-top: auto;
}

.panel-btn-assign:hover {
    background-color: #e06327;
}

.panel-btn-assign:active {
    transform: scale(0.98);
}

.panel-sid-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.panel-search-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    color: #64748b;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.panel-search-btn:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.panel-search-btn.active {
    background-color: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-color: rgba(46, 204, 113, 0.4);
}

/* Custom Checkboxes for Settings */
.custom-checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #64748b;
    user-select: none;
}

.custom-checkbox {
    appearance: none;
    background-color: #fff;
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid #94a3b8;
    border-radius: 0.25em;
    display: grid;
    place-content: center;
    transition: 0.15s ease-in-out;
    cursor: pointer;
}

.custom-checkbox::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    transform-origin: bottom left;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.custom-checkbox:checked {
    background-color: #f37b42;
    border-color: #f37b42;
}

.custom-checkbox:checked::before {
    transform: scale(1);
}

/* Custom Color Pickers */
.color-picker-modern-wrapper {
    width: 60px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    background: #fff;
}

.color-picker-modern-wrapper:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.color-picker-modern-input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

.color-picker-modern-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-modern-input::-webkit-color-swatch {
    border: none;
    border-radius: 0;
}

/* --- MODERN SETTINGS UI --- */
.settings-modal-modern {
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    padding: 40px;
    gap: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    text-align: left;
}

.settings-modal-header {
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 20px;
}

.settings-modal-header h3 {
    margin: 0 0 8px 0;
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    text-align: left !important;
}

.settings-modal-header p {
    margin: 0;
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
    text-align: left !important;
}

.settings-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr 2.2fr;
    gap: 30px;
    flex: 1;
    overflow-y: auto;
    padding-right: 15px;
}

/* Custom Scrollbars */
.settings-grid-modern::-webkit-scrollbar,
.settings-docks-container::-webkit-scrollbar {
    width: 6px;
}

.settings-grid-modern::-webkit-scrollbar-track,
.settings-docks-container::-webkit-scrollbar-track {
    background: transparent;
}

.settings-grid-modern::-webkit-scrollbar-thumb,
.settings-docks-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.settings-grid-modern::-webkit-scrollbar-thumb:hover,
.settings-docks-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px 0;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 8px;
}

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-modern.row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.label-modern {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
}

.input-modern {
    background-color: #f8fafc;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 16px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #0f172a;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.input-modern:focus {
    background-color: #ffffff;
    border-color: #f37b42;
    box-shadow: 0 0 0 4px rgba(243, 123, 66, 0.15);
    outline: none;
}

.settings-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.btn-modern-secondary {
    padding: 12px 24px;
    border-radius: 12px;
    background-color: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modern-secondary:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.btn-modern-primary {
    padding: 12px 32px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f37b42, #e86326);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(243, 123, 66, 0.3);
    transition: all 0.2s;
}

.btn-modern-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(243, 123, 66, 0.4);
}

/* --- SETTINGS TABS --- */
.settings-tabs-nav {
    display: flex;
    gap: 30px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 25px;
}

.settings-tab-btn {
    background: none;
    border: none;
    padding: 10px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.settings-tab-btn:hover {
    color: #0f172a;
}

.settings-tab-btn.active {
    color: #0f172a;
}

.settings-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #f37b42;
    border-radius: 3px 3px 0 0;
}

.settings-tabs-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

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

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

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- MODERN DOCKS SETTINGS --- */
.dock-card-modern {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.dock-card-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    border-color: #f37b42;
}

.dock-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    padding-bottom: 12px;
}

.dock-icon-modern {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(243, 123, 66, 0.1);
    color: #f37b42;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.dock-name-modern {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.dock-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
