/* Reset and Base Styles */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --accent-color: #60a5fa;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--text-color);
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.auth-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 20px;
    margin: 0;
    color: white;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-color);
    color: white;
}

.sidebar-menu .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon.material-icons {
    font-size: 18px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-user {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 0;
    border-left: none;
}

.sidebar-footer .nav-user span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.sidebar-footer .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-footer .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Navbar (for auth pages) */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand h2 {
    font-size: 20px;
    color: var(--text-color);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.nav-user span {
    font-size: 14px;
    color: var(--text-muted);
}

/* Container */
body:not(.auth-page) {
    margin-left: 260px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--text-color);
}

.page-header p {
    color: var(--text-muted);
    margin-top: 8px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.card h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 16px;
    color: var(--text-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    text-align: center;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 40px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 12px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.material-icons {
    font-size: 40px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 32px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-content h3 {
    font-size: 24px;
    margin: 0 0 4px 0;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.2;
}

.stat-content p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.role-list {
    list-style: none;
}

.role-list li {
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.role-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* Forms */
.color-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

.color-text-input {
    flex: 1;
}

.color-preview {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px;
}

.color-preview h4 {
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.preview-box {
    display: inline-block;
    padding: 12px 24px;
    margin-right: 12px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table thead {
    background: var(--bg-color);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

.data-table code {
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.text-center {
    text-align: center;
}

/* Permission Matrix */
.permission-matrix {
    overflow-x: auto;
    margin-top: 16px;
}

.permission-matrix table {
    min-width: 600px;
}

.permission-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    margin: 0;
}

.close {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--text-color);
}

.modal form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Checkbox List */
.checkbox-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-item:hover {
    background: var(--bg-color);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-item span {
    font-size: 14px;
    color: var(--text-color);
}

/* Punishment badges */
.punishment-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.punishment-warning {
    background: #fef3c7;
    color: #92400e;
}

.punishment-kick {
    background: #fde68a;
    color: #78350f;
}

.punishment-ban {
    background: #fee2e2;
    color: #991b1b;
}

/* Form row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

/* Navigation Cards */
.nav-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    text-align: center;
}

.nav-card:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-card-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.nav-card-name {
    font-size: 14px;
    font-weight: 500;
}

/* Mini Punishment List */
.punishment-list-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.punishment-item-mini {
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.punishment-item-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.punishment-item-body-mini {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.punishment-item-body-mini strong {
    font-size: 14px;
}

.punishment-item-body-mini code {
    font-size: 12px;
}

.punishment-item-body-mini p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--text-color);
}

.punishment-item-body-mini small {
    font-size: 11px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.mobile-menu-toggle:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

.mobile-menu-toggle .material-icons {
    font-size: 24px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1000;
        height: 100vh;
        overflow-y: auto;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    body:not(.auth-page) {
        margin-left: 0;
    }
    
    .container {
        padding: 16px;
        width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-header h1 {
        font-size: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 20px;
        gap: 10px;
    }
    
    .stat-icon {
        width: 56px;
        height: 56px;
        font-size: 32px;
    }
    
    .stat-icon.material-icons {
        font-size: 32px;
    }
    
    .stat-content h3 {
        font-size: 22px;
    }
    
    .stat-content p {
        font-size: 13px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .nav-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .nav-card {
        padding: 16px 12px;
    }
    
    .nav-card-icon {
        font-size: 24px;
    }
    
    .nav-card-name {
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        gap: 10px;
    }
    
    .stat-card {
        padding: 16px;
        gap: 8px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
    
    .stat-icon.material-icons {
        font-size: 28px;
    }
    
    .stat-content h3 {
        font-size: 20px;
    }
    
    .stat-content p {
        font-size: 12px;
    }
    
    .nav-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Documents Styles */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.category-item:hover {
    background: var(--bg-color);
    border-color: var(--border-color);
}

.category-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.category-item .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.document-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: block;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s;
}

.document-item.unread {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.document-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.document-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.document-item-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.unread-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.document-item-meta {
    display: flex;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Document View Styles */
.document-view-container {
    max-width: 1400px;
}

.document-main {
    display: flex;
    flex-direction: column;
}

.document-header {
    margin-bottom: 30px;
}

.document-title {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.document-title-input {
    font-size: 42px;
    font-weight: 700;
    width: 100%;
    padding: 10px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.document-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

.document-content {
    min-width: 0;
}

.document-body {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
}

.document-body h1,
.document-body h2,
.document-body h3,
.document-body h4,
.document-body h5,
.document-body h6 {
    margin-top: 32px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.document-body h1 { font-size: 32px; }
.document-body h2 { font-size: 28px; }
.document-body h3 { font-size: 24px; }
.document-body h4 { font-size: 20px; }
.document-body h5 { font-size: 18px; }
.document-body h6 { font-size: 16px; }

.document-body p {
    margin-bottom: 16px;
}

.document-body ul,
.document-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.document-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.document-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.sidebar-card h3 {
    font-size: 18px;
    margin: 0 0 16px 0;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.info-item strong {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.info-item span {
    font-size: 14px;
    color: var(--text-color);
}

/* Table of Contents */
#table-of-contents {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.toc-item:hover {
    background: var(--bg-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* CKEditor Styles */
.ck-editor__editable {
    min-height: 400px;
}

/* Permission Editor Styles */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
}

.permission-card {
    display: block;
    cursor: pointer;
    position: relative;
}

.permission-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.permission-card-content {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.permission-card:hover .permission-card-content {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.permission-card input[type="checkbox"]:checked + .permission-card-content {
    background: rgba(59, 130, 246, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.permission-node {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
}

.permission-description {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.role-color-preview {
    border: 2px solid var(--border-color);
    cursor: pointer;
}

/* Role badge in navbar */
.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

/* Profile picture area */
.profile-picture {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-color);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    overflow: hidden;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-picture-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .document-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .document-sidebar {
        order: -1;
    }
    
    .document-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .document-view-container {
        padding: 16px;
    }
    
    .document-title {
        font-size: 28px;
        line-height: 1.3;
    }
    
    .document-title-input {
        font-size: 28px;
        padding: 12px;
    }
    
    .document-content-wrapper {
        gap: 20px;
    }
    
    .sidebar-card {
        padding: 16px;
    }
    
    .sidebar-card h3 {
        font-size: 16px;
    }
    
    .document-body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .document-body h1 { font-size: 28px; margin-top: 24px; }
    .document-body h2 { font-size: 24px; margin-top: 20px; }
    .document-body h3 { font-size: 20px; margin-top: 18px; }
    .document-body h4 { font-size: 18px; margin-top: 16px; }
    .document-body h5 { font-size: 16px; margin-top: 14px; }
    .document-body h6 { font-size: 15px; margin-top: 12px; }
    
    .ck-editor__editable {
        min-height: 300px;
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .document-view-container {
        padding: 12px;
    }
    
    .document-title {
        font-size: 24px;
    }
    
    .document-title-input {
        font-size: 24px;
        padding: 10px;
    }
    
    .sidebar-card {
        padding: 12px;
    }
    
    .document-body {
        font-size: 14px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

