:root {
    --edoc-primary: #0052cc;
    --edoc-primary-hover: #0043a6;
    --edoc-success: #36b37e;
    --edoc-warning: #ffab00;
    --edoc-danger: #ff5630;
    --edoc-text: #172b4d;
    --edoc-text-light: #6b778c;
    --edoc-bg: #f4f5f7;
    --edoc-border: #dfe1e6;
    --edoc-radius: 8px;
    --edoc-shadow: 0 4px 12px rgba(9, 30, 66, 0.08);
}

.edoc-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--edoc-text);
    background: #fff;
    border-radius: var(--edoc-radius);
    box-shadow: var(--edoc-shadow);
    padding: 24px;
    margin: 20px 0;
}

/* Header */
.edoc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--edoc-bg);
    padding-bottom: 16px;
    margin-bottom: 24px;
}

.edoc-header h1 {
    font-size: 24px;
    margin: 0;
    color: var(--edoc-text);
}

.edoc-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.edoc-avatar img {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}

/* Navigation Tabs */
.edoc-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--edoc-border);
    padding-bottom: -1px;
}

.edoc-tab {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--edoc-text-light);
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    margin-bottom: -1px;
}

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

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

/* Dashboard Stats */
.edoc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.edoc-stat-card {
    background: #fff;
    border: 1px solid var(--edoc-border);
    border-radius: var(--edoc-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.edoc-stat-info h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    color: var(--edoc-text-light);
}

.edoc-stat-info .edoc-stat-total {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.edoc-stat-info .edoc-stat-pending {
    font-size: 12px;
    color: var(--edoc-danger);
    margin-top: 4px;
}

.edoc-dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Toolbar & Filters */
.edoc-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 16px;
}

.edoc-toolbar h2 {
    margin: 0;
}

.edoc-filters {
    display: flex;
    gap: 12px;
}

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

.edoc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.edoc-table th, .edoc-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--edoc-border);
}

.edoc-table th {
    background: var(--edoc-bg);
    font-weight: 600;
    color: var(--edoc-text-light);
}

.edoc-table tbody tr:hover {
    background: #fafbfc;
}

/* Status Badges */
.edoc-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.edoc-status.pending { background: #ffebe6; color: var(--edoc-danger); }
.edoc-status.processing { background: #fff0b3; color: #172b4d; }
.edoc-status.done { background: #e3fcef; color: #064e3b; }

/* Buttons */
.edoc-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    background: var(--edoc-bg);
    color: var(--edoc-text);
    transition: background 0.2s;
    text-decoration: none;
}
.edoc-btn:hover { background: var(--edoc-border); }
.edoc-btn-primary { background: var(--edoc-primary); color: #fff; }
.edoc-btn-primary:hover { background: var(--edoc-primary-hover); }
.edoc-btn-danger { background: #ffebe6; color: var(--edoc-danger); }
.edoc-btn-danger:hover { background: #ffbdad; }

/* Forms */
.edoc-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.edoc-col-span-2 { grid-column: span 2; }

.edoc-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.edoc-req { color: var(--edoc-danger); }

.edoc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--edoc-border);
    border-radius: 4px;
    font-size: 14px;
}
.edoc-input:focus {
    border-color: var(--edoc-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,82,204,0.2);
}

/* Modal */
.edoc-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 30, 66, 0.54);
    overflow: auto;
}

.edoc-modal-content {
    background: #fff;
    margin: 5% auto;
    width: 90%;
    max-width: 700px;
    border-radius: var(--edoc-radius);
    box-shadow: var(--edoc-shadow);
    animation: edoc-slide-down 0.3s ease-out;
}

@keyframes edoc-slide-down {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.edoc-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--edoc-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edoc-modal-header h3 { margin: 0; }

.edoc-close {
    font-size: 24px;
    font-weight: bold;
    color: var(--edoc-text-light);
    cursor: pointer;
}

.edoc-close:hover { color: var(--edoc-danger); }

.edoc-modal-body { padding: 24px; }

.edoc-form-actions {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* File list */
.edoc-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--edoc-bg);
    border-radius: 4px;
    margin-top: 8px;
    font-size: 13px;
}

.edoc-file-remove {
    color: var(--edoc-danger);
    cursor: pointer;
    font-weight: bold;
}

/* Urgent status */
.edoc-urgent-ด่วน { color: var(--edoc-warning); font-weight: bold; }
.edoc-urgent-ด่วนมาก, .edoc-urgent-ด่วนที่สุด { color: var(--edoc-danger); font-weight: bold; }

/* Migration / Source list */
.edoc-migration-info {
    background: #fdfae5;
    border: 1px solid #fff0b3;
    padding: 16px;
    border-radius: var(--edoc-radius);
}
.edoc-migration-info h3 { margin-top: 0; font-size: 16px; color: #505f79; }
.edoc-migration-info ul { padding-left: 20px; margin-bottom: 0; }

/* Loading */
.edoc-loading {
    text-align: center;
    padding: 20px;
    color: var(--edoc-text-light);
    font-style: italic;
}
