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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F8F9FA;
    color: #1A1A1A;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-container {
    margin-left: 260px;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.back-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.back-btn:hover {
    background: #F3F4F6;
}

.back-btn .material-icons {
    color: #6B7280;
    font-size: 20px;
}

.header-title h1 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.header-subtitle {
    font-size: 13px;
    color: #6B7280;
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #F3F4F6;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
}

.user-info .material-icons {
    font-size: 18px;
    color: #6B7280;
}

/* Main */
.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.app-sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    padding: 24px 32px;
}

/* Toolbar */
.toolbar {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toolbar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    transition: all 0.15s;
    background: #F9FAFB;
}

.search-box input:focus {
    outline: none;
    border-color: #3B82F6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box .material-icons {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: #9CA3AF;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    padding: 11px 40px 11px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: #F9FAFB;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.filter-select:hover {
    border-color: #9CA3AF;
    background-color: white;
}

.filter-select:focus {
    outline: none;
    border-color: #3B82F6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn {
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn .material-icons {
    font-size: 18px;
}

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

.btn-primary:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-outline {
    background: white;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.btn-outline:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
}

.btn-icon-only {
    padding: 11px;
    min-width: 42px;
    justify-content: center;
}

.btn-icon-only .material-icons {
    margin: 0;
}

/* Table Container */
.table-container {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table-wrapper {
    overflow-x: auto;
}

/* Table - Modern Design */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1100px;
}

.data-table thead {
    background: linear-gradient(to bottom, #F9FAFB, #F3F4F6);
}

.data-table thead tr th {
    padding: 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #E5E7EB;
    white-space: nowrap;
}

.data-table thead tr th:first-child {
    padding-left: 24px;
    border-top-left-radius: 12px;
}

.data-table thead tr th:last-child {
    border-top-right-radius: 12px;
}

.data-table tbody tr {
    transition: all 0.15s;
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: #F9FAFB;
}

.data-table tbody tr td {
    padding: 16px;
    font-size: 13px;
    color: #1F2937;
    border-bottom: 1px solid #F3F4F6;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr td:first-child {
    padding-left: 24px;
}

.cell-actions {
    width: 60px;
    text-align: center;
    padding: 12px !important;
}

.actions-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E7EB;
    background: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.actions-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.actions-btn:active {
    background: #F3F4F6;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Custom 3 dots icon */
.dots-icon {
    display: flex;
    flex-direction: column;
    gap: 3.5px;
    align-items: center;
    justify-content: center;
}

.dots-icon span {
    width: 4.5px;
    height: 4.5px;
    background: #9CA3AF;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.actions-btn:hover .dots-icon span {
    background: #6B7280;
}

.actions-btn:hover .dots-icon span:nth-child(1) {
    transform: translateY(-0.5px);
}

.actions-btn:hover .dots-icon span:nth-child(3) {
    transform: translateY(0.5px);
}

.cell-stt {
    width: 60px;
    text-align: center;
    font-weight: 500;
    color: #6B7280;
}

.cell-code {
    width: 110px;
    font-weight: 600;
    color: #111827;
}

.cell-name {
    min-width: 280px;
    max-width: 400px;
    font-weight: 500;
}

.name-primary {
    color: #111827;
    font-weight: 500;
    margin-bottom: 4px;
}

.name-meta {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
}

.cell-category {
    width: 130px;
    color: #4B5563;
}

.cell-level {
    width: 150px;
    color: #4B5563;
}

.cell-status {
    width: 120px;
}

.cell-creator {
    width: 140px;
    color: #4B5563;
}

.cell-permission {
    width: 140px;
    color: #4B5563;
}

/* Status Badges - Modern Clean Style */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Soạn thảo - Purple */
.status-editing {
    background: #F5F3FF;
    color: #7C3AED;
}

/* Hiệu lực - Blue */
.status-active {
    background: #EFF6FF;
    color: #2563EB;
}

/* Chờ phê duyệt - Yellow */
.status-wait {
    background: #FFFBEB;
    color: #D97706;
}

/* Đang trình VOffice - Orange */
.status-sent {
    background: #FFF7ED;
    color: #EA580C;
}

/* Đã phê duyệt - Green */
.status-approved {
    background: #F0FDF4;
    color: #16A34A;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #FAFBFC;
}

.pagination-info {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #D1D5DB;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0 8px;
}

.page-btn:hover:not(:disabled) {
    border-color: #3B82F6;
    color: #3B82F6;
    background: #EFF6FF;
}

.page-btn.active {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    display: none;
    padding: 4px;
}

.context-menu.active {
    display: block;
}

.context-menu-item {
    padding: 10px 16px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 6px;
}

.context-menu-item:hover,
.context-menu-item.active {
    background: #F3F4F6;
    color: #111827;
}

.context-menu-item .material-icons {
    font-size: 18px;
    color: #6B7280;
}

.context-menu-item:hover .material-icons,
.context-menu-item.active .material-icons {
    color: #374151;
}

.context-menu-item.danger {
    color: #DC2626;
}

.context-menu-item.danger .material-icons {
    color: #DC2626;
}

.context-menu-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 4px 0;
}

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

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

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.modal-close:hover {
    background: #E5E7EB;
}

.modal-close .material-icons {
    color: #6B7280;
    font-size: 20px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

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

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-input {
    padding: 11px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: all 0.15s;
}

.form-select {
    padding: 11px 40px 11px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: all 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23374151' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #FAFBFC;
}
