/* MasterType list + detail — orange / white theme */

:root {
    --mt-orange: #e85d04;
    --mt-orange-dark: #c2410c;
    --mt-orange-hover: #d45203;
    --mt-orange-soft: #fff4eb;
    --mt-orange-row: #fff7ed;
    --mt-page-bg: #fff8f3;
    --mt-white: #ffffff;
}

.mt-page {
    padding: 12px 28px 28px;
    min-height: calc(100vh - 80px);
    background: var(--mt-page-bg);
}

.mt-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.mt-page-title {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--mt-orange-dark);
    letter-spacing: -0.02em;
}

.mt-page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mt-back-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
    color: var(--mt-orange-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s ease;
}

.mt-back-btn:hover {
    background: var(--mt-orange);
    border-color: var(--mt-orange);
    color: #fff;
}

.mt-breadcrumb {
    margin-top: 4px;
    font-size: 13px;
    color: #6b7280;
}

.mt-breadcrumb a,
.mt-breadcrumb span.mt-crumb-link {
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
}

.mt-breadcrumb a:hover,
.mt-breadcrumb span.mt-crumb-link:hover {
    color: var(--mt-orange-dark);
}

.mt-breadcrumb .mt-crumb-sep {
    margin: 0 8px;
    color: #9ca3af;
}

.mt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
}

.mt-btn:hover {
    background: #f8fafc;
    border-color: #9ca3af;
    color: #111827;
}

.mt-btn-primary,
.mt-btn-save {
    background: var(--mt-orange);
    border-color: var(--mt-orange);
    color: #fff;
}

.mt-btn-primary:hover,
.mt-btn-save:hover {
    background: var(--mt-orange-hover);
    border-color: var(--mt-orange-hover);
    color: #fff;
}

.mt-btn-ghost {
    background: #fff;
    border-color: #d1d5db;
    color: #374151;
}

.mt-dropdown {
    position: relative;
    display: inline-block;
    z-index: 1201;
}

.mt-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: transparent;
}

.mt-dropdown-toggle {
    min-width: 110px;
}

.mt-dropdown-caret {
    font-size: 10px;
    margin-left: 2px;
    transition: transform .15s ease;
}

.mt-dropdown-caret.open {
    transform: rotate(180deg);
}

.mt-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
    padding: 6px;
    z-index: 1200;
}

.mt-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.mt-dropdown-item:hover {
    background: var(--mt-orange-soft);
    color: var(--mt-orange-dark);
}

.mt-dropdown-item i {
    width: 16px;
    text-align: center;
    color: #6b7280;
}

.mt-dropdown-item:hover i {
    color: var(--mt-orange-dark);
}

.mt-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 6px;
}

.mt-search-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.mt-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mt-search-input {
    flex: 1;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
}

.mt-search-input:focus {
    border-color: var(--mt-orange);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.16);
}

.mt-search-btn {
    height: 40px;
    padding: 0 22px;
    border: none;
    border-radius: 8px;
    background: var(--mt-orange);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.mt-search-btn:hover {
    background: var(--mt-orange-hover);
}

.mt-grid-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.mt-list-grid.k-grid,
.mt-detail-grid.k-grid {
    border: none;
}

.mt-list-grid .k-grid-header,
.mt-list-grid .k-grid-header .k-table-th,
.mt-list-grid .k-header,
.mt-detail-grid .k-grid-header,
.mt-detail-grid .k-grid-header .k-table-th,
.mt-detail-grid .k-header {
    background-color: var(--mt-orange) !important;
    color: #fff !important;
    font-weight: 600;
    border-color: var(--mt-orange-dark) !important;
}

.mt-list-grid .k-grid-header .k-link,
.mt-detail-grid .k-grid-header .k-link {
    color: #fff !important;
}

.mt-list-grid .k-grid-header .k-sort-icon,
.mt-detail-grid .k-grid-header .k-sort-icon {
    color: #fff !important;
}

.mt-list-grid .k-table-row:hover,
.mt-detail-grid .k-table-row:hover {
    background: var(--mt-orange-row) !important;
}

.mt-edit-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: var(--mt-orange-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mt-edit-btn:hover {
    background: var(--mt-orange);
    color: #fff;
    border-color: var(--mt-orange);
}

.mt-name-link {
    color: var(--mt-orange-dark);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.mt-name-link:hover {
    text-decoration: underline;
}

.mt-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2f6;
    color: #4b5563;
    font-size: 12px;
    font-weight: 600;
}

.mt-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
}

.mt-badge-on {
    background: #ecfdf3;
    color: #067647;
}

.mt-badge-on .mt-badge-dot {
    background: #17b26a;
}

.mt-detail-loader {
    position: absolute;
    inset: 0;
    z-index: 10;
}

.mt-detail-window .k-window-content {
    padding: 0 !important;
    background: var(--mt-page-bg);
    overflow: auto !important;
}

.mt-detail-wrap {
    background: var(--mt-page-bg);
    min-height: 100%;
}

.mt-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.mt-detail-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--mt-orange-dark);
}

.mt-detail-sub {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 13px;
}

.mt-tabs {
    display: flex;
    gap: 20px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.mt-tab {
    padding: 10px 0 12px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 3px solid transparent;
}

.mt-tab.active {
    color: var(--mt-orange);
    border-bottom-color: var(--mt-orange);
}

.mt-detail-body {
    padding: 16px 20px 24px;
}

.mt-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    height: 100%;
}

.mt-card-head {
    padding: 14px 16px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--mt-orange-dark);
}

.mt-card-body {
    padding: 12px 16px 16px;
}

.mt-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 4px;
}

.mt-field {
    margin-bottom: 12px;
}

.mt-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 14px;
}

.mt-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    margin: 0;
}

.mt-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mt-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 26px;
    transition: .2s;
}

.mt-switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
    transition: .2s;
}

.mt-switch input:checked + .mt-switch-slider {
    background: var(--mt-orange);
}

.mt-switch input:checked + .mt-switch-slider:before {
    transform: translateX(22px);
}

.mt-media {
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
    position: relative;
}

.mt-media img {
    max-height: 220px;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 8px auto 0;
    object-fit: contain;
}

.mt-media-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mt-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mt-icon-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.file-input-zone {
    display: block;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: black;
    cursor: pointer;
    position: relative;
    width: 32px;
    height: 32px;
    background-image: url('/assets/img/upload_logo.png');
    background-repeat: no-repeat;
    background-size: contain;
}

.k-input-spinner {
    display: none;
}

.mt-filter-mini {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.mt-perm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: var(--mt-orange);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

.mt-perm-head.open {
    border-radius: 12px 12px 0 0;
}

.mt-perm-body {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.mt-perm-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
}

.mt-perm-list li {
    padding: 6px 0;
}

.mt-perm-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mt-perm-link {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.mt-perm-link:hover {
    color: #fff7ed;
}

.mt-perm-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #ffedd5;
}

.mt-shift-radio .btn-outline-success {
    border-color: #fdba74;
    color: #c2410c;
}

.mt-shift-radio .btn-check:checked + .btn-outline-success {
    background: var(--mt-orange);
    border-color: var(--mt-orange);
    color: #fff;
}

.mt-orange-head,
.card-header.mt-orange-head {
    background: var(--mt-orange) !important;
    color: #fff !important;
    border: none;
}

.custom-ellipsis,
.k-grid td.custom-ellipsis,
.k-grid tr.custom-ellipsis .k-table-td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 991px) {
    .mt-page {
        padding: 10px 12px 20px;
    }

    .mt-page-header,
    .mt-detail-header {
        flex-direction: column;
        align-items: stretch;
    }
}
