/* ===== ASSET & HR TRANSFER SCREEN STYLES ===== */

/* --- Mini Stat Cards --- */
.aht-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.aht-mini-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: var(--dash-radius);
    padding: 1.1rem 1.25rem;
    transition: all 0.3s ease;
}

.aht-mini-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.aht-mini-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aht-mini-stat-icon svg { width: 22px; height: 22px; }

.aht-mini-stat-icon.primary   { background: var(--dash-primary-light); color: var(--dash-primary); }
.aht-mini-stat-icon.success   { background: var(--dash-success-light); color: var(--dash-success); }
.aht-mini-stat-icon.warning   { background: rgba(245,158,11,0.12); color: #f59e0b; }
.aht-mini-stat-icon.info      { background: var(--dash-cyan-light);    color: var(--dash-cyan); }

.aht-mini-stat-content { display: flex; flex-direction: column; }

.aht-mini-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dash-text-primary);
    line-height: 1.2;
}

.aht-mini-stat-label {
    font-size: 0.72rem;
    color: var(--dash-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* --- Tab Toolbar --- */
.aht-tabs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.aht-tabs {
    display: flex;
    background: var(--dash-surface-2, rgba(255,255,255,0.03));
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.aht-tab-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--dash-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aht-tab-btn svg { width: 16px; height: 16px; }

.aht-tab-btn.active {
    background: var(--dash-primary);
    color: #fff;
}

.aht-tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.05);
    color: var(--dash-text-primary);
}

/* --- Filter Toolbar --- */
.aht-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.aht-toolbar-left  { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.aht-toolbar-right { display: flex; align-items: center; gap: 0.75rem; }

.aht-search-wrapper { position: relative; }

.aht-search-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--dash-text-muted);
}

.aht-search-wrapper input {
    padding: 0.6rem 0.85rem 0.6rem 2.4rem;
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    background: var(--dash-surface);
    color: var(--dash-text-primary);
    font-size: 0.82rem;
    min-width: 280px;
    transition: all 0.3s ease;
}

.aht-search-wrapper input:focus {
    outline: none;
    border-color: var(--dash-primary);
    box-shadow: 0 0 0 3px var(--dash-primary-light);
}

.aht-filter-select {
    padding: 0.6rem 2rem 0.6rem 0.85rem;
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    background: var(--dash-surface);
    color: var(--dash-text-primary);
    font-size: 0.82rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
    transition: all 0.3s ease;
}

.aht-filter-select:focus {
    outline: none;
    border-color: var(--dash-primary);
    box-shadow: 0 0 0 3px var(--dash-primary-light);
}

.aht-refresh-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: 1px solid var(--dash-border);
    background: var(--dash-surface);
    color: var(--dash-text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease;
}

.aht-refresh-btn svg { width: 18px; height: 18px; }

.aht-refresh-btn:hover {
    background: var(--dash-primary);
    color: #fff;
    border-color: var(--dash-primary);
}

.aht-refresh-btn.spinning svg { animation: aht-spin 0.8s linear infinite; }

@keyframes aht-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.aht-add-btn {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-hover));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.aht-add-btn svg { width: 16px; height: 16px; }

.aht-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99,102,241,0.45);
}

/* --- Panel --- */
.aht-panel { position: relative; overflow: hidden; }

.aht-sort-header { cursor: pointer; user-select: none; white-space: nowrap; }
.aht-sort-header::after { content: '↕'; margin-left: 4px; opacity: 0.3; font-size: 0.75rem; }
.aht-sort-header.sort-asc::after  { content: '↑'; opacity: 0.8; color: var(--dash-primary); }
.aht-sort-header.sort-desc::after { content: '↓'; opacity: 0.8; color: var(--dash-primary); }

.aht-row td { vertical-align: middle; }

.aht-name-cell { display: flex; flex-direction: column; }
.aht-name-main { font-weight: 600; color: var(--dash-text-primary); font-size: 0.85rem; }
.aht-name-sub  { font-size: 0.72rem; color: var(--dash-text-muted); margin-top: 1px; }

.aht-badge {
    display: inline-flex; align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem; font-weight: 600;
}

.aht-badge.asset   { background: var(--dash-primary-light); color: var(--dash-primary); }
.aht-badge.driver  { background: var(--dash-cyan-light); color: var(--dash-cyan); }
.aht-badge.outline { background: transparent; border: 1px solid var(--dash-border); color: var(--dash-text-secondary); }

/* --- Consents --- */
.aht-consent-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem; font-weight: 700;
}
.aht-consent-badge.pending  { background: rgba(245,158,11,0.1); color: #f59e0b; }
.aht-consent-badge.approved { background: var(--dash-success-light); color: var(--dash-success); }
.aht-consent-badge.rejected { background: rgba(239,68,68,0.1); color: #ef4444; }

.aht-status-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.28rem 0.72rem;
    border-radius: 20px;
    font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.3px;
}

.aht-status-badge.pending   { background: rgba(245,158,11,0.12); color: #f59e0b; }
.aht-status-badge.success   { background: var(--dash-success-light); color: var(--dash-success); }
.aht-status-badge.rejected  { background: rgba(239,68,68,0.1); color: #ef4444; }

.aht-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* --- Action Buttons --- */
.aht-row-actions { display: flex; gap: 0.4rem; }

.aht-action-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 0.32rem 0.65rem;
    border-radius: 7px;
    border: 1px solid transparent;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aht-action-btn svg { width: 13px; height: 13px; }

.aht-action-btn.consent {
    background: var(--dash-primary-light);
    color: var(--dash-primary);
    border-color: rgba(99,102,241,0.2);
}
.aht-action-btn.consent:hover { background: var(--dash-primary); color: #fff; }

.aht-action-btn.reject {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border-color: rgba(239,68,68,0.2);
}
.aht-action-btn.reject:hover { background: #ef4444; color: #fff; }

/* --- Empty State --- */
.aht-empty-state {
    display: none; flex-direction: column; align-items: center;
    justify-content: center; padding: 3rem; text-align: center;
}

.aht-empty-icon {
    width: 64px; height: 64px; border-radius: 16px;
    background: var(--dash-primary-light); color: var(--dash-primary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem;
}

.aht-empty-icon svg { width: 32px; height: 32px; }
.aht-empty-title { font-size: 1.05rem; font-weight: 700; color: var(--dash-text-primary); margin-bottom: 0.3rem; }
.aht-empty-desc  { font-size: 0.82rem; color: var(--dash-text-muted); }

/* --- Pagination --- */
.aht-pagination-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--dash-border);
}

.aht-page-info { font-size: 0.78rem; color: var(--dash-text-muted); font-weight: 500; }
.aht-pagination { display: flex; align-items: center; gap: 0.35rem; }

.aht-page-btn {
    min-width: 34px; height: 34px;
    border-radius: 8px; border: 1px solid var(--dash-border);
    background: var(--dash-surface); color: var(--dash-text-primary);
    font-size: 0.78rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}

.aht-page-btn:hover:not(:disabled):not(.active) {
    background: var(--dash-primary-light); color: var(--dash-primary); border-color: var(--dash-primary);
}

.aht-page-btn.active { background: var(--dash-primary); color: #fff; border-color: var(--dash-primary); }
.aht-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.aht-page-dots { font-size: 0.78rem; color: var(--dash-text-muted); padding: 0 2px; }

/* --- Loading --- */
.aht-loading-overlay {
    display: none; position: absolute; inset: 0; z-index: 10;
    background: rgba(var(--dash-card-bg-rgb, 15,15,25), 0.85);
    backdrop-filter: blur(4px);
    flex-direction: column; align-items: center; justify-content: center;
    gap: 1rem; border-radius: var(--dash-radius);
}

.aht-loading-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--dash-border);
    border-top-color: var(--dash-primary);
    border-radius: 50%;
    animation: aht-spin 0.8s linear infinite;
}

.aht-loading-text { font-size: 0.82rem; color: var(--dash-text-muted); font-weight: 500; }

/* ========== MODAL ========== */
.aht-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 1rem;
}

.aht-modal-overlay.active {
    display: flex;
    animation: aht-fadeIn 0.25s ease-out;
}

@keyframes aht-fadeIn { from { opacity: 0; } to { opacity: 1; } }

.aht-modal {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    width: 100%; max-width: 600px; max-height: 92vh;
    display: flex; flex-direction: column;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    animation: aht-slideUp 0.3s ease-out;
}

@keyframes aht-slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.aht-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--dash-border);
}

.aht-modal-header-left { display: flex; align-items: center; gap: 0.85rem; }

.aht-modal-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: var(--dash-primary-light); color: var(--dash-primary);
    display: flex; align-items: center; justify-content: center;
}

.aht-modal-icon svg { width: 20px; height: 20px; }
.aht-modal-title    { font-size: 1.08rem; font-weight: 700; color: var(--dash-text, #f1f5f9); margin: 0; }
.aht-modal-subtitle { font-size: 0.76rem; color: var(--dash-text-muted, #94a3b8); margin: 2px 0 0; }

.aht-modal-close {
    width: 36px; height: 36px; border-radius: 10px;
    border: 1px solid var(--dash-border); background: transparent;
    color: var(--dash-text-muted); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}

.aht-modal-close svg { width: 18px; height: 18px; }
.aht-modal-close:hover { background: rgba(239,68,68,0.1); color: #ef4444; border-color: rgba(239,68,68,0.3); }

.aht-modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; scroll-behavior: smooth; }
.aht-modal-body::-webkit-scrollbar { width: 6px; }
.aht-modal-body::-webkit-scrollbar-track { background: transparent; }
.aht-modal-body::-webkit-scrollbar-thumb { background: var(--dash-border, #334155); border-radius: 3px; }
.aht-modal-body::-webkit-scrollbar-thumb:hover { background: var(--dash-text-muted, #94a3b8); }

.aht-modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 0.75rem; padding: 1rem 1.5rem;
    border-top: 1px solid var(--dash-border);
}

/* --- Mode Switch Selector --- */
.aht-mode-switch {
    display: flex;
    background: var(--dash-surface-2, rgba(255,255,255,0.03));
    border: 1px solid var(--dash-border);
    border-radius: 10px;
    padding: 0.2rem;
    margin-bottom: 1.25rem;
}

.aht-mode-opt {
    flex: 1;
    text-align: center;
    padding: 0.45rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--dash-text-muted);
}
.aht-mode-opt.active {
    background: var(--dash-primary);
    color: #fff;
}

/* --- Form --- */
.aht-form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.25rem; }
.aht-form-group:last-child { margin-bottom: 0; }

.aht-form-group label {
    font-size: 0.74rem; font-weight: 600;
    color: var(--dash-text, #f1f5f9);
    text-transform: uppercase; letter-spacing: 0.4px;
}

.aht-required { color: #ef4444; }

.aht-form-group input,
.aht-form-group select,
.aht-form-group textarea {
    padding: 0.58rem 0.85rem;
    border: 1px solid var(--dash-border);
    border-radius: 8px;
    background: var(--dash-surface-2);
    color: var(--dash-text, #f1f5f9);
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.aht-form-group input:focus,
.aht-form-group select:focus,
.aht-form-group textarea:focus {
    outline: none;
    border-color: var(--dash-primary);
    box-shadow: 0 0 0 3px var(--dash-primary-light);
}

.aht-form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 2rem;
    cursor: pointer;
}

.aht-form-group textarea {
    min-height: 70px;
    resize: vertical;
}

/* Info note */
.aht-info-note {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: rgba(99,102,241,0.06);
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 8px;
    font-size: 0.78rem; color: var(--dash-text-muted);
    line-height: 1.5;
    margin-top: 1rem;
}

.aht-info-note svg { width: 16px; height: 16px; color: var(--dash-primary); flex-shrink: 0; margin-top: 1px; }

/* --- Buttons --- */
.aht-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.3rem;
    border-radius: 10px;
    font-size: 0.82rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.aht-btn svg { width: 16px; height: 16px; }

.aht-btn-secondary {
    background: var(--dash-surface-2);
    color: var(--dash-text-muted);
    border: 1px solid var(--dash-border);
}

.aht-btn-secondary:hover { background: var(--dash-border); color: var(--dash-text-primary); }

.aht-btn-primary {
    background: linear-gradient(135deg, var(--dash-primary), var(--dash-primary-hover));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.aht-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }
.aht-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Searchable dropdown wrapper */
.aht-searchable-wrapper { position: relative; width: 100%; }

/* ===== TOAST ===== */
.aht-toast {
    position: fixed; bottom: 2rem; right: 2rem; z-index: 2000;
    display: none; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1.3rem; border-radius: 12px;
    font-size: 0.82rem; font-weight: 600;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    animation: aht-toastIn 0.35s ease-out;
}

.aht-toast.show    { display: flex; }
.aht-toast.success { background: var(--dash-success); color: #fff; }
.aht-toast.error   { background: #ef4444; color: #fff; }
.aht-toast.info    { background: var(--dash-primary); color: #fff; }

@keyframes aht-toastIn {
    from { opacity: 0; transform: translateY(10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes aht-toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(10px); }
}

/* ===== LIGHT MODE & DARK MODE CONTRAST COMPATIBILITY ===== */
[data-theme="light"] .aht-loading-overlay { background: rgba(255,255,255,0.85); }

/* Light Theme Contrast Enhancements */
[data-theme="light"] .aht-modal {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12) !important;
}
[data-theme="light"] .aht-modal-title,
[data-theme="light"] .aht-step-title,
[data-theme="light"] .aht-owner-name,
[data-theme="light"] .aht-policy-header,
[data-theme="light"] .aht-form-group label {
    color: #0f172a !important;
}
[data-theme="light"] .aht-modal-subtitle {
    color: #64748b !important;
}
[data-theme="light"] .aht-consent-summary {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
[data-theme="light"] .aht-consent-row {
    border-bottom-color: #e2e8f0 !important;
}
[data-theme="light"] .aht-consent-label {
    color: #64748b !important;
}
[data-theme="light"] .aht-consent-value {
    color: #0f172a !important;
}
[data-theme="light"] .aht-remarks-text {
    color: #334155 !important;
}
[data-theme="light"] .aht-form-group textarea,
[data-theme="light"] .aht-form-group input,
[data-theme="light"] .aht-form-group select {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}
[data-theme="light"] .aht-form-group textarea::placeholder,
[data-theme="light"] .aht-form-group input::placeholder {
    color: #94a3b8 !important;
}
[data-theme="light"] .aht-policy-box {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}
[data-theme="light"] .aht-policy-list {
    color: #475569 !important;
}
[data-theme="light"] .aht-name-sub,
[data-theme="light"] .aht-field-hint,
[data-theme="light"] .aht-search-hint,
[data-theme="light"] .aht-owner-sap,
[data-theme="light"] .aht-mini-stat-label,
[data-theme="light"] .aht-page-info {
    color: #475569 !important; /* Darker slate gray for high readability in light mode */
}
[data-theme="light"] .aht-tab-btn:not(.active) {
    color: #475569;
}
[data-theme="light"] .aht-tab-btn:hover:not(.active) {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .aht-remarks-sub {
    color: #334155;
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Dark Theme Contrast Enhancements */
[data-theme="dark"] .aht-name-sub,
[data-theme="dark"] .aht-field-hint,
[data-theme="dark"] .aht-search-hint,
[data-theme="dark"] .aht-owner-sap,
[data-theme="dark"] .aht-consent-label,
[data-theme="dark"] .aht-tab-btn:not(.active) {
    color: #94a3b8 !important; /* Lighter gray for high contrast in dark mode */
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .aht-mini-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .aht-mini-stats { grid-template-columns: 1fr; }
    .aht-tabs-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .aht-tabs { width: 100%; }
    .aht-tab-btn { flex: 1; justify-content: center; }
    .aht-add-btn { width: 100%; justify-content: center; }
    .aht-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .aht-toolbar-left { flex-direction: column; align-items: stretch; gap: 0.5rem; }
    .aht-search-wrapper, .aht-filter-select { width: 100%; }
    .aht-search-wrapper input { min-width: 100%; width: 100%; }
    .aht-modal { max-width: 100%; max-height: 95vh; border-radius: 12px; }
    .aht-pagination-bar { flex-direction: column; gap: 0.75rem; align-items: center; }
    .aht-card-grid { grid-template-columns: 1fr; }
    
    /* Table modifications for responsiveness - hide secondary info on tablet/mobile */
    .dash-table th:nth-child(2),
    .dash-table td:nth-child(2),
    .dash-table th:nth-child(9),
    .dash-table td:nth-child(9) {
        display: none;
    }
    .dash-table th, .dash-table td {
        padding: 0.6rem 0.8rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .aht-modal { height: 100vh; max-height: 100vh; border-radius: 0; }
    .aht-modal-body { padding: 1rem; }
    .aht-type-tabs { flex-direction: column; gap: 0.5rem; }
    /* Hide requested-by column on very small screens to fit layout */
    .dash-table th:nth-child(5),
    .dash-table td:nth-child(5) {
        display: none;
    }
}

/* --- Premium Interactive Selection Cards --- */
.aht-step-section {
    margin-bottom: 1.75rem;
    border-bottom: 1px dashed var(--dash-border, #334155);
    padding-bottom: 1.5rem;
}

.aht-step-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.25rem;
}

.aht-step-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--dash-text, #f1f5f9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aht-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.aht-selection-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    background: var(--dash-surface-2, rgba(255,255,255,0.02));
    border: 1px solid var(--dash-border, #334155);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.aht-selection-card:hover {
    border-color: var(--dash-primary, #6366f1);
    background: rgba(99, 102, 241, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.aht-selection-card.active {
    border-color: var(--dash-primary, #6366f1);
    background: var(--dash-primary-light, rgba(99, 102, 241, 0.08));
    box-shadow: 0 0 0 1px var(--dash-primary, #6366f1), 0 8px 24px rgba(99, 102, 241, 0.15);
}

.aht-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--dash-surface, #0f172a);
    color: var(--dash-text-muted, #94a3b8);
    flex-shrink: 0;
    border: 1px solid var(--dash-border, #334155);
    transition: all 0.2s ease;
}

.aht-selection-card.active .aht-card-icon {
    background: var(--dash-primary, #6366f1);
    color: #ffffff;
    border-color: var(--dash-primary, #6366f1);
}

.aht-card-icon svg {
    width: 18px;
    height: 18px;
}

.aht-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 1.25rem;
}

.aht-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dash-text-primary, #f1f5f9);
}

.aht-card-desc {
    font-size: 0.72rem;
    color: var(--dash-text-muted, #94a3b8);
    line-height: 1.4;
}

.aht-card-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dash-primary, #6366f1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aht-card-indicator svg {
    width: 11px;
    height: 11px;
}

.aht-selection-card.active .aht-card-indicator {
    transform: scale(1);
}

/* --- Premium Policy Callout Box --- */
.aht-policy-box {
    background: var(--dash-surface-2, rgba(30, 41, 59, 0.4));
    border: 1px solid var(--dash-border, #334155);
    border-left: 4px solid var(--dash-primary, #6366f1);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.aht-policy-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--dash-text, #f1f5f9);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aht-policy-header svg {
    width: 16px;
    height: 16px;
    color: var(--dash-primary, #6366f1);
}

.aht-policy-list {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.75rem;
    color: var(--dash-text-secondary, #94a3b8);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    line-height: 1.45;
}

/* --- Searchable Dropdown Overrides --- */
.aht-searchable-wrapper input[type="text"] {
    background: var(--dash-surface-2, rgba(255,255,255,0.02)) !important;
    border-color: var(--dash-border, #334155) !important;
}

.aht-searchable-wrapper input[type="text"]:focus {
    border-color: var(--dash-primary, #6366f1) !important;
    box-shadow: 0 0 0 3px var(--dash-primary-light, rgba(99, 102, 241, 0.15)) !important;
}

/* --- Remarks and Badges cells --- */
.aht-status-cell,
.aht-consent-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}

.aht-remarks-sub {
    font-size: 0.72rem;
    color: var(--dash-text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--dash-border, #334155);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0.15rem;
}

.aht-remarks-sub:hover {
    background: var(--dash-surface-2, rgba(255, 255, 255, 0.08));
    border-style: solid;
    border-color: var(--dash-primary, #6366f1);
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
    color: var(--dash-text, #f1f5f9);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* ===== TYPE TABS (inside modal) ===== */
.aht-type-tabs {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.aht-type-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border: 2px solid var(--dash-border, #334155);
    border-radius: 12px;
    background: var(--dash-surface-2, rgba(255,255,255,0.03));
    color: var(--dash-text-muted, #94a3b8);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.aht-type-tab svg { width: 20px; height: 20px; }

.aht-type-tab:hover {
    border-color: var(--dash-primary, #6366f1);
    color: var(--dash-primary, #6366f1);
    background: var(--dash-primary-light, rgba(99,102,241,0.08));
}

.aht-type-tab.active {
    border-color: var(--dash-primary, #6366f1);
    background: var(--dash-primary-light, rgba(99,102,241,0.12));
    color: var(--dash-primary, #6366f1);
    box-shadow: 0 0 0 3px var(--dash-primary-glow, rgba(99,102,241,0.2));
}

/* ===== CURRENT OWNER AUTO-DISPLAY ===== */
.aht-owner-display {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.1rem;
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(6,182,212,0.06));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 10px;
    animation: dash-fadeUp 0.25s ease-out;
}

.aht-owner-avatar {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.aht-owner-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dash-text, #f1f5f9);
}

.aht-owner-sap {
    font-size: 0.75rem;
    color: var(--dash-text-muted, #94a3b8);
    margin-top: 0.15rem;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* ===== FIELD HINT ===== */
.aht-field-hint {
    font-size: 0.75rem;
    color: var(--dash-text-muted, #94a3b8);
    margin-top: 0.4rem;
    font-style: italic;
}

/* ===== CONSENT SUMMARY CARD ===== */
.aht-consent-summary {
    background: var(--dash-surface-2, rgba(255,255,255,0.03));
    border: 1px solid var(--dash-border, #334155);
    border-radius: 12px;
    overflow: hidden;
}

.aht-consent-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--dash-border, #334155);
}

.aht-consent-row:last-child { border-bottom: none; }

.aht-consent-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dash-text-muted, #94a3b8);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.aht-consent-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dash-text, #f1f5f9);
    text-align: right;
}

.aht-remarks-text {
    font-style: italic;
    color: var(--dash-text-secondary, #cbd5e1);
    font-weight: 400;
    font-size: 0.82rem;
}

/* ===== DANGER BUTTON ===== */
.aht-btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    border: none;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3);
    transition: all 0.25s ease;
}

.aht-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239,68,68,0.4);
}

@media (max-width: 380px) {
    .aht-tabs {
        gap: 0.25rem;
    }

    .aht-toolbar {
        gap: 0.4rem;
    }

    .aht-panel {
        border-radius: 8px;
    }

    .aht-tab-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.72rem;
    }

    .aht-modal-footer {
        flex-direction: column-reverse;
        gap: 0.4rem;
        padding: 0.75rem;
    }

    .aht-modal-footer button {
        width: 100%;
        justify-content: center;
    }
}
