:root {
    --bg-color: #0f172a;
    --bg-drawer: #1e293b;
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --message-user: #0ea5e9;
    --message-bot: #334155;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    position: relative;
}

/* --- Drawer Overlay --- */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* --- Navigation Drawer --- */
.nav-drawer {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    height: 100%;
    background: var(--bg-drawer);
    border-right: 1px solid var(--border-color);
    z-index: 101;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
}

.nav-drawer.active {
    transform: translateX(var(--sidebar-width));
}

.drawer-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    color: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
}

.brand-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.drawer-brand h2 {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    color: white;
}

.btn-close-drawer {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-close-drawer:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.btn-close-drawer svg {
    width: 20px;
    height: 20px;
}

.drawer-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

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

.nav-item.active {
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.drawer-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: center;
}

/* --- Main Content Layout --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: radial-gradient(circle at top right, #1e293b, #0f172a);
    position: relative;
    overflow: hidden;
}

.app-header {
    height: 70px;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.menu-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-badge.online {
    color: #10b981;
}

.status-badge.online .status-dot {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-badge.offline {
    color: #f87171;
}

.status-badge.offline .status-dot {
    background: #f87171;
    box-shadow: 0 0 8px #f87171;
}

/* --- View Management --- */
.view-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none; /* Changed from visibility/opacity for better isolation */
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-color: var(--bg-color); /* Ensure background covers elements below */
}

.view-content.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* --- Chat View Specifics --- */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    line-height: 1.55;
    animation: messageIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    font-size: 0.95rem;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.message.bot {
    align-self: flex-start;
    background: var(--message-bot);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-input-container {
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-input-container textarea {
    flex: 1;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    max-height: 150px;
    transition: border-color 0.2s;
}

.chat-input-container textarea:focus {
    border-color: var(--accent-color);
}

.btn-send {
    width: 46px;
    height: 46px;
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-send:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.btn-send svg {
    width: 20px;
    height: 20px;
}

/* --- Panel Layout (Settings & Monitoring) --- */
.panel-container {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    overflow-y: auto;
}

.panel-header {
    margin-bottom: 2rem;
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.panel-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.panel-desc-note {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(56, 189, 248, 0.05);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-size: 0.85rem !important;
    color: var(--accent-color) !important;
}

/* --- Settings Form --- */
.settings-form {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.settings-fields {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: block;
}

.setting-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.setting-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    margin: 0.5rem 0;
}

.setting-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* --- Settings Tabs --- */
.settings-tabs-wrapper {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-tabs {
    display: flex;
    gap: 2rem;
    padding: 0 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 0.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-btn:hover {
    color: white;
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* --- Toggle Switch --- */
.setting-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.setting-info {
    flex: 1;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

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

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

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

/* --- Refined Settings Item --- */
.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0.8;
}

.settings-actions {
    padding: 1.25rem 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: var(--accent-color);
    color: var(--bg-color);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: rgba(248, 113, 113, 0.1);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: #f87171;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Monitoring View Styles --- */
.logs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(30, 41, 59, 0.4);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.control-group {
    display: flex;
    gap: 1.25rem;
    align-items: flex-end;
}

.log-control-inline {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.log-control-inline span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.log-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.log-check input {
    accent-color: var(--accent-color);
}

.log-bulk-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.select-all-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.select-all-container input {
    accent-color: var(--accent-color);
}

.log-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
}

.summary-card.active .summary-value { color: #22d3ee; }
.summary-card.completed .summary-value { color: #34d399; }
.summary-card.failed .summary-value { color: #fb7185; }
.summary-card.ignored .summary-value { color: #94a3b8; }

.log-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.log-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.log-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
}

.log-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.log-item-checkbox {
    margin-top: 2px;
}

.log-item-checkbox input {
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.log-status-container {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-delete-log {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-delete-log:hover {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.btn-delete-log svg {
    width: 16px;
    height: 16px;
}

.log-status {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.status-received { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.status-processing { background: rgba(251, 191, 36, 0.1); color: #fbbf24; }
.status-completed { background: rgba(52, 211, 153, 0.1); color: #34d399; }
.status-failed { background: rgba(248, 113, 113, 0.1); color: #f87171; }

.log-lines {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.log-line span {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.15rem;
}

.log-line strong {
    font-size: 0.85rem;
    word-break: break-all;
}

.log-preview {
    background: rgba(15, 23, 42, 0.4);
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-left: 4px solid var(--accent-color);
    min-width: 300px;
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .panel-container {
        padding: 1rem;
    }
    
    .log-lines {
        grid-template-columns: 1fr;
    }
    
    .logs-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* --- Knowledge Base View Specifics --- */
.knowledge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.knowledge-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.knowledge-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--accent-color);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(15, 23, 42, 0.3);
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent-color);
    background: rgba(56, 189, 248, 0.05);
}

.upload-icon svg {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.file-info {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.message-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 8px;
    margin-left: 12px;
    display: none;
    flex-direction: column;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
}

.message-status.active {
    display: flex;
    opacity: 1;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.user + .message.bot {
    margin-top: 1.5rem;
}

.selected-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.file-item {
    background: rgba(15, 23, 42, 0.5);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.file-item .remove-file {
    color: #f87171;
    cursor: pointer;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5rem 0;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

.search-input-group input {
    flex: 1;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-result-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
}

.result-title {
    font-weight: 600;
    color: var(--accent-color);
}

.result-score {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
}

.result-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.w-100 { width: 100%; }

.settings-actions-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.knowledge-card .settings-fields {
    padding: 0;
    gap: 1rem;
}

@media (max-width: 900px) {
    .knowledge-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .status-badge span:not(.status-dot) {
        display: none;
    }
    .app-header {
        padding: 0 1rem;
        gap: 0.75rem;
    }
    .status-badge {
        padding: 0.4rem;
    }
}

/* --- Skill Management --- */
.skills-settings-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    background: rgba(30, 41, 59, 0.4);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.skill-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    animation: skillCardFadeIn 0.5s ease-out both;
}

@keyframes skillCardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.skill-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), 0 0 20px rgba(56, 189, 248, 0.1);
    background: rgba(30, 41, 59, 0.6);
}

.skill-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.skill-icon-box {
    width: 48px;
    height: 48px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.panel-info h3 {
    font-size: 1rem;
    color: white;
    margin-bottom: 4px;
}

.panel-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.skill-title-area {
    flex: 1;
}

.skill-card h3 {
    margin: 0;
    font-family: var(--font-heading);
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
}

.skill-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-main);
    opacity: 0.8;
}

.skill-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
}

.skill-footer {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.skill-toggle-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

/* Modern Toggle Switch */
.skill-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.skill-hint {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.9;
    line-height: 1.4;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

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

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

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

.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(30, 41, 59, 0.2);
    border-radius: 20px;
    border: 1px dashed var(--border-color);
}

.loading-placeholder.error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.2);
}
