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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f7fa;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* 核心：禁止整页滚动，保持全屏状态 */
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-icon {
    font-size: 1.5rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    margin-right: 0.5rem;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.nav-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    background: transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:hover {
    transform: translateY(-2px);
    color: white;
}

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

.nav-btn.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.nav-btn-icon {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.nav-btn:hover .nav-btn-icon {
    transform: scale(1.15);
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.25rem;
}

.btn-logout {
    background: rgba(255, 82, 82, 0.2);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.btn-logout:hover::before {
    background: rgba(255, 82, 82, 0.3);
}

.btn {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-info {
    background: #2196F3;
    color: white;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

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

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.left-panel {
    width: 300px;
    /* Initial width */
    min-width: 200px;
    max-width: 800px;
    background: white;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
}

.resizer {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 10;
    flex-shrink: 0;
}

.resizer:hover,
.resizer.resizing {
    background: #667eea;
}

/* Storage Indicator Styles */
.storage-indicator {
    padding: 0.6rem 0.75rem;
    border-top: 1px solid #e8e8e8;
    background: linear-gradient(180deg, #fafbfc 0%, #f0f2f5 100%);
    position: relative;
    overflow: hidden;
    transition: background 0.2s;
}
.storage-indicator:hover {
    background: linear-gradient(180deg, #f5f6fa 0%, #e8ecf5 100%);
}

.storage-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: -200% 0;
    }

    50% {
        background-position: 200% 0;
    }
}

.storage-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.storage-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    letter-spacing: 0.3px;
    margin-right: 0.3rem;
}

.storage-clear-btn {
    background: transparent;
    border: none;
    padding: 0.15rem 0.3rem;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.storage-clear-btn:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

.storage-icon {
    font-size: 1.1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

.storage-progress-wrapper {
    position: relative;
    margin-bottom: 0.75rem;
}

.storage-progress-bar {
    height: 8px;
    background: linear-gradient(90deg, #e8ecef, #d8dde3);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.storage-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2, #a855f7);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    animation: gradientMove 3s ease-in-out infinite;
    position: relative;
}

@keyframes gradientMove {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.storage-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shinePass 2s ease-in-out infinite;
}

@keyframes shinePass {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(200%);
    }
}

.storage-progress-glow {
    position: absolute;
    top: -2px;
    left: 0;
    height: 12px;
    width: 0%;
    background: radial-gradient(ellipse at center, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.storage-stats {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.storage-stat {
    flex: 1;
    text-align: center;
    padding: 0.4rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.storage-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.15);
    border-color: #d0d6ff;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    color: #888;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.storage-percentage {
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: auto;
}

/* Success Modal Styles */
.success-icon {
    font-size: 4rem;
    color: #4CAF50;
    margin-bottom: 1rem;
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.success-summary {
    background: #f1f8e9;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #c5e1a5;
}

.upload-results-list {
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.5rem;
    font-size: 0.85rem;
}

.upload-result-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem;
    border-bottom: 1px solid #f5f5f5;
}

.upload-result-item:last-child {
    border-bottom: none;
}

.result-success {
    color: #2e7d32;
}

.result-error {
    color: #c62828;
}

.panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.panel-header h3 {
    font-size: 0.95rem;
    color: #333;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    /* 保证滚动条预留空间，防止内容闪烁 */
    scrollbar-gutter: stable;
    min-height: 0;
    /* 关键：允许 flex 子元素在内容过多时缩小/滚动 */
}

/* 精准锁定目录管理面板的自定义滚动条样式 */
.left-panel .panel-content::-webkit-scrollbar {
    width: 6px;
}

.left-panel .panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.left-panel .panel-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    transition: background 0.3s;
}

.left-panel .panel-content::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

.category-tree {
    font-size: 0.9rem;
}

.cat-item {
    border-radius: 6px;
    margin-bottom: 2px;
}

.cat-header {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    gap: 0.4rem;
}

.cat-header:hover {
    background: #f0f0f0;
}

.cat-header.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.cat-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #888;
    flex-shrink: 0;
}

.cat-header.active .cat-toggle {
    color: white;
}

.cat-icon {
    font-size: 1rem;
}

.cat-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.cat-header:hover .cat-actions {
    opacity: 1;
}

.cat-actions .btn {
    padding: 0.15rem 0.35rem;
    font-size: 0.7rem;
}

.cat-children {
    margin-left: 1rem;
    border-left: 1px solid #e0e0e0;
    padding-left: 0.5rem;
}

.cat-children.collapsed {
    display: none;
}

.level-badge {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    background: #e0e0e0;
    color: #666;
}

.cat-header.active .level-badge {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.right-header {
    padding: 1rem 1.5rem;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.right-header h2 {
    font-size: 1.1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

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

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 180px;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.right-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    min-height: 0;
}

.upload-zone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: #fafafa;
    margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-zone input {
    display: none;
}

.upload-zone .icon {
    font-size: 1.5rem;
    color: #ccc;
}

.upload-zone p {
    color: #666;
    margin: 0.25rem 0;
    font-size: 0.85rem;
}

.upload-preview {
    margin-top: 0.5rem;
}

.upload-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.6rem;
    background: #e8f5e9;
    border-radius: 5px;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.audio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.6rem;
}

.audio-item {
    background: white;
    padding: 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s;
    border: 1px solid #eee;
    cursor: pointer;
}

.audio-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.audio-item.playing {
    border-color: #4CAF50;
    background: #f1f8f1;
}

.audio-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.audio-item.playing .audio-icon {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-meta {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.1rem;
}

.audio-actions {
    display: flex;
    gap: 0.25rem;
}

.audio-actions .btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
}

/* Audio table action buttons - larger icons without borders */
.audio-table td .btn.btn-ghost.btn-sm {
    border: none;
    background: transparent;
    padding: 0.4rem;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.audio-table td .btn.btn-ghost.btn-sm:hover {
    opacity: 1;
    transform: scale(1.15);
    background: transparent;
}

.audio-table td .btn.btn-ghost.btn-sm .icon {
    font-size: 1.1rem;
}

.audio-table td .btn.btn-ghost.btn-sm.btn-danger:hover {
    color: #ef4444;
}

.progress-container {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    cursor: pointer;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    width: 0;
}

.time-display {
    font-size: 0.7rem;
    color: #888;
    min-width: 35px;
}

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #666;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.65rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.6rem;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.tab.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.message {
    padding: 0.65rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.message.success {
    background: #d4edda;
    color: #155724;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
}

.hidden {
    display: none !important;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #888;
}

.empty-state .icon {
    font-size: 2.5rem;
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.naming-tips {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.naming-tips h4 {
    color: #f57c00;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.naming-tips ul {
    margin: 0;
    padding-left: 1.2rem;
}

.naming-tips li {
    margin-bottom: 0.3rem;
    color: #666;
}

.naming-tips code {
    background: #fee;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

.naming-tips .example {
    background: #e8f5e9;
    padding: 0.5rem;
    border-radius: 6px;
    color: #2e7d32;
    word-break: break-all;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    min-width: 280px;
    max-width: 400px;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toast-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transition: all 0.3s ease;
}

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

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

.toast.success {
    border-left-color: #48bb78;
}

.toast.info {
    border-left-color: #4299e1;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-content {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

@keyframes toast-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

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

.toast.fade-out {
    transform: translateX(100%);
    opacity: 0;
    margin-top: -3.5rem;
}

@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    .left-panel {
        width: 100%;
        height: auto;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .audio-grid {
        grid-template-columns: 1fr;
    }

    .search-input {
        width: 120px;
    }
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 18px;
}

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

input:checked+.slider {
    background-color: #667eea;
}

input:focus+.slider {
    box-shadow: 0 0 1px #667eea;
}

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

.lock-container {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    font-size: 0.75rem;
    color: #666;
    margin-right: 0.2rem;
}

.code-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    position: relative;
    margin-top: 0.5rem;
}

.code-block .label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    color: #aaa;
}

.code-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.code-tab {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 0.85rem;
    color: #666;
}

.code-tab.active {
    background: #667eea;
    color: white;
}

.api-key-list {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.api-key-list th,
.api-key-list td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

/* --- Redesigned API Modal Styles --- */
.modal-body.no-padding {
    padding: 0;
    display: flex;
    height: 520px;
}

.modal-sidebar {
    width: 180px;
    background: #f8f9fb;
    border-right: 1px solid #e5e7eb;
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.modal-content-area {
    flex: 1;
    padding: 1.75rem 2rem;
    overflow-y: auto;
    background: #fff;
    min-width: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: 8px;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-item:hover {
    background: #eef2ff;
    color: #667eea;
}

.nav-item.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* API View Common */
.api-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.api-view-title {
    margin: 0 0 0.2rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.api-view-desc {
    margin: 0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.5;
}

.api-form-label {
    font-size: 0.8rem;
    color: #64748b;
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.api-form-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    background: #fff;
}

.api-form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Keys View */
.api-create-key-box {
    background: #f8fafc;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
}

/* Settings View */
.api-settings-card {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s;
}

.api-settings-card:hover {
    border-color: #cbd5e1;
}

.api-settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.api-settings-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e293b;
}

.api-settings-card-desc {
    font-size: 0.78rem;
    color: #94a3b8;
}

.api-settings-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.api-settings-field {
    flex: 1;
}

.api-settings-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-settings-hint {
    font-size: 0.78rem;
    color: #f59e0b;
}

/* Endpoints View */
.api-endpoints-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.api-endpoints-stats {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.key-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.15rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.15s;
    position: relative;
    overflow: hidden;
}

.key-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.1);
}

.key-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
    opacity: 0;
    transition: opacity 0.15s;
}

.key-card:hover::before {
    opacity: 1;
}

.key-value-box {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 0.82rem;
    color: #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.75rem 0;
    border: 1px solid #e2e8f0;
}

.copy-btn {
    font-size: 0.75rem;
    background: white;
    border: 1px solid #d1d5db;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    transition: all 0.1s;
}

.copy-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.platform-chips {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.platform-chip {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #e1e4e8;
    background: white;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.platform-chip:hover {
    border-color: #667eea;
    color: #667eea;
}

.platform-chip.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.2);
}

.key-reveal {
    border-radius: 3px;
}

/* --- Audio Management Redesign --- */
.upload-drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 1.5rem;
    position: relative;
}

.upload-drop-zone:hover,
.upload-drop-zone.dragover {
    border-color: #667eea;
    background: #eef2ff;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.upload-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.file-preview-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.audio-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eee;
}

.audio-table {
    width: 100%;
    border-collapse: collapse;
}

.audio-table th {
    text-align: left;
    padding: 1rem;
    background: #f8f9fa;
    color: #666;
    font-weight: 500;
    font-size: 0.85rem;
    border-bottom: 1px solid #eee;
}

.audio-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #444;
    font-size: 0.9rem;
}

.audio-table tr:hover {
    background: #f9fafb;
}

.audio-title-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.audio-icon-small {
    width: 32px;
    height: 32px;
    background: #eef2ff;
    color: #667eea;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* 3. Floating Player Bar */
.player-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-bar.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-title {
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.player-meta {
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-controls-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-play-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
    transition: all 0.2s;
}

.btn-play-circle:hover {
    transform: scale(1.05);
    background: #5a67d8;
}

.progress-track {
    flex: 2;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    border-radius: 3px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    background: white;
    opacity: 0.3;
    box-shadow: 0 0 10px white;
}

/* --- New Modal Card Styles --- */
.modal-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header {
    padding: 1.25rem 1.75rem;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    color: #1a1a1a;
    font-weight: 600;
}

.btn-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.btn-close:hover {
    background: #fee2e2;
    color: #ef4444;
    transform: rotate(90deg);
}

/* Upload Modal Styles */
.upload-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #fafafa;
}

.upload-dropzone:hover:not(.disabled),
.upload-dropzone.dragover {
    border-color: #667eea;
    background: #f0f4ff;
}

.upload-dropzone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-modal-cat-item {
    margin-bottom: 2px;
}

.upload-modal-cat-header {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.upload-modal-cat-header:hover {
    background: #e5e7eb;
}

.upload-modal-cat-header.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.upload-modal-cat-header.non-leaf {
    opacity: 0.7;
}

.upload-modal-cat-children {
    padding-left: 1rem;
}

.upload-modal-cat-children.collapsed {
    display: none;
}

.upload-modal-leaf-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.25rem;
    background: #10b981;
    color: white;
    border-radius: 3px;
    margin-left: auto;
}

.upload-modal-leaf-badge.has-audios {
    background: #f59e0b;
    /* Amber 500 */
}

.upload-modal-file-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f1f1;
    gap: 0.6rem;
}

.upload-modal-file-item:last-child {
    border-bottom: none;
}

.upload-modal-file-status {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.upload-modal-file-status.pending {
    background: #f3f4f6;
    color: #6b7280;
}

.upload-modal-file-status.uploading {
    background: #dbeafe;
    color: #1d4ed8;
}

.upload-modal-file-status.success {
    background: #d1fae5;
    color: #047857;
}

.upload-modal-file-status.error {
    background: #fee2e2;
    color: #dc2626;
}

/* ======================================
   CSS Icon System - Elegant & Minimal
   ====================================== */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    position: relative;
    flex-shrink: 0;
}

/* Audio/Music Icon - Music Note Style */
.icon-audio::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    background: currentColor;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    left: 0;
}

.icon-audio::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 0.65em;
    background: currentColor;
    left: 0.25em;
    bottom: 0.1em;
    border-radius: 0 2px 0 0;
    transform-origin: bottom;
    transform: rotate(-10deg);
}

/* Audio Wave Icon - Sound Wave Style */
.icon-wave::before {
    content: '';
    width: 0.15em;
    height: 0.5em;
    background: currentColor;
    border-radius: 2px;
    box-shadow:
        0.2em 0.1em 0 currentColor,
        0.4em -0.05em 0 currentColor,
        0.6em 0.15em 0 currentColor;
}

/* Audio Disc Icon - Vinyl/CD Style */
.icon-disc::before {
    content: '';
    width: 0.7em;
    height: 0.7em;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}

.icon-disc::after {
    content: '';
    position: absolute;
    width: 0.2em;
    height: 0.2em;
    background: currentColor;
    border-radius: 50%;
}

/* Headphone Icon */
.icon-headphone::before {
    content: '';
    width: 0.6em;
    height: 0.35em;
    border: 2px solid currentColor;
    border-bottom: none;
    border-radius: 0.3em 0.3em 0 0;
    position: relative;
    top: -0.05em;
}

.icon-headphone::after {
    content: '';
    position: absolute;
    width: 0.2em;
    height: 0.25em;
    background: currentColor;
    border-radius: 2px;
    bottom: 0;
    left: 0;
    box-shadow: 0.5em 0 0 currentColor;
}

/* Speaker Icon */
.icon-speaker::before {
    content: '';
    width: 0.25em;
    height: 0.35em;
    background: currentColor;
    position: relative;
    left: -0.1em;
}

.icon-speaker::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 0.25em solid transparent;
    border-bottom: 0.25em solid transparent;
    border-left: 0.25em solid currentColor;
    left: 0.1em;
}

/* Folder Icon */
.icon-folder::before {
    content: '';
    width: 0.9em;
    height: 0.6em;
    background: currentColor;
    border-radius: 0 2px 2px 2px;
    position: relative;
}

.icon-folder::after {
    content: '';
    position: absolute;
    width: 0.4em;
    height: 0.15em;
    background: currentColor;
    border-radius: 2px 2px 0 0;
    top: 0.05em;
    left: 0.05em;
}

/* Folder Open Icon */
.icon-folder-open::before {
    content: '';
    width: 0.9em;
    height: 0.5em;
    border: 2px solid currentColor;
    border-radius: 0 2px 2px 2px;
    position: relative;
    top: 0.1em;
}

/* Delete/Trash Icon */
.icon-trash::before {
    content: '';
    width: 0.6em;
    height: 0.65em;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 2px 2px;
    position: relative;
    top: 0.1em;
}

.icon-trash::after {
    content: '';
    position: absolute;
    width: 0.8em;
    height: 2px;
    background: currentColor;
    top: 0.1em;
    border-radius: 1px;
}

/* Edit/Pencil Icon */
.icon-edit::before {
    content: '';
    width: 0.55em;
    height: 0.55em;
    border: 2px solid currentColor;
    border-radius: 1px;
    transform: rotate(45deg);
    position: relative;
}

.icon-edit::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 0.15em solid transparent;
    border-right: 0.15em solid transparent;
    border-top: 0.2em solid currentColor;
    bottom: 0.05em;
    left: 0.2em;
    transform: rotate(45deg);
}

/* Play Icon */
.icon-play::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 0.35em solid transparent;
    border-bottom: 0.35em solid transparent;
    border-left: 0.55em solid currentColor;
    margin-left: 0.1em;
}

/* Pause Icon */
.icon-pause::before,
.icon-pause::after {
    content: '';
    width: 0.2em;
    height: 0.6em;
    background: currentColor;
    border-radius: 1px;
}

.icon-pause::before {
    margin-right: 0.15em;
}

/* Stop Icon */
.icon-stop::before {
    content: '';
    width: 0.55em;
    height: 0.55em;
    background: currentColor;
    border-radius: 2px;
}

/* Copy Icon */
.icon-copy::before {
    content: '';
    width: 0.5em;
    height: 0.6em;
    border: 2px solid currentColor;
    border-radius: 2px;
    position: relative;
}

.icon-copy::after {
    content: '';
    position: absolute;
    width: 0.5em;
    height: 0.6em;
    border: 2px solid currentColor;
    border-radius: 2px;
    top: -0.15em;
    left: 0.15em;
    background: inherit;
}

/* Check/Success Icon */
.icon-check::before {
    content: '';
    width: 0.3em;
    height: 0.55em;
    border: 2px solid currentColor;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    margin-top: -0.1em;
}

/* X/Close/Error Icon */
.icon-x::before,
.icon-x::after {
    content: '';
    position: absolute;
    width: 0.7em;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

.icon-x::before {
    transform: rotate(45deg);
}

.icon-x::after {
    transform: rotate(-45deg);
}

/* Warning Icon */
.icon-warning::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 0.45em solid transparent;
    border-right: 0.45em solid transparent;
    border-bottom: 0.75em solid currentColor;
}

.icon-warning::after {
    content: '!';
    position: absolute;
    font-size: 0.45em;
    font-weight: bold;
    color: white;
    bottom: 0.15em;
}

/* Info Icon */
.icon-info::before {
    content: '';
    width: 0.7em;
    height: 0.7em;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.icon-info::after {
    content: 'i';
    position: absolute;
    font-size: 0.5em;
    font-weight: bold;
    font-style: italic;
    font-family: serif;
}

/* Lock Icon */
.icon-lock::before {
    content: '';
    width: 0.5em;
    height: 0.35em;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    top: 0.15em;
}

.icon-lock::after {
    content: '';
    position: absolute;
    width: 0.35em;
    height: 0.25em;
    border: 2px solid currentColor;
    border-bottom: none;
    border-radius: 0.2em 0.2em 0 0;
    top: 0;
}

/* Unlock Icon */
.icon-unlock::before {
    content: '';
    width: 0.5em;
    height: 0.35em;
    background: currentColor;
    border-radius: 2px;
    position: relative;
    top: 0.15em;
}

.icon-unlock::after {
    content: '';
    position: absolute;
    width: 0.35em;
    height: 0.25em;
    border: 2px solid currentColor;
    border-bottom: none;
    border-radius: 0.2em 0.2em 0 0;
    top: 0;
    left: 0.4em;
}

/* Upload Icon */
.icon-upload::before {
    content: '';
    width: 0.6em;
    height: 0.45em;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 3px 3px;
    position: relative;
    top: 0.15em;
}

.icon-upload::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 0.25em solid transparent;
    border-right: 0.25em solid transparent;
    border-bottom: 0.35em solid currentColor;
    top: 0;
}

/* Download Icon */
.icon-download::before {
    content: '';
    width: 0.6em;
    height: 0.45em;
    border: 2px solid currentColor;
    border-top: none;
    border-radius: 0 0 3px 3px;
    position: relative;
    top: 0.15em;
}

.icon-download::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 0.25em solid transparent;
    border-right: 0.25em solid transparent;
    border-top: 0.35em solid currentColor;
    top: 0.15em;
}

/* Chart/Stats Icon */
.icon-chart::before {
    content: '';
    width: 0.2em;
    height: 0.6em;
    background: currentColor;
    position: absolute;
    left: 0;
    bottom: 0.1em;
    border-radius: 1px;
}

.icon-chart::after {
    content: '';
    width: 0.2em;
    height: 0.4em;
    background: currentColor;
    position: absolute;
    right: 0;
    bottom: 0.1em;
    border-radius: 1px;
    box-shadow: -0.25em 0.1em 0 currentColor;
}

/* Search Icon */
.icon-search::before {
    content: '';
    width: 0.45em;
    height: 0.45em;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
    top: -0.05em;
    left: -0.05em;
}

.icon-search::after {
    content: '';
    position: absolute;
    width: 0.3em;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    right: 0.05em;
    bottom: 0.15em;
    border-radius: 1px;
}

/* Package/Box Icon */
.icon-box::before {
    content: '';
    width: 0.7em;
    height: 0.55em;
    border: 2px solid currentColor;
    border-radius: 2px;
    position: relative;
    top: 0.1em;
}

.icon-box::after {
    content: '';
    position: absolute;
    width: 0.15em;
    height: 0.3em;
    background: currentColor;
    top: 0.1em;
}

/* Refresh Icon */
.icon-refresh::before {
    content: '';
    width: 0.55em;
    height: 0.55em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
}

.icon-refresh::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 0.15em solid transparent;
    border-bottom: 0.15em solid transparent;
    border-left: 0.2em solid currentColor;
    right: 0.05em;
    top: 0.05em;
}

/* Camera/Snapshot Icon */
.icon-camera::before {
    content: '';
    width: 0.7em;
    height: 0.5em;
    border: 2px solid currentColor;
    border-radius: 3px;
    position: relative;
    top: 0.1em;
}

.icon-camera::after {
    content: '';
    position: absolute;
    width: 0.3em;
    height: 0.3em;
    border: 2px solid currentColor;
    border-radius: 50%;
}

/* Plus Icon */
.icon-plus::before,
.icon-plus::after {
    content: '';
    position: absolute;
    background: currentColor;
    border-radius: 1px;
}

.icon-plus::before {
    width: 0.6em;
    height: 2px;
}

.icon-plus::after {
    width: 2px;
    height: 0.6em;
}

/* Minus Icon */
.icon-minus::before {
    content: '';
    width: 0.6em;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

/* Settings/Gear Icon */
.icon-settings::before {
    content: '';
    width: 0.5em;
    height: 0.5em;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.icon-settings::after {
    content: '';
    position: absolute;
    width: 0.8em;
    height: 0.8em;
    background: radial-gradient(circle, transparent 40%, currentColor 40%, currentColor 50%, transparent 50%);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Chevron Icons */
.icon-chevron-right::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    border: 2px solid currentColor;
    border-left: none;
    border-bottom: none;
    transform: rotate(45deg);
    margin-left: -0.1em;
}

.icon-chevron-down::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    border: 2px solid currentColor;
    border-left: none;
    border-top: none;
    transform: rotate(45deg);
    margin-top: -0.1em;
}

.icon-chevron-left::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    border: 2px solid currentColor;
    border-right: none;
    border-top: none;
    transform: rotate(45deg);
    margin-right: -0.1em;
}

/* External Link Icon */
.icon-external::before {
    content: '';
    width: 0.45em;
    height: 0.45em;
    border: 2px solid currentColor;
    border-radius: 1px;
    position: relative;
    top: 0.1em;
    left: -0.1em;
}

.icon-external::after {
    content: '';
    position: absolute;
    width: 0.35em;
    height: 2px;
    background: currentColor;
    transform: rotate(-45deg);
    top: 0.1em;
    right: 0.1em;
    box-shadow: 0.12em -0.12em 0 -1px currentColor;
}

/* Log/List Icon */
.icon-list::before {
    content: '';
    width: 0.7em;
    height: 2px;
    background: currentColor;
    box-shadow: 0 0.2em 0 currentColor, 0 0.4em 0 currentColor;
    border-radius: 1px;
}

/* Key Icon */
.icon-key::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
    left: -0.15em;
}

.icon-key::after {
    content: '';
    position: absolute;
    width: 0.4em;
    height: 2px;
    background: currentColor;
    right: 0;
    box-shadow: 0 0.1em 0 currentColor;
}

/* User Icon */
.icon-user::before {
    content: '';
    width: 0.35em;
    height: 0.35em;
    background: currentColor;
    border-radius: 50%;
    position: relative;
    top: -0.15em;
}

.icon-user::after {
    content: '';
    position: absolute;
    width: 0.6em;
    height: 0.3em;
    background: currentColor;
    border-radius: 0.3em 0.3em 0 0;
    bottom: 0;
}

/* Logout Icon */
.icon-logout::before {
    content: '';
    width: 0.45em;
    height: 0.5em;
    border: 2px solid currentColor;
    border-right: none;
    border-radius: 3px 0 0 3px;
    position: relative;
    left: -0.1em;
}

.icon-logout::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-top: 0.2em solid transparent;
    border-bottom: 0.2em solid transparent;
    border-left: 0.25em solid currentColor;
    right: 0;
}

/* Database Icon */
.icon-database::before {
    content: '';
    width: 0.6em;
    height: 0.6em;
    border: 2px solid currentColor;
    border-radius: 0.3em/0.15em;
    position: relative;
}

.icon-database::after {
    content: '';
    position: absolute;
    width: 0.6em;
    height: 2px;
    background: currentColor;
    top: 50%;
}

/* Cloud Icon */
.icon-cloud::before {
    content: '';
    width: 0.7em;
    height: 0.4em;
    background: currentColor;
    border-radius: 0.2em;
    position: relative;
    top: 0.15em;
}

.icon-cloud::after {
    content: '';
    position: absolute;
    width: 0.35em;
    height: 0.35em;
    background: currentColor;
    border-radius: 50%;
    top: 0;
    left: 0.1em;
    box-shadow: 0.25em 0 0 currentColor;
}

/* Switch/Toggle Icon */
.icon-switch::before {
    content: '';
    width: 0.75em;
    height: 0.4em;
    border: 2px solid currentColor;
    border-radius: 0.25em;
}

.icon-switch::after {
    content: '';
    position: absolute;
    width: 0.22em;
    height: 0.22em;
    background: currentColor;
    border-radius: 50%;
    right: 0.18em;
}

/* Book/Document Icon */
.icon-book::before {
    content: '';
    width: 0.55em;
    height: 0.6em;
    border: 2px solid currentColor;
    border-radius: 0 2px 2px 0;
    border-left: none;
    position: relative;
    left: 0.05em;
}

.icon-book::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 0.7em;
    background: currentColor;
    left: 0.15em;
    border-radius: 1px;
}

/* Icon sizes */
.icon-sm {
    font-size: 0.75rem;
}

.icon-md {
    font-size: 1rem;
}

.icon-lg {
    font-size: 1.25rem;
}

.icon-xl {
    font-size: 1.5rem;
}

/* Icon colors */
.icon-primary {
    color: #667eea;
}

.icon-success {
    color: #10b981;
}

.icon-warning {
    color: #f59e0b;
}

.icon-danger {
    color: #ef4444;
}

.icon-muted {
    color: #9ca3af;
}.cat-header.drag-over { background-color: #e3f2fd; border: 2px dashed #2196f3; } .cat-header.dragging { opacity: 0.5; }
.icon-loader { animation: spin 1s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Dashboard Styles */
.dashboard-container {
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dashboard-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-refresh {
    font-size: 0.85rem;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.dashboard-refresh:hover {
    background: rgba(102, 126, 234, 0.1);
}

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
    border: 1px solid #eee;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-card.blue .stat-icon { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-card.green .stat-icon { background: linear-gradient(135deg, #4CAF50, #81C784); }
.stat-card.purple .stat-icon { background: linear-gradient(135deg, #AB47BC, #BA68C8); }

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.2rem;
}

.dashboard-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.dashboard-section h4 {
    margin: 0 0 1.5rem 0;
    font-size: 1rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.chart-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.chart-label {
    width: 150px;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #666;
}

.chart-bar-container {
    flex: 1;
    background: #f5f7fa;
    height: 24px;
    border-radius: 4px;
    overflow: visible;
    position: relative;
    display: flex;
    align-items: center;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    min-width: 4px;
    transition: width 0.5s ease-out;
}

.chart-value {
    margin-left: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.dashboard-section.empty {
    text-align: center;
    padding: 3rem;
    color: #ccc;
}
.dashboard-section.empty .icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.dashboard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #888;
    gap: 0.5rem;
}
/* Batch Rename Redesign */

/* Segmented Control Tabs */
.segmented-control {
    display: flex;
    background: #f0f2f5;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.segment-btn {
    flex: 1;
    padding: 8px 12px;
    text-align: center;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.segment-btn:hover {
    color: #333;
}

.segment-btn.active {
    background: white;
    color: #2196f3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

/* Option Cards */
.option-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-card:hover {
    border-color: #bbdefb;
    background: #f5f9ff;
    transform: translateY(-1px);
}

.option-card.active {
    border-color: #2196f3;
    background: #e3f2fd;
    box-shadow: 0 0 0 1px #2196f3 inset;
}

.option-card input[type="radio"] {
    margin-right: 12px;
    accent-color: #2196f3;
    transform: scale(1.2);
}

.option-content {
    flex: 1;
}

.option-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    display: block;
}

.option-desc {
    font-size: 0.8rem;
    color: #888;
    display: block;
}

.option-example {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: #555;
    font-size: 0.75rem;
}

/* Form Styling Enhancements */
.form-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.form-label-bold {
    font-weight: 600;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 8px;
    display: block;
}

.helper-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

.regex-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
}

.regex-toggle:hover {
    background: #dee2e6;
}

.regex-toggle input:checked+span {
    color: #2196f3;
    font-weight: 500;
}

/* Animations */
.modal-body-content {
    animation: fadeIn 0.3s ease-out;
}

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

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

/* ============================================
   NEW LOG VIEWER STYLES
   ============================================ */

.log-viewer-modal {
    max-width: 1100px;
    width: 95%;
    height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Header */
.log-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.log-viewer-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.log-viewer-title i {
    color: #667eea;
    font-size: 1.5rem;
}

.log-viewer-count {
    font-size: 0.85rem;
    font-weight: 400;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-left: 0.5rem;
}

/* Stats Row */
.log-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.log-stat-card {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.log-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.log-stat-card.upload { border-left: 4px solid #3b82f6; }
.log-stat-card.upload .log-stat-icon { background: #dbeafe; color: #2563eb; }

.log-stat-card.delete { border-left: 4px solid #ef4444; }
.log-stat-card.delete .log-stat-icon { background: #fee2e2; color: #dc2626; }

.log-stat-card.rename { border-left: 4px solid #f59e0b; }
.log-stat-card.rename .log-stat-icon { background: #fef3c7; color: #d97706; }

.log-stat-card.create { border-left: 4px solid #10b981; }
.log-stat-card.create .log-stat-icon { background: #d1fae5; color: #059669; }

.log-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.log-stat-info {
    display: flex;
    flex-direction: column;
}

.log-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.log-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Filters */
.log-filters {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.log-filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.log-select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

.log-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.log-search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.log-search-box i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
}

.log-search-box input {
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 2.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.log-search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.log-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    color: #6b7280;
    opacity: 0;
    transition: opacity 0.2s;
}

.log-search-box input:not(:placeholder-shown) + .log-search-clear {
    opacity: 1;
}

/* Timeline Container */
.log-timeline-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #f8fafc;
}

.log-timeline {
    position: relative;
    padding-left: 32px;
}

.log-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1, #e2e8f0);
    border-radius: 1px;
}

/* Timeline Items */
.log-item {
    position: relative;
    margin-bottom: 1rem;
    animation: logItemFadeIn 0.3s ease;
}

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

.log-item-dot {
    position: absolute;
    left: -26px;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px currentColor;
    z-index: 1;
}

.log-item-dot.upload { color: #3b82f6; background: #dbeafe; }
.log-item-dot.delete { color: #ef4444; background: #fee2e2; }
.log-item-dot.rename { color: #f59e0b; background: #fef3c7; }
.log-item-dot.create { color: #10b981; background: #d1fae5; }
.log-item-dot.update { color: #8b5cf6; background: #ede9fe; }
.log-item-dot.clear_all { color: #ec4899; background: #fce7f3; }
.log-item-dot.default { color: #6b7280; background: #f3f4f6; }

.log-item-card {
    background: white;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.log-item-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.625rem;
}

.log-item-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.log-item-type.upload { background: #dbeafe; color: #1d4ed8; }
.log-item-type.delete { background: #fee2e2; color: #b91c1c; }
.log-item-type.rename { background: #fef3c7; color: #b45309; }
.log-item-type.create { background: #d1fae5; color: #047857; }
.log-item-type.update { background: #ede9fe; color: #6d28d9; }
.log-item-type.clear_all { background: #fce7f3; color: #be185d; }
.log-item-type.default { background: #f3f4f6; color: #374151; }

.log-item-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: #64748b;
}

.log-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.log-item-target {
    flex: 1;
    min-width: 0;
}

.log-item-target-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-item-target-type {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

.log-item-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
}

.log-item-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.log-item-actions {
    display: flex;
    gap: 0.5rem;
}

.log-item-btn {
    padding: 0.5rem;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-item-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Empty State */
.log-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #94a3b8;
    text-align: center;
}

.log-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.log-empty-state p {
    font-size: 1.1rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.log-empty-state span {
    font-size: 0.9rem;
}

/* Pagination */
.log-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.log-page-btn {
    padding: 0.5rem 0.875rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #374151;
    transition: all 0.2s;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-page-btn:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

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

.log-page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.log-page-info {
    padding: 0 0.75rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* Log Detail Card */
.log-detail-card {
    max-width: 600px;
}

.log-detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.log-detail-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.log-detail-meta-label {
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-detail-meta-value {
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
}

.log-detail-content label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.log-detail-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .log-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .log-filters {
        flex-wrap: wrap;
    }
    
    .log-search-box {
        max-width: none;
        width: 100%;
        order: -1;
    }
    
    .log-item-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}


@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


/* System Settings Styles */
.settings-nav-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.settings-nav-item:hover {
    background: #f5f7fa;
    color: #667eea;
}

.settings-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.settings-content {
    animation: fadeIn 0.3s ease;
}

.settings-content.hidden {
    display: none;
}

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

/* Database backup table styles */
.backup-row {
    transition: background 0.2s;
}

.backup-row:hover {
    background: #f8f9fa;
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.backup-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Responsive adjustments for system settings */
@media (max-width: 768px) {
    #systemSettingsModal .modal {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    #systemSettingsModal > div > div {
        flex-direction: column;
    }
    
    #systemSettingsModal > div > div > div:first-child {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-right: 0;
        padding-bottom: 1rem;
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
    }
    
    .settings-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    #settingsContent_database > div:first-of-type {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* System Settings Styles - Improved */
.settings-nav-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.375rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #4b5563;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.settings-nav-item:hover {
    background: #e5e7eb;
    color: #374151;
}

.settings-nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.settings-content {
    animation: fadeIn 0.3s ease;
}

.settings-content.hidden {
    display: none;
}

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

/* Form input focus states */
#systemSettingsModal .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stats card hover effect */
#systemSettingsModal [style*="background: linear-gradient"] {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#systemSettingsModal [style*="background: linear-gradient"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.15) !important;
}

/* Table row hover */
#dbBackupList tr:hover {
    background: #f9fafb;
}

/* Button hover effects */
#systemSettingsModal .btn {
    transition: all 0.2s ease;
}

#systemSettingsModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

/* Responsive adjustments for system settings */
@media (max-width: 1024px) {
    #systemSettingsModal .modal {
        max-width: 95% !important;
    }
    
    #settingsContent_website > div[style*="grid-template-columns: repeat(2"],
    #settingsContent_database > div[style*="grid-template-columns: repeat(2"] {
        grid-template-columns: 1fr !important;
    }
    
    #settingsContent_database > div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #systemSettingsModal .modal {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }
    
    #systemSettingsModal > div > div {
        flex-direction: column;
    }
    
    #systemSettingsModal > div > div > div:first-child {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem !important;
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
    }
    
    .settings-nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    
    #settingsContent_database > div[style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }
}

/* Custom scrollbar for content area */
#systemSettingsModal [style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
}

#systemSettingsModal [style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#systemSettingsModal [style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#systemSettingsModal [style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}


/* ===== API Endpoint Management Styles ===== */
.endpoint-category {
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.endpoint-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.endpoint-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.endpoint-category-title h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.endpoint-category-desc {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.endpoint-category-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.endpoint-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.endpoint-item:last-child {
    border-bottom: none;
}

.endpoint-item:hover {
    background: #f8f9fa;
}

.endpoint-item.disabled {
    background: #fafafa;
}

.endpoint-item.disabled .endpoint-info {
    opacity: 0.6;
}

.endpoint-info {
    flex: 1;
    min-width: 0;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.endpoint-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    min-width: 45px;
}

.endpoint-method.get {
    background: #e3f2fd;
    color: #1976d2;
}

.endpoint-method.post {
    background: #e8f5e9;
    color: #388e3c;
}

.endpoint-method.put {
    background: #fff3e0;
    color: #f57c00;
}

.endpoint-method.delete {
    background: #ffebee;
    color: #d32f2f;
}

.endpoint-method.head {
    background: #f3e5f5;
    color: #7b1fa2;
}

.endpoint-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.endpoint-path {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.8rem;
    color: #666;
    background: #f5f5f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.endpoint-desc {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.25rem;
}

.endpoint-switch-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.endpoint-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.endpoint-status.enabled {
    background: #e8f5e9;
    color: #4caf50;
}

.endpoint-status.disabled {
    background: #ffebee;
    color: #f44336;
}

/* Stats cards */
.endpoint-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 0;
}

.endpoint-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.endpoint-stat-icon.total {
    background: #e3f2fd;
    color: #1976d2;
}

.endpoint-stat-icon.enabled {
    background: #e8f5e9;
    color: #4caf50;
}

.endpoint-stat-icon.disabled {
    background: #ffebee;
    color: #f44336;
}

.endpoint-stat-content {
    display: flex;
    flex-direction: column;
}

.endpoint-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.endpoint-stat-label {
    font-size: 0.75rem;
    color: #888;
}

/* Toggle switch animation */
.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: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

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

input:checked + .slider {
    background-color: #667eea;
}

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

input:disabled + .slider {
    background-color: #e0e0e0;
    cursor: not-allowed;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.icon-spin {
    animation: spin 1s linear infinite;
}
