
.ui-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border: 1px solid #f3f4f6;
    margin-bottom: 24px;
    overflow: hidden;
}

.ui-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
    flex-wrap: wrap;
}

.ui-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e1b4b;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.ui-card-title i { color: #7c3aed; font-size: 14px; }

.ui-card-body { padding: 0; }
.ui-card-body.padded { padding: 24px; }

.ui-table-wrap { overflow-x: auto; }

.ui-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.ui-table thead th {
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 10px 16px;
    border-bottom: 2px solid #f3f4f6;
    white-space: nowrap;
    text-align: left;
}
.ui-table tbody td {
    padding: 8px 16px;
    border-bottom: 1px solid #f9fafb;
    color: #374151;
    vertical-align: middle;
    white-space: nowrap;
}
.ui-table tbody tr:hover { background: #fafafa; }
.ui-table tbody tr:last-child td { border-bottom: none; }

.ui-table-wrap--bordered {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.ui-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.3;
}
.ui-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ui-badge--no-dot::before { display: none; }

.ui-badge--sm {
    padding: 2px 8px;
    font-size: 10px;
    gap: 4px;
}
.ui-badge--sm::before { width: 5px; height: 5px; }

.ui-badge--role-0 { background: #ede9fe; color: #6d28d9; }
.ui-badge--role-1 { background: #dbeafe; color: #1d4ed8; }
.ui-badge--role-2 { background: #dcfce7; color: #15803d; }
.ui-badge--role-3 { background: #fef3c7; color: #b45309; }
.ui-badge--role-4 { background: #fee2e2; color: #b91c1c; }
.ui-badge--role-5 { background: #e0f2fe; color: #0369a1; }
.ui-badge--role-6 { background: #fce7f3; color: #be185d; }
.ui-badge--role-7 { background: #ccfbf1; color: #0f766e; }
.ui-badge--role-8 { background: #ffedd5; color: #c2410c; }
.ui-badge--role-9 { background: #f1f5f9; color: #334155; }

.ui-badge--active   { background: #dcfce7; color: #16a34a; }
.ui-badge--inactive { background: #fee2e2; color: #dc2626; }
.ui-badge--info     { background: #dbeafe; color: #2563eb; }
.ui-badge--success  { background: #dcfce7; color: #16a34a; }
.ui-badge--warning  { background: #fef3c7; color: #d97706; }
.ui-badge--danger   { background: #fee2e2; color: #dc2626; }
.ui-badge--muted    { background: #f1f5f9; color: #64748b; }

.ui-form { max-width: 100%; }

.ui-section {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ui-section > * { margin-top: 0; margin-bottom: 0; }
.ui-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1.5px solid #ede9fe;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ui-section-title i { font-size: 13px; }
.ui-section-title--sm {
    font-size: 11px;
    margin-bottom: 0;
    padding-bottom: 6px;
}
.ui-section-title > .btn,
.ui-section-title > a { margin-left: auto; }
.ui-section-title > .checkbox-label,
.ui-section-title > .checkbox-label:hover,
.ui-section-title > .checkbox-label:has(input:checked) {
    margin-left: auto;
    flex: 0 0 auto;
    width: auto;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500 !important;   
    color: #374151;

    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
    height: auto;
}

.ui-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.ui-grid--1 { grid-template-columns: minmax(0, 1fr); }
.ui-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ui-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ui-grid__span-2 { grid-column: span 2; }
.ui-grid__span-3 { grid-column: span 3; }
.ui-grid__span-full { grid-column: 1 / -1; }

@media (max-width: 900px) {
    .ui-grid--3, .ui-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ui-profile-row {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.ui-profile-photo .form-upload-header { display: none; }

.ui-profile-photo .form-upload { width: 100%; }

.ui-profile-photo .form-upload-label span,
.ui-profile-photo .form-upload-label small { display: none; }

.ui-profile-photo .form-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.ui-profile-photo .form-upload-label i {
    font-size: 56px;
    margin: 0;
}

.ui-profile-photo {
    flex: 0 0 140px;
    width: 140px;
}

.ui-profile-fields {
    flex: 1 1 auto;
    min-width: 0;
}

.ui-profile-photo .form-upload {
    aspect-ratio: 1 / 1;
    min-height: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.ui-profile-photo .form-upload-preview-wrap.is-visible {
    position: absolute;
    inset: 0;
    margin: 0;
    display: block;
}

.ui-profile-photo .form-upload-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    border-radius: 10px;
}

.ui-profile-rest { margin-top: 16px; }

@media (max-width: 640px) {
    .ui-profile-row { flex-direction: column; }
    .ui-profile-photo { flex-basis: auto; width: 100%; }
    .ui-profile-photo .form-upload,
    .ui-profile-photo .form-upload-preview-wrap { aspect-ratio: auto; }
}
@media (max-width: 600px) {
    .ui-grid, .ui-grid--2, .ui-grid--3, .ui-grid--4 { grid-template-columns: 1fr; }
}

.ui-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    font-weight: 500;
    user-select: none;
    padding: 4px 0;
}
.ui-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.ui-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 16px;
}
.ui-breadcrumb__link {
    color: #7c3aed;
    font-weight: 600;
    text-decoration: none;
}
.ui-breadcrumb__link:hover { text-decoration: underline; }
.ui-breadcrumb__sep { font-size: 10px; }
.ui-breadcrumb__current { color: #374151; font-weight: 600; }

.ui-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #f3f4f6;
}

.ui-check--top { margin-top: 8px; }

.ui-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
    gap: 12px;
}

.ui-empty[hidden] { display: none; }

.ui-empty__icon {
    width: 72px;
    height: 72px;
    background: #f5f3ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.ui-empty__icon i {
    font-size: 28px;
    color: #c4b5fd;
}

.ui-empty__title {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin: 0;
}

.ui-empty__desc {
    font-size: 13.5px;
    color: #9ca3af;
    margin: 0 auto;
    max-width: 340px;
    text-align: center;
}

.ui-empty--sm { padding: 30px 24px; gap: 8px; }
.ui-empty--sm .ui-empty__icon { width: 52px; height: 52px; margin-bottom: 0; }
.ui-empty--sm .ui-empty__icon i { font-size: 20px; }
.ui-empty--sm .ui-empty__title { font-size: 14px; }
.ui-empty--sm .ui-empty__desc { font-size: 12.5px; }

.ui-empty > i { font-size: 36px; color: #e5e7eb; }
.ui-empty > p { font-size: 13.5px; color: #9ca3af; margin: 0; }

.off-days-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.off-days-grid .checkbox-label {
    display: flex;
    width: 100%;
}

.det-reason { margin: 0; }
.det-reason .help-block:empty { display: none; }
.ui-mt-8 { margin-top: 8px; }
.ui-mt-16 { margin-top: 16px; }

.cm-title-icon {
    color: #7c3aed;
    margin-right: 6px;
}

.ui-table tbody tr.is-disabled { background: #e4e6ea; }
.ui-table tbody tr.is-disabled td { opacity: .72; }
.ui-table tbody tr.is-disabled td:nth-child(2) { opacity: 1; }
.ui-table tbody tr.is-disabled .form-control:disabled { background-color: #dfe1e5; border-color: #c4c8cf; }
.ui-table tbody tr.is-disabled .select2-container--gramin.select2-container--disabled .select2-selection--single,
.ui-table tbody tr.is-disabled .select2-container--gramin.select2-container--disabled .select2-selection--multiple { background-color: #dfe1e5 !important; border-color: #c4c8cf !important; }

.ui-modal-lead { display:flex; align-items:center; gap:10px; margin-bottom:16px; padding:10px 14px; background:#f5f3ff; border:1px solid #ede9fe; border-radius:10px; color:#5b21b6; font-weight:600; }
.ui-modal-lead i { font-size:18px; color:#7c3aed; }

.ui-seg { display:inline-flex; border:1px solid #d9dee7; border-radius:8px; overflow:hidden; margin-bottom:16px; }
.ui-seg__btn { padding:6px 14px; font-size:13px; background:#fff; border:0; cursor:pointer; color:#556; }
.ui-seg__btn + .ui-seg__btn { border-left:1px solid #d9dee7; }
.ui-seg__btn.is-active { background:#7c3aed; color:#fff; }

.is-hidden { display: none; }
