/* 
 * CRMC Admin CSS - Gốm Sản Xuất Chu Đậu
 * Style chuẩn Edu-Khoahoc-Viet Pro Manager Interface
 */

/* Force Hide Admin Bar WordPress */
#wpadminbar {
    display: none !important;
}

html, body {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

:root {
    --crmc-primary: #0f172a;
    --crmc-secondary: #2563eb;
    --crmc-accent-gold: #d4af37;
    --crmc-success: #16a34a;
    --crmc-warning: #ea580c;
    --crmc-danger: #dc2626;
    --crmc-bg-light: #f8fafc;
    --crmc-border-color: #e2e8f0;
    --crmc-card-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.crmc-container {
    margin: 20px 20px 0 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header Banners: Modern Light Panel (Loại bỏ hoàn toàn màu tối trùng nền) */
.crmc-header {
    background: #ffffff;
    border: 1px solid var(--crmc-border-color);
    color: #0f172a;
    padding: 20px 24px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.crmc-header-title h1 {
    color: #0f172a !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    margin: 0 0 4px 0 !important;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crmc-header-title .subtitle {
    color: #475569 !important;
    margin: 0;
    font-size: 13px !important;
    font-weight: 500;
}

.crmc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.crmc-stat-card {
    background: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    box-shadow: var(--crmc-card-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid var(--crmc-secondary);
    transition: transform 0.2s ease;
}

.crmc-stat-card:hover {
    transform: translateY(-2px);
}

.crmc-stat-card.border-blue { border-left-color: #3b82f6; }
.crmc-stat-card.border-green { border-left-color: #22c55e; }
.crmc-stat-card.border-orange { border-left-color: #f97316; }
.crmc-stat-card.border-purple { border-left-color: #a855f7; }

.crmc-stat-card .stat-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #64748b;
}

.crmc-stat-card .stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
}

.crmc-stat-card .stat-label {
    font-size: 11.5px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.crmc-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .crmc-two-columns {
        grid-template-columns: 1fr;
    }
}

.crmc-box {
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--crmc-card-shadow);
    border: 1px solid var(--crmc-border-color);
    overflow: hidden;
    margin-bottom: 20px;
}

.crmc-box-header {
    background: #f8fafc;
    padding: 14px 18px;
    border-bottom: 1px solid var(--crmc-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crmc-box-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
}

.crmc-box-body {
    padding: 18px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.size-badge { background: #e0f2fe; color: #0369a1; }
.step-badge { background: #fef3c7; color: #b45309; }
.green-badge { background: #dcfce7; color: #15803d; }
.red-badge { background: #fee2e2; color: #b91c1c; }

.status-in_progress { background: #dbeafe; color: #1d4ed8; }
.status-completed { background: #dcfce7; color: #15803d; }

.gold-badge-kim { background: #fef08a; color: #854d0e; font-weight: 800; border: 1px solid #eab308; }
.gold-badge-thua { background: #fef9c3; color: #a16207; }
.gold-badge-chi { background: #f3f4f6; color: #4b5563; }

.style-gold-btn {
    background: linear-gradient(135deg, #d4af37 0%, #aa7c11 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3) !important;
}

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 13px;
    color: #334155;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13.5px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group.half {
    flex: 1;
}

/* Search Bar */
.crmc-search-bar {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
}

.crmc-search-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
}

/* Modals */
.crmc-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.crmc-modal-content {
    background: #fff;
    width: 90%;
    max-width: 540px;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.crmc-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #94a3b8;
}

.crmc-material-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.crmc-material-list li {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crmc-material-list li.material-low {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

/* Master Data Sub-Tabs Layout */
.crmc-master-subtabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 2px;
}

.master-subtab-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.02);
}

.master-subtab-btn:hover {
    background: #f8fafc;
    color: #2563eb;
}

.master-subtab-btn.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.subtab-count {
    background: rgba(0,0,0,0.08);
    color: inherit;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
}

.master-subtab-btn.active .subtab-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

.crmc-master-subtab-pane,
.crmc-qc-subtab-pane,
.crmc-supplier-subtab-pane,
.crmc-material-subtab-pane,
.crmc-kitting-subtab-pane,
.crmc-sync-subtab-pane,
.crmc-payroll-subtab-pane,
.master-subtab-pane {
    display: none !important;
}

.crmc-master-subtab-pane.active,
.crmc-qc-subtab-pane.active,
.crmc-supplier-subtab-pane.active,
.crmc-material-subtab-pane.active,
.crmc-kitting-subtab-pane.active,
.crmc-sync-subtab-pane.active,
.crmc-payroll-subtab-pane.active,
.master-subtab-pane.active {
    display: block !important;
    animation: fadeIn 0.25s ease-out;
}

table.align-middle td, table.align-middle th {
    vertical-align: middle !important;
}


@media print {
    .crmc-fe-sidebar, .crmc-fe-topbar, .button, .btn-crmc-modal {
        display: none !important;
    }
    .crmc-fe-main-content {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
}

.crmc-container h2,
.crmc-modal-content h2 {
    font-size: 20px !important;
}
.crmc-container h3,
.crmc-modal-content h3 {
    font-size: 18px !important;
}
