/* Variables CSS */
:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1a1a1a;
    --light: #f8fafc;
    --gray: #94a3b8;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
.dark-mode {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --secondary: #94a3b8;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #22d3ee;
    --dark: #cccccc;
    --light: #2d2d2d;
    --gray: #64748b;
    --white: #1a1a1a;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.dark-mode body {
    background: #2d2d2d;
    color: #cccccc;
}

.dark-mode .navbar {
    background: #1a1a1a;
    border-bottom-color: #1a1a1a;
}

.dark-mode .nav-link {
    color: #94a3b8;
}

.dark-mode .nav-link:hover {
    color: #cccccc;
    background: #333333;
}

.dark-mode .nav-link.active {
    color: #60a5fa;
    background: #333333;
}

.dark-mode .card {
    background: #1a1a1a;
    border-color: #333333;
}

.dark-mode .card-header {
    background: #333333;
    border-bottom-color: #4a4a4a;
}

.dark-mode .card-footer {
    background: #333333;
    border-top-color: #4a4a4a;
}

.dark-mode .form-control {
    background: #333333;
    border-color: #4a4a4a;
    color: #cccccc;
}

.dark-mode .form-control:focus {
    border-color: var(--primary);
    background: #333333;
}

.dark-mode .table {
    color: #cccccc;
}

.dark-mode .table th {
    background: #333333;
    color: #cccccc;
}

.dark-mode .table td {
    border-bottom-color: #333333;
}

.dark-mode .table tbody tr:hover {
    background: #333333;
}

.dark-mode .breadcrumb {
    color: #94a3b8;
}

.dark-mode .breadcrumb a {
    color: #cccccc;
}

.dark-mode .breadcrumb a:hover {
    color: #60a5fa;
}

.dark-mode .page-header h1 {
    color: #cccccc;
}

.dark-mode .empty-state {
    color: #64748b;
}

.dark-mode .tree-view a {
    color: #cccccc;
}

.dark-mode .tree-view a:hover {
    color: #60a5fa;
}

.dark-mode .tree-view a.active {
    color: #60a5fa;
    background: #333333;
}

.dark-mode .modal-header {
    background: #333333;
    border-bottom-color: #4a4a4a;
}

.dark-mode .modal-body {
    background: #1a1a1a;
}

.dark-mode .modal-footer {
    background: #333333;
    border-top-color: #4a4a4a;
}

.dark-mode .btn-secondary {
    background: #4a4a4a;
    color: #000000;
}

.dark-mode .btn-secondary:hover {
    background: #64748b;
}

.dark-mode .btn-info {
    background: #06b6d4;
    color: #000000;
}

.dark-mode .btn-info:hover {
    background: #0891b2;
}

.dark-mode .btn-success {
    background: #10b981;
    color: #000000;
}

.dark-mode .btn-success:hover {
    background: #059669;
}

.dark-mode .btn-primary {
    color: #000000;
}

.dark-mode .btn-danger {
    color: #000000;
}

.dark-mode .btn-warning {
    color: #000000;
}

.dark-mode .text-primary {
    color: #60a5fa;
}

.dark-mode .text-secondary {
    color: #94a3b8;
}

.dark-mode .text-success {
    color: #34d399;
}

.dark-mode .topico-header {
    background: #1a1a1a !important;
    border-color: #333333 !important;
}

.dark-mode .hijo-item {
    background: #333333 !important;
    border-color: #4a4a4a !important;
}

.dark-mode .departamento-header {
    background: #333333 !important;
    border-color: #4a4a4a !important;
}

.dark-mode .departamento-header h4 {
    color: #cccccc !important;
}

.dark-mode .alert {
    background: #333333;
    border-color: #4a4a4a;
}

.dark-mode .content-body {
    color: #cccccc;
}

.dark-mode .content-body pre {
    background: #1a1a1a;
    border-color: #404040;
}

.dark-mode .content-body pre code {
    color: #34d399;
}

.dark-mode .tab {
    background: #333333;
    color: #94a3b8;
    border-color: #4a4a4a;
}

.dark-mode .tab.active {
    background: #60a5fa;
    color: #cccccc;
}

.dark-mode .tab-content {
    background: #1a1a1a;
    border-color: #4a4a4a;
}

.dark-mode .chatbot-message {
    background: #333333;
}

.dark-mode .chatbot-message.assistant {
    background: #1a1a1a;
    border-color: #333333;
}

.dark-mode .user-badge {
    background: #333333;
    color: #94a3b8;
}

.dark-mode .badge-secondary {
    background: #333333;
    color: #94a3b8;
}

.dark-mode .note-editable {
    background: #333333 !important;
    color: #cccccc !important;
}

.dark-mode .note-toolbar {
    background: #1a1a1a;
    border-color: #333333;
}

.dark-mode .note-btn {
    background: #333333;
    color: #cccccc;
    border-color: #4a4a4a;
}

.dark-mode .dropdown-menu {
    background: #333333;
    border-color: #4a4a4a;
}

.dark-mode .dropdown-item {
    color: #cccccc;
}

.dark-mode .dropdown-item:hover {
    background: #4a4a4a;
    color: #cccccc;
}

/* Dark mode links */
.dark-mode a {
    color: #cccccc;
}

.dark-mode a:hover {
    color: #60a5fa;
}

/* Dark mode topicos links */
.dark-mode .topico-header a,
.dark-mode .hijo-item a,
.dark-mode .topico-item a {
    color: #cccccc;
}

.dark-mode .topico-header a:hover,
.dark-mode .hijo-item a:hover,
.dark-mode .topico-item a:hover {
    color: #60a5fa;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
}

/* Auth pages */
.auth-body {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-box {
    background: #000000;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid #333333;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.auth-logo-placeholder {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--white);
    font-size: 32px;
}

.auth-header h1 {
    font-size: 24px;
    color: #ffffff;
    margin-bottom: 5px;
}

.auth-header p {
    color: #a0a0a0;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form label {
    color: #cccccc;
}

.auth-form .form-control {
    background: #333333;
    border-color: #4a4a4a;
    color: #ffffff;
}

.auth-form .form-control::placeholder {
    color: #888888;
}

.auth-form .btn-toggle-password {
    background: #333333;
    border-color: #4a4a4a;
    color: #cccccc;
}

.auth-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333333;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.auth-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* Form elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    font-size: 15px;
    transition: var(--transition);
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--gray);
}

.input-group {
    display: flex;
    position: relative;
}

.input-group .form-control {
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-toggle-password {
    background: var(--white);
    border: 2px solid #e2e8f0;
    border-left: none;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 0 15px;
    cursor: pointer;
    color: var(--secondary);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: #000000;
}

.btn-primary {
    background: var(--primary);
    color: #000000;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: #000000;
}

.btn-secondary:hover {
    background: #4a4a4a;
}

.btn-success {
    background: var(--success);
    color: #000000;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: #000000;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: #000000;
}

.btn-info {
    background: var(--info);
    color: #000000;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: #000000;
}

/* Navbar */
.navbar {
    background: #000000;
    border-bottom: 1px solid #000000;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-brand img {
    width: 100px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius);
    color: #a0a0a0;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
}

.nav-link:hover {
    background: #333333;
    color: #ffffff;
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
    color: #ffffff;
}

.user-badge {
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.btn-logout {
    color: #ef4444;
    text-decoration: none;
    font-size: 18px;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

.dark-mode .btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-dark-mode {
    background: transparent;
    border: none;
    color: #a0a0a0;
    font-size: 18px;
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-dark-mode:hover {
    background: #333333;
    color: #ffffff;
}

.dark-mode .btn-dark-mode {
    color: #fbbf24;
}

.dark-mode .btn-dark-mode:hover {
    background: #333333;
    color: #fbbf24;
}

/* Main content */
.main-content {
    margin-top: 40px;
    padding: 30px;
    min-height: calc(100vh - 40px);
}

    .main-content.no-nav {
        margin-top: 0;
    }

/* Terminal-style code blocks */
.code-block {
    position: relative;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    margin: 15px 0;
    overflow-x: auto;
}

.code-block code {
    display: block;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #00ff41;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre;
    background: transparent;
    padding: 0;
}

.code-block .copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    opacity: 0.8;
    z-index: 10;
}

.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

.code-block .copy-btn.copied {
    background: #10b981;
    color: #fff;
}

/* Legacy code tag styling */
.content-body pre,
.content-body code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.content-body pre {
    position: relative;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
    padding-top: 40px;
    margin: 15px 0;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.content-body pre .copy-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    border-bottom-left-radius: 8px;
    border-top-right-radius: 8px;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    opacity: 0.8;
    z-index: 10;
}

.content-body pre .copy-btn:hover {
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

.content-body pre .copy-btn.copied {
    background: #10b981;
    color: #fff;
}

.content-body pre code {
    color: #00ff41;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
}

/* Inline code */
.content-body code:not(pre code) {
    background: #f1f5f9;
    color: #00ff41;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 90%;
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6 {
    margin-bottom: 20px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue {
    background: #eff6ff;
    color: var(--primary);
}

.stat-icon.green {
    background: #ecfdf5;
    color: var(--success);
}

.stat-icon.orange {
    background: #fffbeb;
    color: var(--warning);
}

.stat-icon.red {
    background: #fef2f2;
    color: var(--danger);
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.stat-info p {
    color: var(--secondary);
    font-size: 14px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.table th {
    background: #f8fafc;
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.table tr:hover {
    background: #f8fafc;
}

.table .actions {
    display: flex;
    gap: 8px;
}

.btn-table {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #eff6ff;
    color: var(--primary);
}

.badge-success {
    background: #ecfdf5;
    color: var(--success);
}

.badge-danger {
    background: #fef2f2;
    color: var(--danger);
}

.badge-warning {
    background: #fffbeb;
    color: var(--warning);
}

.badge-secondary {
    background: #f1f5f9;
    color: var(--secondary);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #ecfeff;
    color: #155e75;
    border: 1px solid #a5f3fc;
}

.alert-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.alert-close:hover {
    opacity: 1;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Grid layouts */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .nav-menu {
        display: none;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 30px 20px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.mb-0 {
    margin-bottom: 0;
}

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

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 20px;
}

/* Form check */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-check label {
    margin-bottom: 0;
    cursor: pointer;
}

/* Image upload */
.image-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #e2e8f0;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.image-preview-placeholder {
    color: var(--gray);
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab:hover {
    color: var(--primary);
}

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

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Search box */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
}

/* Select2 style */
.select-empresas {
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
    padding: 10px;
}

.empresa-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
}

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

.empresa-perms {
    display: flex;
    gap: 15px;
}

.perm-check {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

/* Note editor */
.note-editor {
    border: 2px solid #e2e8f0;
    border-radius: var(--radius);
}

.note-editor .note-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

/* Chatbot */
.chatbot-container {
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
}

.chatbot-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: var(--radius);
    max-width: 80%;
}

.chat-message.user {
    background: var(--primary);
    color: var(--white);
    margin-left: auto;
}

.chat-message.bot {
    background: var(--white);
    border: 1px solid #e2e8f0;
}

.chat-message-header {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.8;
}

.chatbot-input {
    display: flex;
    gap: 10px;
}

.chatbot-input textarea {
    flex: 1;
    min-height: 60px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tree view */
.tree-view {
    list-style: none;
}

.tree-item {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.tree-item-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tree-children {
    margin-left: 30px;
    margin-top: 10px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--gray);
}

.breadcrumb-current {
    color: var(--secondary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
}

.page-item {
    padding: 8px 14px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--secondary);
    font-size: 14px;
    transition: var(--transition);
}

.page-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.page-item.active {
    background: var(--primary);
    color: var(--white);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--secondary);
    margin-bottom: 20px;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: var(--gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Batch delete */
.batch-delete-form {
    margin: 0;
}

.batch-delete-actions {
    padding: 16px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

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

.row-checkbox {
    accent-color: var(--primary);
}

.btn-batch-delete {
    opacity: 0.6;
    transition: var(--transition);
}

.btn-batch-delete:not(:disabled) {
    opacity: 1;
}

.btn-batch-delete:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

/* Dark mode batch delete */
.dark-mode .checkbox-col input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .actions {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
}

/* Site Footer */
.site-footer {
    background: var(--dark);
    color: var(--white);
    padding: 20px 40px;
    text-align: center;
    font-size: 13px;
    margin-top: auto;
}

.site-footer a {
    color: var(--primary);
}

.site-footer p {
    margin: 0;
}

.dark-mode .site-footer {
    background: #1e293b;
    border-top: 1px solid var(--border);
}
