:root {
    --mdm-primary: #1A9C4B;
    --mdm-primary-dark: #003128;
    --mdm-bg: #F5F7FA;
    --mdm-white: #FFFFFF;
    --mdm-border: #E5E7EB;
    --mdm-text: #1F2937;
    --mdm-text-light: #6B7280;
    --mdm-hover: #F9FAFB;
}

.mdm-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* Filters */
.mdm-filters {
    background: var(--mdm-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mdm-filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.mdm-search-wrap {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.mdm-search {
    width: 100%;
    padding: 11px 16px 11px 44px;
    border: 1px solid var(--mdm-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mdm-search:focus {
    outline: none;
    border-color: var(--mdm-primary);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.mdm-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mdm-text-light);
    pointer-events: none;
}

.mdm-filter-category,
.mdm-filter-sort {
    padding: 11px 40px 11px 16px;
    border: 1px solid var(--mdm-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--mdm-white);
    cursor: pointer;
    transition: border-color 0.2s;
    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 1L6 6L11 1' stroke='%236B7280' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.mdm-filter-category:hover,
.mdm-filter-sort:hover {
    border-color: var(--mdm-primary);
}

.mdm-btn {
    padding: 11px 14px;
    border: 1px solid var(--mdm-border);
    border-radius: 8px;
    background: var(--mdm-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--mdm-text);
}

.mdm-btn:hover {
    border-color: var(--mdm-primary);
    background: var(--mdm-hover);
}

/* Grid View */
.mdm-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 24px;
}

.mdm-section {
    background: var(--mdm-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mdm-section-header {
    background: var(--mdm-primary);
    color: var(--mdm-white);
    padding: 16px 20px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.mdm-section-toggle {
    transition: transform 0.3s;
    font-size: 20px;
    line-height: 1;
}

.mdm-section-header.collapsed .mdm-section-toggle {
    transform: rotate(-90deg);
}

.mdm-section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mdm-section-content.collapsed {
    max-height: 0;
}

.mdm-subsection-header {
    background: #F9FAFB;
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    color: var(--mdm-text);
    border-top: 1px solid var(--mdm-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.mdm-subsection-toggle {
    transition: transform 0.3s;
    font-size: 18px;
}

.mdm-subsection-header.collapsed .mdm-subsection-toggle {
    transform: rotate(-90deg);
}

.mdm-subsection-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mdm-subsection-content.collapsed {
    max-height: 0;
}

.mdm-doc-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--mdm-border);
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.mdm-doc-item:hover {
    background: var(--mdm-hover);
}

.mdm-doc-item:last-child {
    border-bottom: none;
}

.mdm-doc-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 10px;
    color: var(--mdm-white);
    text-transform: uppercase;
    flex-shrink: 0;
}

.mdm-doc-icon.pdf { background: linear-gradient(135deg, #E74C3C, #C0392B); }
.mdm-doc-icon.doc,
.mdm-doc-icon.docx { background: linear-gradient(135deg, #3498DB, #2980B9); }
.mdm-doc-icon.xls,
.mdm-doc-icon.xlsx { background: linear-gradient(135deg, #27AE60, #229954); }
.mdm-doc-icon.ppt,
.mdm-doc-icon.pptx { background: linear-gradient(135deg, #E67E22, #D35400); }
.mdm-doc-icon.csv { background: linear-gradient(135deg, #95A5A6, #7F8C8D); }
.mdm-doc-icon.zip,
.mdm-doc-icon.rar { background: linear-gradient(135deg, #9B59B6, #8E44AD); }
.mdm-doc-icon.txt { background: linear-gradient(135deg, #34495E, #2C3E50); }
.mdm-doc-icon.default { background: linear-gradient(135deg, #95A5A6, #7F8C8D); }

.mdm-doc-info {
    flex: 1;
    min-width: 0;
}

.mdm-doc-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--mdm-text);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdm-doc-meta {
    font-size: 12px;
    color: var(--mdm-text-light);
}

/* List View */
.mdm-table-container {
    background: var(--mdm-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mdm-table {
    width: 100%;
    border-collapse: collapse;
}

.mdm-table thead {
    background: #F9FAFB;
    border-bottom: 2px solid var(--mdm-border);
}

.mdm-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--mdm-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mdm-table tbody tr {
    border-bottom: 1px solid var(--mdm-border);
    transition: background 0.2s;
    cursor: pointer;
}

.mdm-table tbody tr:hover {
    background: var(--mdm-hover);
}

.mdm-table tbody tr:last-child {
    border-bottom: none;
}

.mdm-table td {
    padding: 16px 20px;
    font-size: 14px;
    color: var(--mdm-text);
}

.mdm-table-name {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mdm-table-category {
    color: var(--mdm-text-light);
    font-size: 13px;
}

/* Pagination */
.mdm-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--mdm-white);
    border-radius: 12px;
    margin-top: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.mdm-page-info {
    font-size: 14px;
    color: var(--mdm-text-light);
}

.mdm-page-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mdm-page-btn {
    padding: 8px 12px;
    border: 1px solid var(--mdm-border);
    border-radius: 6px;
    background: var(--mdm-white);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}

.mdm-page-btn:hover:not(:disabled) {
    border-color: var(--mdm-primary);
    background: var(--mdm-hover);
    color: var(--mdm-primary);
}

.mdm-page-btn.active {
    background: var(--mdm-primary);
    color: var(--mdm-white);
    border-color: var(--mdm-primary);
}

.mdm-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Loading & Empty States */
.mdm-loading {
    text-align: center;
    padding: 60px 20px;
}

.mdm-spinner {
    border: 3px solid var(--mdm-border);
    border-top: 3px solid var(--mdm-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.mdm-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--mdm-text-light);
}

.mdm-empty svg {
    margin-bottom: 16px;
    color: var(--mdm-text-light);
}

.mdm-empty p {
    margin: 0;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .mdm-container {
        padding: 16px;
    }
    
    .mdm-filter-group {
        flex-direction: column;
    }
    
    .mdm-search-wrap,
    .mdm-filter-category,
    .mdm-filter-sort {
        width: 100%;
    }
    
    .mdm-sections {
        grid-template-columns: 1fr;
    }
    
    .mdm-table {
        font-size: 13px;
    }
    
    .mdm-table th,
    .mdm-table td {
        padding: 12px 14px;
    }
    
    .mdm-pagination {
        flex-direction: column;
        gap: 16px;
    }
}