/* DataCore — hệ thiết kế dùng chung (tokens, layout, sidebar, header, nút, input, badge, modal, toast, bảng). */
:root {
    --accent: #2563eb; /* blue-600 */
    --accent-soft: #eff6ff; /* blue-50  */
    --accent-shadow: rgba(37, 99, 235, 0.24);
    --accent-ring: rgba(37, 99, 235, 0.16);
    --bg: #f9fafb; /* gray-50  */
    --ink: #111827; /* gray-900 */
    --muted: #6b7280; /* gray-500 */
    --muted-2: #9ca3af; /* gray-400 */
    --line: #f3f4f6; /* gray-100 */
    --line-2: #e5e7eb; /* gray-200 */
    --card-shadow:
        0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html,
body {
    height: 100%;
}
body {
    font-family:
        'Be Vietnam Pro',
        system-ui,
        -apple-system,
        sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
input,
button,
select,
textarea {
    font-family: inherit;
}
table {
    border-collapse: collapse;
    width: 100%;
}
h1,
h2,
h3 {
    letter-spacing: -0.01em;
}

::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}
::-webkit-scrollbar-thumb {
    background: #d5dae1;
    border-radius: 8px;
    border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: #bcc3cd;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* icon inline svg */
.dc-ic {
    display: inline-flex;
}
.dc-ic svg {
    width: 19px;
    height: 19px;
}

/* ---------- layout ---------- */
.dc-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.dc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.dc-content {
    flex: 1;
    overflow: auto;
    padding: 16px 20px;
}
.dc-loading {
    padding: 60px;
    text-align: center;
    color: var(--muted-2);
    font-size: 14px;
}

/* ---------- sidebar ---------- */
.dc-sidebar {
    width: 220px;
    flex: none;
    background: #fff;
    border-right: 1px solid var(--line-2);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    transition: width 0.18s ease;
    overflow: hidden;
}
.dc-sidebar.collapsed {
    width: 68px;
    padding: 18px 10px;
}
.dc-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 6px 6px 18px;
}
.dc-sidebar.collapsed .dc-brand {
    justify-content: center;
    padding: 6px 0 18px;
}
.dc-logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex: none;
}
.dc-logo svg {
    width: 19px;
    height: 19px;
}
.dc-brand-text {
    min-width: 0;
    white-space: nowrap;
}
.dc-sidebar.collapsed .dc-brand-text {
    display: none;
}
.dc-brand-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.05;
}
.dc-brand-tag {
    font-size: 11.5px;
    color: var(--muted);
    margin-top: 2px;
}
.dc-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}
.dc-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
    user-select: none;
    color: #374151;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
}
.dc-sidebar.collapsed .dc-nav-item {
    justify-content: center;
    padding: 11px;
}
.dc-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
}
.dc-sidebar.collapsed .dc-nav-label {
    display: none;
}
.dc-nav-item .dc-ic svg {
    stroke: #6b7280;
    transition: stroke 0.15s;
}
.dc-nav-item:hover {
    background: #f3f4f6;
    color: var(--ink);
}
.dc-nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.dc-nav-item.active .dc-ic svg {
    stroke: var(--accent);
}
.dc-nav-item.active:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

/* nút thu gọn / mở rộng sidebar */
.dc-sidebar-toggle {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid var(--line-2);
    background: #fff;
    color: var(--muted);
    cursor: pointer;
    flex: none;
}
.dc-sidebar-toggle svg {
    width: 17px;
    height: 17px;
}
.dc-sidebar-toggle:hover {
    background: var(--bg);
    color: var(--ink);
}
.dc-sidebar.collapsed .dc-sidebar-toggle {
    align-self: center;
}

/* ---------- avatar ---------- */
.dc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex: none;
}

/* ---------- header ---------- */
.dc-header {
    height: 68px;
    flex: none;
    background: #fff;
    border-bottom: 1px solid var(--line-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 20;
}
.dc-page-title {
    font-size: 16px;
    font-weight: 700;
}
.dc-page-sub {
    font-size: 12.5px;
    color: var(--muted-2);
    margin-top: 1px;
}
.dc-userbtn-wrap {
    position: relative;
}
.dc-userbtn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 11px;
    transition: background 0.15s;
}
.dc-userbtn:hover {
    background: var(--bg);
}
.dc-userbtn-name {
    font-size: 14px;
    font-weight: 600;
}
.dc-chev svg {
    width: 16px;
    height: 16px;
    stroke: var(--muted-2);
}
.dc-menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
}
.dc-usermenu {
    position: absolute;
    right: 0;
    top: 54px;
    width: 222px;
    background: #fff;
    border: 1px solid var(--line-2);
    border-radius: 13px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
    z-index: 40;
    overflow: hidden;
    animation: pop 0.18s ease;
}
.dc-usermenu-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg);
}
.dc-usermenu-name {
    font-size: 13.5px;
    font-weight: 600;
}
.dc-usermenu-mail {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.dc-usermenu-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 11px 16px;
    font-size: 13.5px;
    color: #334155;
}
.dc-usermenu-item .dc-ic svg {
    width: 16px;
    height: 16px;
    stroke: var(--muted);
}
.dc-usermenu-item:hover {
    background: #f6f8fa;
}
.dc-usermenu-item.danger {
    color: #dc2626;
    border-top: 1px solid var(--bg);
}
.dc-usermenu-item.danger .dc-ic svg {
    stroke: currentColor;
}
.dc-usermenu-item.danger:hover {
    background: #fef2f2;
}

/* ---------- buttons ---------- */
.dc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
}
.dc-btn .dc-ic svg,
.dc-btn > svg {
    width: 17px;
    height: 17px;
    flex: none;
}
.dc-btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    box-shadow: 0 6px 16px var(--accent-shadow);
}
.dc-btn-primary:hover {
    filter: brightness(1.06);
}
.dc-btn-ghost {
    background: #fff;
    color: #475569;
    border: 1px solid #dce0e6;
}
.dc-btn-ghost:hover {
    background: #f6f8fa;
}
.dc-btn-green {
    background: #fff;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.dc-btn-green:hover {
    background: #f0fdf4;
}
.dc-icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 5px;
    border-radius: 7px;
    display: inline-flex;
    transition:
        background 0.12s,
        color 0.12s;
}
.dc-icon-btn svg {
    width: 16px;
    height: 16px;
}
.dc-icon-btn.danger:hover {
    color: #dc2626;
    background: #fef2f2;
}
.dc-icon-btn.edit {
    color: var(--muted-2);
}
.dc-icon-btn.edit:hover {
    color: var(--accent);
    background: #eff6ff;
}
.dc-icon-btn.danger {
    color: var(--muted-2);
}

/* ---------- inputs ---------- */
.dc-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin: 16px 0 7px;
}
.dc-label:first-child,
form > .dc-label:first-of-type {
    margin-top: 0;
}
.dc-input,
.dc-select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #dce0e6;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: var(--ink);
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.dc-select {
    cursor: pointer;
}
.dc-input:focus,
.dc-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.form-row {
    display: flex;
    gap: 14px;
}
.form-col {
    flex: 1;
}

/* ---------- card ---------- */
.dc-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--card-shadow);
}

/* ---------- badge ---------- */
.dc-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.dc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: none;
    background: currentColor;
}
.badge-lienhe {
    background: #d1fae5;
    color: #047857;
}
.badge-thanhcong {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-cho {
    background: #fef3c7;
    color: #b45309;
}
.badge-chua {
    background: #f1f5f9;
    color: #475569;
}
.badge-khong {
    background: #fee2e2;
    color: #dc2626;
}
.badge-admin {
    background: #eef2ff;
    color: #4338ca;
}
.badge-nv {
    background: #f1f5f9;
    color: #475569;
}
.badge-active {
    background: #ecfdf5;
    color: #047857;
}
.badge-disabled {
    background: #f1f5f9;
    color: #64748b;
}
.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}
.badge-green {
    background: #d1fae5;
    color: #047857;
}
.badge-red {
    background: #fee2e2;
    color: #dc2626;
}

/* ---------- alert ---------- */
.dc-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 9px;
    margin-top: 14px;
}
.dc-alert svg {
    width: 15px;
    height: 15px;
    flex: none;
}
.dc-alert-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}
.dc-alert-warn {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    margin: 0 0 18px;
    font-size: 13.5px;
    padding: 12px 16px;
    border-radius: 11px;
}
.dc-alert-warn svg {
    width: 17px;
    height: 17px;
}

/* ---------- modal ---------- */
.dc-modal-scrim {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 60;
    animation: fadeIn 0.2s;
}
.dc-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 466px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    animation: pop 0.25s ease;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.dc-modal-wide {
    max-width: 720px;
}
.dc-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}
.dc-modal-head h3 {
    font-size: 17px;
    font-weight: 700;
}
.dc-modal-head .dc-icon-btn {
    color: var(--muted-2);
}
.dc-modal-head .dc-icon-btn svg {
    width: 18px;
    height: 18px;
}
.dc-modal-head .dc-icon-btn:hover {
    background: var(--bg);
    color: var(--ink);
}
.dc-modal-body {
    padding: 22px 24px;
    overflow: auto;
}
.dc-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}

/* ---------- toast ---------- */
.dc-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink);
    color: #fff;
    padding: 13px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
    z-index: 80;
    animation: toastIn 0.25s ease;
    font-size: 14px;
    font-weight: 500;
}
.dc-toast-ic {
    color: #34d399;
}
.dc-toast-ic svg {
    width: 18px;
    height: 18px;
}

/* ---------- table base ---------- */
.dc-table-wrap {
    overflow-x: auto;
}
.dc-table thead th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 12px 16px;
    background: #fafbfc;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.dc-table tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid #f1f3f6;
    white-space: nowrap;
    color: #475569;
}
.dc-table tbody tr {
    transition: background 0.12s;
}
.dc-table tbody tr:hover {
    background: #fafbfc;
}
.dc-table .td-strong {
    font-weight: 600;
    color: var(--ink);
}
.dc-table .td-muted {
    color: var(--muted-2);
    font-size: 13px;
}
.dc-table .th-act,
.dc-table .td-act {
    width: 54px;
    text-align: center;
}
.dc-table .th-right {
    text-align: right;
}
.dc-table .td-act-right {
    text-align: right;
    white-space: nowrap;
}

/* ---------- tiêu đề trang & empty ---------- */
.page-h2 {
    font-size: 20px;
    font-weight: 700;
}
.page-desc {
    font-size: 13.5px;
    color: var(--muted);
    margin-top: 3px;
}
.data-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.dc-empty {
    padding: 48px;
    text-align: center;
    color: var(--muted-2);
    font-size: 14px;
}
.dc-empty-sm {
    color: var(--muted-2);
    font-size: 13px;
    margin: auto;
}

/* ===== Toast bền (notify) — trượt sang phải khi bấm ===== */
.dc-notify {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #059669;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    max-width: 360px;
    cursor: pointer;
    transform: translateX(0);
    opacity: 1;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}
.dc-notify.leaving {
    transform: translateX(120%);
    opacity: 0;
}
.dc-notify-ic {
    color: #059669;
    flex: 0 0 auto;
}
.dc-notify-title {
    font-weight: 700;
}
.dc-notify-msg {
    color: #475569;
    font-size: 14px;
}
