@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* Theme - teal/sea inspired */
    --wcts-primary: #0d9488;
    --wcts-primary-dark: #0f766e;
    --wcts-accent: #d97706;
    --wcts-success: #059669;
    --wcts-warning: #d97706;
    --wcts-danger: #dc2626;
    --wcts-info: #0891b2;
    --wcts-sidebar-bg: #f8fafc;
    --wcts-sidebar-hover: #e2e8f0;
    --wcts-surface: #ffffff;
    --wcts-surface-muted: #f8fafc;
    --wcts-border: rgba(0, 0, 0, 0.06);
    --wcts-border-strong: #e2e8f0;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.15);

    /* Focus ring */
    --focus-ring: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

html, body {
    font-family: 'Tajawal', sans-serif;
    font-size: 16px;
    direction: rtl;
    text-align: right;
}

body *, .form-label, .form-control, .form-select, .btn, p, span, small, label, td, th {
    font-family: 'Tajawal', sans-serif;
}

a, .btn-link {
    color: var(--wcts-primary);
}

a:hover, .btn-link:hover {
    color: var(--wcts-primary-dark);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--wcts-primary-dark) 0%, #115e59 100%);
    color: #fff;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: var(--focus-ring);
}

.content {
    padding-top: var(--space-6);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--wcts-success);
}

.invalid {
    outline: 1px solid var(--wcts-danger);
}

.validation-message {
    color: var(--wcts-danger);
}

.blazor-error-boundary {
    background: var(--wcts-danger);
    padding: 1rem 1.5rem;
    color: white;
    border-radius: var(--radius-md);
}

.blazor-error-boundary::after {
    content: "حدث خطأ غير متوقع.";
}

/* Cards */
.card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease;
    border: 1px solid var(--wcts-border);
    background: var(--wcts-surface);
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card-body {
    padding: var(--space-5);
}

.card-header {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
    padding: var(--space-4) var(--space-5);
    background: var(--wcts-surface-muted);
    border-bottom: 1px solid var(--wcts-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Tables */
.table {
    font-family: 'Tajawal', sans-serif;
}

.table thead th {
    font-weight: 700;
    background: var(--wcts-surface-muted);
    border-bottom: 1px solid var(--wcts-border-strong);
    padding: var(--space-3) var(--space-4);
}

.table tbody td {
    padding: var(--space-3) var(--space-4);
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: var(--wcts-surface-muted);
}

.table-responsive {
    border-radius: var(--radius-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-responsive .table {
    min-width: 600px;
}

/* Status badges */
.badge {
    font-family: 'Tajawal', sans-serif;
    font-weight: 500;
    padding: var(--space-1) var(--space-2);
}

.badge-status-registered { background-color: #64748b; color: #fff; }
.badge-status-under-inspection { background-color: var(--wcts-info); color: #fff; }
.badge-status-inspection-complete { background-color: #3b82f6; color: #fff; }
.badge-status-under-collection { background-color: var(--wcts-accent); color: #fff; }
.badge-status-ready-for-exit { background-color: #7c3aed; color: #fff; }
.badge-status-exit-permit-issued { background-color: #14b8a6; color: #fff; }
.badge-status-exited { background-color: var(--wcts-success); color: #fff; }

/* Status guide - دليل مراحل المعاملة */
.status-guide {
    border: 1px solid var(--wcts-border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.status-guide-summary {
    padding: var(--space-4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    color: var(--wcts-primary);
    list-style: none;
}

.status-guide-summary::-webkit-details-marker { display: none; }

.status-guide-summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-width: 6px 0 6px 8px;
    border-style: solid;
    border-color: transparent transparent transparent var(--wcts-primary);
    margin-left: var(--space-2);
    transition: transform 0.2s ease;
}

.status-guide[open] .status-guide-summary::before {
    transform: rotate(90deg);
}

.status-guide-body {
    padding: 0 var(--space-4) var(--space-4);
}

.status-guide-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.status-guide-step {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--wcts-surface-muted);
    border-right: 4px solid;
}

.status-guide-step__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 1.1rem;
}

.status-guide-step__content strong { display: block; margin-bottom: var(--space-1); }
.status-guide-step__content p { margin: 0; font-size: 0.85rem; color: #64748b; line-height: 1.4; }

.status-guide-step--registered { border-color: #64748b; }
.status-guide-step--registered .status-guide-step__icon { background: #64748b; }

.status-guide-step--under-inspection { border-color: var(--wcts-info); }
.status-guide-step--under-inspection .status-guide-step__icon { background: var(--wcts-info); }

.status-guide-step--inspection-complete { border-color: #3b82f6; }
.status-guide-step--inspection-complete .status-guide-step__icon { background: #3b82f6; }

.status-guide-step--under-collection { border-color: var(--wcts-accent); }
.status-guide-step--under-collection .status-guide-step__icon { background: var(--wcts-accent); }

.status-guide-step--ready-for-exit { border-color: #7c3aed; }
.status-guide-step--ready-for-exit .status-guide-step__icon { background: #7c3aed; }

.status-guide-step--exit-permit-issued { border-color: #14b8a6; }
.status-guide-step--exit-permit-issued .status-guide-step__icon { background: #14b8a6; }

.status-guide-step--exited { border-color: var(--wcts-success); }
.status-guide-step--exited .status-guide-step__icon { background: var(--wcts-success); }

@media (max-width: 767.98px) {
    .status-guide-timeline {
        grid-template-columns: 1fr;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    color: #64748b;
}

.empty-state-icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: var(--space-3);
}

.empty-state-title {
    font-weight: 700;
    color: #475569;
    margin-bottom: var(--space-1);
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #334155;
}

.form-control, .form-select {
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wcts-primary);
    box-shadow: var(--focus-ring);
}

.form-floating > label {
    font-family: 'Tajawal', sans-serif;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: right;
}

/* Section headers in forms */
.section-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-3);
    border-bottom: 2px solid var(--wcts-border-strong);
}

.section-header-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
}

/* Page layout */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--wcts-sidebar-bg) 0%, #ffffff 100%);
    color: #334155;
    border-left: 1px solid var(--wcts-border-strong);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

.sidebar-brand {
    padding: var(--space-4);
    border-bottom: 1px solid var(--wcts-border-strong);
}

.sidebar-brand .navbar-brand {
    color: var(--wcts-primary-dark) !important;
    font-size: 1rem;
}
.sidebar-brand .site-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}
.top-bar-logo {
    height: 28px;
    width: auto;
    object-fit: contain;
}

.sidebar .nav-link {
    color: #475569;
    padding: var(--space-3) var(--space-4);
    font-weight: 500;
    border-radius: var(--radius-md);
    margin: 0 var(--space-2);
    transition: all 0.2s ease;
}

.sidebar .nav-link .bi {
    font-size: 1.15rem;
    margin-left: var(--space-2);
    color: var(--wcts-primary);
}

.sidebar .nav-link:hover {
    background: var(--wcts-sidebar-hover);
    color: var(--wcts-primary-dark);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: white;
}

.sidebar .nav-link.active .bi {
    color: white;
}

main {
    flex: 1;
    background: #f1f5f9;
}

/* Login page: no sidebar, full-width content */
.page--no-sidebar main {
    background: transparent;
}
.login-page-body .content {
    padding: 0;
}

.top-row {
    background: var(--wcts-surface);
    border-bottom: 1px solid var(--wcts-border-strong);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.navbar-brand {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
}

/* User avatar in top bar */
.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Home shortcut cards */
.home-shortcut-card {
    border-radius: var(--radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.home-shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.home-shortcut-card .card-title {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

.home-shortcut-card .card-icon-wrap {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Home statistics cards */
.home-stats-section {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.8) 0%, transparent 100%);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
}

.home-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--wcts-border);
    background: var(--wcts-surface);
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.home-stat-card__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.home-stat-card--primary .home-stat-card__icon {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.18) 0%, rgba(13, 148, 136, 0.3) 100%);
    color: var(--wcts-primary);
}

.home-stat-card--success .home-stat-card__icon {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.18) 0%, rgba(5, 150, 105, 0.3) 100%);
    color: var(--wcts-success);
}

.home-stat-card--accent .home-stat-card__icon {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.18) 0%, rgba(217, 119, 6, 0.3) 100%);
    color: var(--wcts-accent);
}

.home-stat-card__content {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.home-stat-card__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.home-stat-card__label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

.home-chart-wrap {
    height: 140px;
    position: relative;
}

/* Modal */
.modal-content {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
}

.modal-header {
    font-family: 'Tajawal', sans-serif;
    font-weight: 700;
}

/* Timeline for inspection steps */
.inspection-timeline {
    position: relative;
    padding-right: var(--space-4);
}

.inspection-timeline::before {
    content: "";
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: var(--wcts-border-strong);
    border-radius: 1px;
}

.txn-inspection-timeline::before {
    right: 2.125rem; /* مراكمة الخط مع منتصف العُقد (2.25rem ÷ 2) */
}

.timeline-item {
    position: relative;
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-node {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    margin-right: var(--space-1);
    border: 3px solid;
}

.timeline-node.approved {
    background: var(--wcts-success);
    border-color: var(--wcts-success);
}

.timeline-node.rejected {
    background: var(--wcts-danger);
    border-color: var(--wcts-danger);
}

.timeline-node.pending {
    background: var(--wcts-surface);
    border-color: #94a3b8;
}

.timeline-content {
    flex: 1;
    padding: var(--space-3);
    border-radius: var(--radius-md);
    background: var(--wcts-surface-muted);
    border: 1px solid var(--wcts-border);
}

.timeline-content.approved {
    border-right: 4px solid var(--wcts-success);
}

.timeline-content.rejected {
    border-right: 4px solid var(--wcts-danger);
}

.timeline-content.pending {
    border-right: 4px solid #94a3b8;
}

.timeline-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: var(--space-1);
}

.timeline-notes {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: var(--space-1);
}

/* Page Header - unified title across all pages */
.page-header {
    position: relative;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06) 0%, rgba(15, 118, 110, 0.04) 100%);
    border: 1px solid rgba(13, 148, 136, 0.12);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    overflow: hidden;
}
.page-header__accent {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.page-header__content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.page-header__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.page-header__title {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}
.page-header__subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0.25rem 0 0;
    font-weight: 500;
}
.page-header-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.page-header-wrap .page-header {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}
@media (max-width: 767px) {
    .page-header-wrap {
        flex-direction: column;
    }
    .page-header__content {
        flex-wrap: wrap;
    }
}

/* Transaction Detail Page */
.txn-detail-hero {
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.txn-detail-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -20%;
    width: 60%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
}

.txn-detail-hero__actions {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
}

.txn-back-btn {
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.4);
}

.txn-detail-hero__main {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.txn-detail-hero__icon {
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.txn-detail-hero__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.02em;
}

.txn-detail-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.txn-detail-hero__date {
    font-size: 0.9rem;
    opacity: 0.9;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.txn-detail-hero__status {
    font-size: 0.8rem;
}

.txn-detail-card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.txn-detail-card .section-header {
    display: flex;
    align-items: center;
}

.txn-detail-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.txn-detail-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--wcts-border);
}

.txn-detail-row:last-child {
    border-bottom: none;
}

.txn-detail-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.txn-detail-label .bi {
    font-size: 1rem;
    color: var(--wcts-primary);
}

.txn-detail-value {
    font-weight: 600;
    color: #0f172a;
}

.txn-empty-path {
    text-align: center;
    padding: var(--space-6);
    color: #94a3b8;
}

.txn-empty-path .bi {
    font-size: 2.5rem;
    margin-bottom: var(--space-2);
}

.txn-inspection-timeline .timeline-node {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 2px;
}

.txn-inspection-timeline .timeline-node .bi {
    font-size: 1rem;
    color: #fff;
}

.txn-inspection-timeline .timeline-node.pending .bi {
    color: #94a3b8;
}

.txn-inspection-timeline .timeline-node.pending {
    background: var(--wcts-surface);
}

/* ========== Login Page ========== */
.login-page-body {
    margin: 0;
    min-height: 100vh;
}

.login-page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: linear-gradient(160deg, #0c1222 0%, #1a2744 25%, #0f172a 50%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.login-page-wrap::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 90%;
    height: 90%;
    background: radial-gradient(ellipse, rgba(13, 148, 136, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.login-page-wrap::after {
    content: "";
    position: absolute;
    bottom: -20%;
    left: -30%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(5, 150, 105, 0.08) 0%, transparent 65%);
    pointer-events: none;
}

.login-page-wrap .login-card {
    animation: loginCardEnter 0.6s ease-out;
}

@keyframes loginCardEnter {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-radius: 1.25rem;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.login-card-header {
    padding: 2.25rem 2rem 1.25rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.login-card-header .login-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card-header .login-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.login-card-header h1 {
    font-family: 'Tajawal', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: #0f172a;
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.login-card-header .login-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.login-card-body {
    padding: 1.75rem 2rem 2rem;
}

.login-card-body .form-label {
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.35rem;
}

.login-card-body .form-control {
    border-radius: var(--radius-md);
    border: 1px solid #cbd5e1;
    padding: 0.65rem 0.9rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-card-body .form-control:focus {
    border-color: var(--wcts-primary);
    box-shadow: var(--focus-ring);
}

.login-error-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 500;
}

.login-error-box::before {
    content: "!";
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #b91c1c;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
}

.login-btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: white;
    transition: transform 0.15s, box-shadow 0.2s;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.login-fill-btn {
    font-family: 'Tajawal', sans-serif;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
}

.login-fill-btn:hover {
    background: var(--wcts-surface-muted);
}

.login-hint {
    margin-top: 1.5rem;
    padding: 1.25rem 1.25rem;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.9) 100%);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
}

.login-hint-title {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
}

.login-hint-title .bi {
    color: var(--wcts-primary);
}

.login-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-account-btn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-md);
    font-family: 'Tajawal', sans-serif;
    text-align: right;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-account-btn:hover {
    background: rgba(13, 148, 136, 0.06);
    border-color: var(--wcts-primary);
    transform: translateX(-2px);
}

.login-account-btn__role {
    font-weight: 700;
    color: #0f172a;
    min-width: 7rem;
}

.login-account-btn__creds {
    flex: 1;
    font-size: 0.9rem;
    color: #475569;
}

.login-account-btn__label {
    color: #64748b;
    font-size: 0.8rem;
}

.login-account-btn__sep {
    margin: 0 0.35rem;
    color: #cbd5e1;
}

.login-account-btn__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--wcts-primary);
    font-size: 0.9rem;
}

.login-account-btn__action .bi {
    font-size: 1.1rem;
}

.login-use-btn {
    transition: transform 0.15s, background-color 0.2s;
}

/* Workflow Office Sequence - Drag & Drop */
.workflow-panel {
    border: 2px solid var(--wcts-border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--wcts-surface);
    min-height: 200px;
}

.workflow-panel-header {
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, var(--wcts-surface-muted) 0%, #f1f5f9 100%);
    font-weight: 700;
    font-size: 0.95rem;
    color: #334155;
    border-bottom: 1px solid var(--wcts-border-strong);
}

.workflow-panel-header .bi {
    margin-left: var(--space-2);
    color: var(--wcts-primary);
}

.workflow-panel-body {
    padding: var(--space-3);
    min-height: 160px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-content: flex-start;
}

.workflow-sequence .workflow-panel-body {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
}

.workflow-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.85rem;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
    border: 1px solid #5eead4;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.workflow-chip:hover {
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: white;
    border-color: var(--wcts-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

.workflow-chip:focus {
    outline: none;
    box-shadow: var(--focus-ring);
}

.workflow-sequence-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: white;
    border: 1px solid var(--wcts-border-strong);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    cursor: grab;
    transition: all 0.2s ease;
}

.workflow-sequence-item:last-child {
    margin-bottom: 0;
}

.workflow-sequence-item:hover {
    border-color: var(--wcts-primary);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}

.workflow-sequence-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
}

.workflow-drag-handle {
    color: #94a3b8;
    cursor: grab;
    padding: 0.2rem;
}

.workflow-sequence-item:hover .workflow-drag-handle {
    color: var(--wcts-primary);
}

.workflow-step-num {
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.workflow-step-name {
    flex: 1;
    font-weight: 500;
}

.workflow-remove {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.workflow-remove:hover {
    background: #fee2e2;
    color: var(--wcts-danger);
}

.workflow-empty-hint {
    text-align: center;
    width: 100%;
}

/* ========== Mobile App-like UI ========== */
@media (max-width: 767.98px) {
    html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    body {
        overflow-x: hidden;
        max-width: 100vw;
        -webkit-overflow-scrolling: touch;
        padding-bottom: env(safe-area-inset-bottom);
    }
    .page, main, .content, .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
    }
    .card, .card-body {
        max-width: 100%;
    }
    .page {
        padding-bottom: 70px;
    }
    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        z-index: 1050;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1049;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar-toggle-mobile {
        color: #334155 !important;
    }
    .top-row {
        min-height: 56px;
        padding: var(--space-2) var(--space-4);
    }
    .content {
        padding: var(--space-4);
        padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
    }
    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding-bottom: env(safe-area-inset-bottom);
        background: var(--wcts-surface);
        border-top: 1px solid var(--wcts-border-strong);
        display: flex;
        justify-content: space-around;
        align-items: center;
        z-index: 1030;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--space-2) var(--space-3);
        color: #64748b;
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        flex: 1;
        gap: 2px;
        transition: color 0.2s ease;
    }
    .bottom-nav-item .bi {
        font-size: 1.35rem;
    }
    .bottom-nav-item.active {
        color: var(--wcts-primary);
    }
    .bottom-nav-item.active .bi {
        color: var(--wcts-primary);
    }
    .card {
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }
    .form-control, .form-select {
        min-height: 44px;
    }
}

/* Data view toggle - table / cards */
.data-view-card {
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    border: 1px solid rgba(13, 148, 136, 0.08);
    position: relative;
}
.data-view-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--wcts-primary) 0%, var(--wcts-primary-dark) 100%);
    opacity: 0.9;
}
.data-view-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(13, 148, 136, 0.2), 0 4px 12px -4px rgba(0, 0, 0, 0.1);
    border-color: rgba(13, 148, 136, 0.15);
}
.data-view-card .card-body {
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + 0.5rem);
}
.data-view-card .d-flex.justify-content-between.align-items-start:first-of-type {
    padding-bottom: 0.5rem;
}
.data-view-card .d-flex.justify-content-between.align-items-start strong {
    font-size: 1.05rem;
    color: #0f172a;
    letter-spacing: -0.01em;
}
.data-view-card hr {
    opacity: 0.4;
    margin: 0.5rem 0 0.75rem;
}
.data-view-card dl dt {
    color: #64748b;
    font-weight: 600;
    font-size: 0.8rem;
}
.data-view-card dl dd {
    margin-bottom: 0.35rem;
    color: #334155;
    font-weight: 500;
}
.data-view-card .border-top {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
}
.data-view-card .btn-sm {
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}
.data-view-card .btn-outline-primary:hover {
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}
.data-view-toggle-btns .btn.active {
    background: var(--wcts-primary);
    color: #fff;
    border-color: var(--wcts-primary);
}
.data-view-toggle-btns .btn:not(.active):hover {
    background: var(--wcts-sidebar-hover);
}
