/* ============================
   ORA Brand Tokens — 4 colours only
   White · Silver · Sand · Charcoal
   ============================ */
:root {
    /* Base palette */
    --ora-white:        #FFFFFF;
    --ora-silver:       #A8A8A8;
    --ora-sand:         #D4B896;
    --ora-charcoal:     #2D2D2D;

    /* Derived tints */
    --ora-charcoal-2:   #222222;
    --ora-charcoal-soft:rgba(45,45,45,0.07);
    --ora-charcoal-mid: rgba(45,45,45,0.14);

    --ora-sand-dark:    #B89670;
    --ora-sand-mid:     rgba(212,184,150,0.30);
    --ora-sand-soft:    rgba(212,184,150,0.14);
    --ora-sand-bg:      #FBF8F4;

    --ora-silver-dark:  #787878;
    --ora-silver-soft:  rgba(168,168,168,0.15);
    --ora-silver-bg:    #F0EEEC;

    /* Page background: very light sand */
    --ora-bg:           #F7F4F0;
}

/* ============================
   Base & Reset
   ============================ */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--ora-bg);
    color: var(--ora-charcoal);
}

/* ============================
   Layout Shell
   ============================ */
.sg-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sg-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================
   Sidebar
   ============================ */
.sg-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--ora-charcoal);
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.18);
    z-index: 100;
}

.sg-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--ora-sand);
}

.sg-nav-list {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.sg-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: #9A9A9A;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 500;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.sg-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sg-nav-link.active {
    background: var(--ora-sand-soft);
    color: var(--ora-sand);
    border-left: 3px solid var(--ora-sand);
}

.sg-sidebar-footer {
    padding: 16px 20px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.3);
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============================
   Top Bar
   ============================ */
.sg-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.sg-page-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0.01em;
}

.sg-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sg-username {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.87rem;
    color: #64748b;
    font-weight: 500;
}

.sg-logout-btn {
    font-size: 0.82rem;
    padding: 4px 14px;
    border: 1px solid var(--ora-silver-soft);
    background: var(--ora-silver-bg);
    color: var(--ora-charcoal);
    border-radius: 6px;
    transition: all 0.15s;
}

.sg-logout-btn:hover {
    background: var(--ora-silver);
    border-color: var(--ora-silver);
    color: var(--ora-white);
}

/* ============================
   Main Content Area
   ============================ */
.sg-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
}

/* ============================
   Search Section
   ============================ */
.sg-search-section {
    margin-bottom: 8px;
}

.sg-search-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px 32px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.sg-search-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2D2D2D;
    margin-bottom: 6px;
}

.sg-search-subtitle {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.sg-search-row {
    display: flex;
    gap: 12px;
    max-width: 760px;
}

.sg-search-input {
    flex: 1;
    height: 46px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.98rem;
    padding: 0 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sg-search-project {
    flex: 0 0 190px;
}

.sg-suggestion-panel {
    max-width: 1400px;
}

.sg-suggestion-heading {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
    padding-left: 2px;
}

.sg-suggestion-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.sg-suggestion-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 13px 14px;
    border: 1.5px solid #eef1f5;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    font-size: 0.94rem;
    font-weight: 600;
    color: #2D2D2D;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}

.sg-suggestion-row:hover,
.sg-suggestion-row:focus-visible {
    background: var(--ora-sand-bg);
    border-color: var(--ora-sand);
    box-shadow: 0 4px 12px rgba(212,184,150,0.35);
    transform: translateY(-1px);
    outline: none;
}

.sg-suggestion-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    transition: background 0.15s, color 0.15s;
}

.sg-suggestion-row:hover .sg-suggestion-icon {
    background: var(--ora-sand);
    color: var(--ora-white);
}

.sg-suggestion-code {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-suggestion-chevron {
    flex: 0 0 auto;
    color: var(--ora-silver);
    transition: transform 0.15s, color 0.15s;
}

.sg-suggestion-row:hover .sg-suggestion-chevron {
    color: var(--ora-sand-dark);
    transform: translateX(3px);
}

[dir="rtl"] .sg-suggestion-row {
    text-align: right;
}

[dir="rtl"] .sg-suggestion-chevron svg {
    transform: scaleX(-1);
}

[dir="rtl"] .sg-suggestion-row:hover .sg-suggestion-chevron {
    transform: translateX(-3px);
}

.sg-search-input:focus {
    border-color: var(--ora-sand);
    box-shadow: 0 0 0 3px var(--ora-sand-soft);
    outline: none;
}

.sg-search-btn {
    height: 46px;
    padding: 0 24px;
    background: var(--ora-charcoal);
    color: var(--ora-white);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.93rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    white-space: nowrap;
}

.sg-search-btn:hover:not(:disabled) {
    background: var(--ora-charcoal-2);
    color: var(--ora-white);
}

.sg-search-btn:disabled {
    opacity: 0.55;
}

.sg-alert {
    border-radius: 8px;
}

/* ============================
   Results Layout
   ============================ */
.sg-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================
   Info Cards
   ============================ */
.sg-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}

.sg-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 0.93rem;
    font-weight: 700;
    color: #2D2D2D;
    background: #f8fafc;
    border-bottom: 1px solid #e9eef5;
}

.sg-card-header-alert {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    border-bottom-color: var(--ora-charcoal-mid);
}

.sg-card-body {
    padding: 16px 20px;
}

.sg-count-badge {
    margin-left: auto;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}

.sg-count-badge-alert {
    background: var(--ora-charcoal-mid);
    color: var(--ora-charcoal);
}

/* ============================
   Unit Info Rows
   ============================ */
.sg-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
}

.sg-info-row:last-child {
    border-bottom: none;
}

.sg-info-label {
    font-size: 0.83rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.sg-info-value {
    font-size: 0.93rem;
    color: #1a1f2e;
    text-align: right;
}

.sg-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sg-badge-rented {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    border: 1px solid var(--ora-charcoal-mid);
}

.sg-badge-available {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    border: 1px solid var(--ora-sand-mid);
}

/* ============================
   Person Rows (Buyers)
   ============================ */
.sg-person-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.sg-person-row:last-child {
    border-bottom: none;
}

.sg-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: #2D2D2D;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sg-person-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

.sg-person-phone {
    font-size: 0.83rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.sg-block-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.sg-block-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.sg-block-badge-main {
    background: #b91c1c;
    color: #fff;
    border-color: #b91c1c;
}

.sg-block-reason {
    font-size: 0.8rem;
    color: #991b1b;
    margin-top: 3px;
    font-style: italic;
}

/* ============================
   Case Rows
   ============================ */
.sg-case-row {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.sg-case-row:last-child {
    border-bottom: none;
}

.sg-case-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sg-case-number {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    font-family: 'Courier New', monospace;
}

.sg-case-subject {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.sg-case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.sg-case-type {
    font-size: 0.77rem;
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.sg-case-date {
    font-size: 0.77rem;
    color: var(--ora-silver);
}

.sg-case-status {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.sg-status-inprogress {
    background: var(--ora-charcoal-mid);
    color: var(--ora-charcoal);
}

.sg-status-resolved {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
}

.sg-status-closed {
    background: var(--ora-silver-soft);
    color: var(--ora-silver-dark);
}

.sg-status-default {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
}

/* ============================
   Empty State
   ============================ */
.sg-empty-icon {
    font-size: 2.5rem;
}

/* ============================
   Login Page
   ============================ */
.sg-login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ora-charcoal) 0%, #3A3A3A 60%, var(--ora-charcoal) 100%);
    padding: 20px;
}

.sg-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.sg-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.sg-login-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--ora-charcoal), var(--ora-sand));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
}

.sg-login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2D2D2D;
    margin-bottom: 4px;
}

.sg-login-subtitle {
    color: #94a3b8;
    font-size: 0.87rem;
}

.sg-login-alert {
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.sg-login-form .sg-form-label {
    font-size: 0.87rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sg-form-input {
    height: 44px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.95rem;
    padding: 0 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sg-form-input:focus {
    border-color: var(--ora-sand);
    box-shadow: 0 0 0 3px var(--ora-sand-soft);
    outline: none;
}

.sg-login-btn {
    height: 48px;
    background: var(--ora-charcoal);
    color: var(--ora-white);
    font-weight: 700;
    font-size: 0.97rem;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, background 0.15s;
}

.sg-login-btn:hover {
    opacity: 0.9;
    color: #fff;
}

/* ============================
   Blazor Error UI
   ============================ */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbmsiPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ============================
   ORA Brand Logo
   ============================ */
.sg-brand-logo {
    width: 54px;
    height: auto;
    opacity: 0.85;
    filter: brightness(0) invert(1);
}

/* ============================
   Login — ORA Logo
   ============================ */
.sg-login-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.sg-login-logo {
    width: 96px;
    height: auto;
    opacity: 0.75;
}

.sg-login-divider-bar {
    width: 36px;
    height: 3px;
    background: var(--ora-sand);
    border-radius: 2px;
    margin: 12px auto 16px;
}

/* ============================
   Change Password Page
   ============================ */
.sg-cp-wrapper {
    max-width: 480px;
}

.sg-cp-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.sg-cp-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: linear-gradient(135deg, var(--ora-charcoal), var(--ora-sand));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 14px rgba(45,45,45,0.28);
}

.sg-cp-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2D2D2D;
    margin: 0 0 2px;
}

.sg-cp-subtitle {
    font-size: 0.83rem;
    color: #94a3b8;
    margin: 0;
}

.sg-cp-alert {
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.sg-cp-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    overflow: hidden;
    position: relative;
}

.sg-cp-card-accent {
    height: 4px;
    background: linear-gradient(90deg, var(--ora-charcoal), var(--ora-sand));
}

.sg-cp-card-body {
    padding: 28px 28px 32px;
}

.sg-cp-field {
    margin-bottom: 18px;
}

.sg-cp-label {
    display: flex;
    align-items: center;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 7px;
}

.sg-cp-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 20px;
    color: #9B9B9B;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.sg-cp-divider::before,
.sg-cp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9eef5;
}

.sg-cp-btn {
    width: 100%;
    height: 46px;
    background: var(--ora-charcoal);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 10px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(45,45,45,0.32);
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
}

.sg-cp-btn:hover {
    opacity: 0.88;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(45,45,45,0.38);
}

.sg-cp-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(45,45,45,0.28);
}

/* ============================
   Pretty UI Touches
   ============================ */

/* Card hover lift */
.sg-card {
    transition: box-shadow 0.2s, transform 0.2s;
}

.sg-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* Search card sand left accent */
.sg-search-card {
    border-left: 4px solid var(--ora-sand);
}

/* Sidebar subtle gradient */
.sg-sidebar {
    background: linear-gradient(180deg, var(--ora-charcoal) 0%, var(--ora-charcoal-2) 100%);
}

/* Sidebar brand logo area refinement */
.sg-sidebar-brand {
    padding-left: 17px;
}

/* Search button shadow */
.sg-search-btn {
    box-shadow: 0 3px 10px rgba(45,45,45,0.22);
}

.sg-search-btn:hover:not(:disabled) {
    box-shadow: 0 5px 16px rgba(45,45,45,0.32);
    transform: translateY(-1px);
}

/* Topbar subtle left accent line */
.sg-topbar {
    border-left: none;
    position: relative;
}

/* Count badge charcoal variant for open cases */
.sg-count-badge-open {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
}

/* Status badge rented */
.sg-badge-rented {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    border: 1px solid var(--ora-charcoal-mid);
}

/* Smooth fade-in */
@keyframes sg-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sg-results .sg-card,
.sg-results .sg-tabs-container {
    animation: sg-fadein 0.22s ease both;
}

.sg-results .sg-tabs-container { animation-delay: 0.06s; }

/* ============================
   Tabs
   ============================ */
.sg-tabs-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
}

.sg-tabs-nav {
    display: flex;
    border-bottom: 2px solid #e9eef5;
    background: #f8fafc;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sg-tabs-nav::-webkit-scrollbar {
    display: none;
}

.sg-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 14px 20px;
    font-size: 0.87rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.sg-tab-btn:hover {
    color: #2D2D2D;
}

.sg-tab-btn.sg-tab-active {
    color: var(--ora-sand-dark);
    border-bottom-color: var(--ora-sand);
}

.sg-tab-badge {
    background: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sg-tab-badge-alert {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
}

.sg-tab-alert-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ora-sand);
    margin-left: -4px;
    margin-top: -8px;
    flex-shrink: 0;
}

.sg-tabs-panel {
    padding: 20px;
    min-height: 120px;
    animation: sg-fadein 0.15s ease both;
}

.sg-tab-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    gap: 12px;
    color: #94a3b8;
    font-size: 0.88rem;
}

.sg-tab-empty p {
    margin: 0;
}

/* ============================
   Unit Info Card (compact)
   ============================ */
.sg-unit-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.sg-unit-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.sg-unit-accent {
    height: 3px;
    background: linear-gradient(90deg, var(--ora-charcoal), var(--ora-sand));
}

.sg-unit-body {
    padding: 16px 20px 18px;
}

.sg-unit-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.sg-unit-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 3px;
}

.sg-unit-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ora-charcoal);
    letter-spacing: -0.01em;
}

.sg-unit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

.sg-unit-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sg-unit-field-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sg-unit-field-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: #1e293b;
}

/* ============================
   Property Manager Cards
   ============================ */
.sg-pm-card {
    background: #fff;
    border: 1px solid #e9eef5;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-left: 3px solid var(--ora-sand);
    transition: box-shadow 0.15s, transform 0.15s;
}

.sg-pm-card:last-child {
    margin-bottom: 0;
}

.sg-pm-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.sg-pm-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.sg-pm-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1e293b;
}

.sg-pm-name-empty {
    color: #94a3b8;
    font-weight: 400;
}

.sg-pm-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.sg-pm-badge-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sg-pm-badge {
    font-size: 0.71rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.sg-pm-badge-type {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    border: 1px solid var(--ora-sand-mid);
}

.sg-pm-badge-lease {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    border: 1px solid var(--ora-charcoal-mid);
}

.sg-pm-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.sg-pm-date {
    font-size: 0.79rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sg-pm-date-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================
   Guest QR Table
   ============================ */
.sg-guests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sg-guests-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e9eef5;
}

.sg-guests-table th {
    padding: 10px 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: start;
}

.sg-guests-table td {
    padding: 11px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.sg-guests-table tbody tr:last-child td {
    border-bottom: none;
}

.sg-guests-table tbody tr:hover {
    background: #fafafa;
}

.sg-guest-date {
    font-size: 0.88rem;
    color: #1e293b;
    font-weight: 500;
}

.sg-guest-empty {
    color: #94a3b8;
}

.sg-guest-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sg-guest-pending  { background: #f1f5f9;  color: #64748b; }
.sg-guest-active   { background: var(--ora-sand-soft); color: var(--ora-sand-dark); }
.sg-guest-expired  { background: #e2e8f0;  color: #475569; }
.sg-guest-used     { background: var(--ora-silver-soft); color: var(--ora-silver-dark); }
.sg-guest-canceled { background: var(--ora-charcoal-soft); color: var(--ora-charcoal); }

/* ============================
   Identity Buttons
   ============================ */
.sg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1.5px solid transparent;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
}

.sg-btn-sm {
    font-size: 0.78rem;
    padding: 5px 12px;
    border-radius: 6px;
    gap: 4px;
}

.sg-btn-primary {
    background: var(--ora-charcoal);
    color: #fff;
    border-color: var(--ora-charcoal);
    box-shadow: 0 2px 8px rgba(45,45,45,0.22);
}

.sg-btn-primary:hover:not(:disabled) {
    background: var(--ora-charcoal-2);
    border-color: var(--ora-charcoal-2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(45,45,45,0.32);
    transform: translateY(-1px);
}

.sg-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.sg-btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #334155;
    border-color: #cbd5e1;
}

.sg-btn-outline-coral {
    background: transparent;
    color: var(--ora-charcoal);
    border-color: var(--ora-silver);
}

.sg-btn-outline-coral:hover:not(:disabled) {
    background: var(--ora-charcoal-soft);
    color: var(--ora-charcoal);
    border-color: var(--ora-charcoal);
}

.sg-btn-outline-neutral {
    background: transparent;
    color: #64748b;
    border-color: #cbd5e1;
}

.sg-btn-outline-neutral:hover:not(:disabled) {
    background: #f1f5f9;
    color: #334155;
    border-color: #94a3b8;
}

.sg-btn-outline-danger {
    background: transparent;
    color: #c53030;
    border-color: #fca5a5;
}

.sg-btn-outline-danger:hover:not(:disabled) {
    background: #fff5f5;
    color: #9b2c2c;
    border-color: #f87171;
}

.sg-btn-outline-success {
    background: transparent;
    color: var(--ora-sand-dark);
    border-color: var(--ora-sand);
}

.sg-btn-outline-success:hover:not(:disabled) {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    border-color: var(--ora-sand-dark);
}

.sg-btn:disabled,
.sg-btn-sm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ============================
   Users Page Layout
   ============================ */
.sg-users-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sg-users-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2D2D2D;
    margin: 0;
}

.sg-users-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 18px;
    position: relative;
}

.sg-users-alert-error {
    background: var(--ora-silver-bg);
    color: var(--ora-charcoal);
    border: 1px solid var(--ora-silver-soft);
}

.sg-users-alert-success {
    background: var(--ora-sand-soft);
    color: var(--ora-charcoal);
    border: 1px solid var(--ora-sand-mid);
}

.sg-users-alert span {
    flex: 1;
}

.sg-users-alert-close {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 2px;
    line-height: 1;
}

.sg-users-alert-close:hover {
    opacity: 1;
}

/* ============================
   Toast Notifications
   ============================ */
.sg-toast-container {
    position: fixed;
    top: 20px;
    inset-inline-end: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}

.sg-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(45,45,45,0.18);
    font-size: 0.875rem;
    animation: sg-toast-in 0.25s ease-out;
}

.sg-toast-success {
    background: var(--ora-sand-dark);
    color: var(--ora-white);
    border: 1px solid var(--ora-sand-dark);
}

.sg-toast-error {
    background: #fde2e2;
    color: #b42318;
    border: 1px solid #f5b8b8;
}

.sg-toast span {
    flex: 1;
}

.sg-toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.sg-toast-close:hover {
    opacity: 1;
}

@keyframes sg-toast-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   Form Card
   ============================ */
.sg-form-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    border-left: 4px solid var(--ora-sand);
    overflow: hidden;
    margin-bottom: 20px;
}

.sg-form-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2D2D2D;
    background: #f8fafc;
    border-bottom: 1px solid #e9eef5;
}

.sg-form-card-body {
    padding: 20px 24px 24px;
}

.sg-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.sg-users-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.84rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sg-users-hint {
    font-size: 0.77rem;
    font-weight: 400;
    color: #94a3b8;
}

.sg-projects-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.sg-projects-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
}

/* ============================
   Assign Projects Page
   ============================ */
.sg-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ora-sand-dark);
    cursor: pointer;
}

.sg-back-link:hover {
    color: var(--ora-charcoal);
    text-decoration: underline;
}

.sg-project-pick-toolbar {
    display: flex;
    gap: 14px;
    margin-bottom: 12px;
}

.sg-link-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ora-sand-dark);
    cursor: pointer;
}

.sg-link-btn:hover {
    color: var(--ora-charcoal);
    text-decoration: underline;
}

.sg-project-pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.sg-project-pick {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sg-project-pick:hover {
    border-color: var(--ora-sand);
    box-shadow: 0 2px 8px rgba(45,45,45,0.06);
}

.sg-project-pick-selected {
    border-color: var(--ora-sand-dark);
    background: var(--ora-sand-soft);
}

.sg-project-pick-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sg-project-pick-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.sg-project-pick-check {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sg-project-pick-selected .sg-project-pick-check {
    background: var(--ora-sand-dark);
    border-color: var(--ora-sand-dark);
    color: #fff;
}

/* ============================
   Users Table
   ============================ */
.sg-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.sg-users-table thead tr {
    background: #f8fafc;
    border-bottom: 2px solid #e9eef5;
}

.sg-users-table th {
    padding: 12px 20px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: start;
}

.sg-th-actions {
    text-align: end !important;
}

.sg-users-table td {
    padding: 13px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e293b;
}

.sg-users-table tbody tr:last-child td {
    border-bottom: none;
}

.sg-users-table tbody tr:hover {
    background: #fafafa;
}

.sg-td-actions {
    text-align: end;
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.sg-users-username {
    font-weight: 600;
    color: #2D2D2D;
    font-size: 0.9rem;
}

.sg-users-empty {
    text-align: center;
    color: #94a3b8;
    padding: 32px 20px;
    font-size: 0.88rem;
}

/* ============================
   Projects Table
   ============================ */
.sg-projects-table tbody tr {
    transition: background 0.15s;
}

.sg-project-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sg-project-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--ora-charcoal), var(--ora-sand));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sg-project-name-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sg-project-name {
    font-weight: 600;
    color: #2D2D2D;
    font-size: 0.92rem;
}

.sg-project-name-ar {
    font-size: 0.8rem;
    color: #64748b;
}

.sg-project-sfid {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8rem;
    color: var(--ora-sand-dark);
    background: var(--ora-sand-soft);
    border: 1px solid var(--ora-sand-mid);
    padding: 3px 9px;
    border-radius: 6px;
}

/* ============================
   Role & Status Badges
   ============================ */
.sg-role-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sg-role-superadmin {
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    border: 1px solid var(--ora-sand-mid);
}

.sg-role-admin {
    background: var(--ora-charcoal);
    color: #fff;
}

.sg-role-guard {
    background: #e2e8f0;
    color: #475569;
}

.sg-status-active-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--ora-sand-soft);
    color: var(--ora-sand-dark);
    border: 1px solid var(--ora-sand-mid);
}

/* ============================
   Pagination
   ============================ */
.sg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0 4px;
    flex-wrap: wrap;
}

.sg-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sg-page-btn:hover:not(:disabled):not(.sg-page-active) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.sg-page-btn.sg-page-active {
    background: var(--ora-charcoal);
    color: #fff;
    border-color: var(--ora-charcoal);
}

.sg-page-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
}

/* ============================
   Language Toggle
   ============================ */
.sg-lang-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    margin-right: 10px;
}

.sg-lang-btn {
    background: none;
    border: none;
    padding: 3px 11px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

.sg-lang-btn.sg-lang-active {
    background: #fff;
    color: var(--ora-charcoal);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.sg-lang-btn:hover:not(.sg-lang-active) {
    color: #334155;
    background: rgba(255,255,255,0.6);
}

/* Login page lang toggle (above the card) */
.sg-login-lang {
    display: flex;
    justify-content: flex-end;
    gap: 2px;
    margin-bottom: 16px;
    background: rgba(0,0,0,0.12);
    border-radius: 8px;
    padding: 3px;
    width: fit-content;
    margin-left: auto;
}

.sg-login-lang .sg-lang-btn {
    color: rgba(255,255,255,0.6);
}

.sg-login-lang .sg-lang-btn.sg-lang-active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    box-shadow: none;
}

/* ============================
   Sidebar Container & Hamburger
   ============================ */
.sg-sidebar-container {
    flex-shrink: 0;
    display: flex;
}

.sg-sidebar-backdrop {
    display: none;
}

.sg-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    margin-right: 10px;
    transition: background 0.15s;
}

.sg-hamburger:hover {
    background: #f1f5f9;
}

.sg-topbar-left {
    display: flex;
    align-items: center;
}

/* ============================
   Tablet (641px – 1024px): icon-only sidebar
   ============================ */
@media (min-width: 641px) and (max-width: 1024px) {
    .sg-sidebar {
        width: 64px;
        min-width: 64px;
    }

    .sg-sidebar-brand {
        justify-content: center;
        padding: 22px 0;
        border-left: none;
        gap: 0;
    }

    .sg-brand-logo {
        width: 36px;
    }

    .sg-nav-link {
        justify-content: center;
        padding: 14px 0;
        gap: 0;
    }

    .sg-nav-label {
        display: none;
    }

    .sg-sidebar-footer {
        padding: 12px 0;
        text-align: center;
    }

    .sg-suggestion-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================
   Mobile (≤ 640px): overlay sidebar
   ============================ */
@media (max-width: 640px) {
    .sg-hamburger {
        display: flex;
    }

    .sg-sidebar-container {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 220px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 200;
    }

    .sg-sidebar-container.sg-sidebar-mobile-open {
        transform: translateX(0);
    }

    .sg-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 199;
    }

    .sg-sidebar {
        height: 100%;
        width: 220px;
        min-width: 220px;
    }

    .sg-topbar {
        padding: 0 16px;
    }

    .sg-content {
        padding: 16px;
    }

    .sg-search-card {
        padding: 20px 16px;
    }

    .sg-search-row {
        flex-direction: column;
        max-width: 100%;
    }

    .sg-search-project {
        flex: 0 0 auto;
    }

    .sg-search-btn {
        width: 100%;
        justify-content: center;
    }

    .sg-guests-table th,
    .sg-guests-table td {
        padding: 8px 10px;
    }

    .sg-tab-btn {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .sg-card-body,
    .sg-card-header {
        padding: 14px 16px;
    }

    .sg-tabs-panel {
        padding: 16px;
    }
}

/* ============================
   RTL Support
   ============================ */
[dir="rtl"] .sg-sidebar {
    border-left: none;
    border-right: 2px solid rgba(0,0,0,0.12);
}

[dir="rtl"] .sg-sidebar-brand {
    border-left: none;
    border-right: 3px solid var(--ora-sand);
    padding-left: 20px;
    padding-right: 17px;
}

[dir="rtl"] .sg-nav-link.active {
    border-left: none;
    border-right: 3px solid var(--ora-sand);
}

[dir="rtl"] .sg-search-card {
    border-left: none;
    border-right: 4px solid var(--ora-sand);
}

[dir="rtl"] .sg-cp-card-accent {
    background: linear-gradient(270deg, var(--ora-charcoal), var(--ora-sand));
}

[dir="rtl"] .sg-lang-toggle {
    margin-right: 0;
    margin-left: 10px;
}

[dir="rtl"] .sg-topbar-right {
    flex-direction: row-reverse;
}

[dir="rtl"] .sg-info-value {
    text-align: left;
}

[dir="rtl"] .sg-cp-divider::before,
[dir="rtl"] .sg-cp-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9eef5;
}

[dir="rtl"] body,
[dir="rtl"] .sg-search-title,
[dir="rtl"] .sg-card-header,
[dir="rtl"] .sg-cp-title {
    font-family: 'Segoe UI', 'Arial', Tahoma, sans-serif;
}

[dir="rtl"] .sg-tab-alert-dot {
    margin-left: 0;
    margin-right: -4px;
}

@media (max-width: 640px) {
    [dir="rtl"] .sg-sidebar-container {
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    [dir="rtl"] .sg-sidebar-container.sg-sidebar-mobile-open {
        transform: translateX(0);
    }

    [dir="rtl"] .sg-hamburger {
        margin-right: 0;
        margin-left: 10px;
    }

    .sg-unit-grid {
        grid-template-columns: 1fr;
    }

    .sg-pm-meta {
        flex-direction: column;
        gap: 4px;
    }

    .sg-suggestion-list {
        grid-template-columns: 1fr;
    }
}

[dir="rtl"] .sg-unit-accent {
    background: linear-gradient(270deg, var(--ora-charcoal), var(--ora-sand));
}

[dir="rtl"] .sg-pm-card {
    border-left: 1px solid #e9eef5;
    border-right: 3px solid var(--ora-sand);
}

@media (min-width: 641px) and (max-width: 1024px) {
    [dir="rtl"] .sg-sidebar-brand {
        border-right: none;
        padding-right: 0;
        padding-left: 0;
    }

    [dir="rtl"] .sg-nav-link.active {
        border-right: none;
    }
}

/* ============================
   Logs Page: Stat Cards
   ============================ */
.sg-stat-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.sg-stat-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sg-stat-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ora-charcoal), var(--ora-sand));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sg-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #2D2D2D;
    margin-top: 2px;
}

.sg-stat-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* ============================
   Logs Page: Filter Bar
   ============================ */
.sg-logs-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

.sg-logs-filter-row .form-control,
.sg-logs-filter-row .form-select {
    max-width: 280px;
}

/* ============================
   Logs Page: Result Badges
   ============================ */
.sg-status-failed-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #fde2e2;
    color: #b42318;
    border: 1px solid #f5b8b8;
}

/* ============================
   Logs Page: Search History Modal
   ============================ */
.sg-history-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 20px;
}

.sg-history-modal {
    background: #fff;
    border-radius: 12px;
    max-width: min(920px, 100%);
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sg-history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9eef5;
}

.sg-history-modal-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2D2D2D;
}

.sg-history-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.sg-history-section {
    margin-bottom: 22px;
}

.sg-history-section:last-child {
    margin-bottom: 0;
}

.sg-history-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2D2D2D;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e9eef5;
}

/* Fallback raw-JSON display, used only when a captured response can't be parsed into the expected shape. */
.sg-json-pre {
    background: #f8fafc;
    border: 1px solid #e9eef5;
    border-radius: 8px;
    padding: 14px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8rem;
    color: #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.sg-history-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #e9eef5;
    display: flex;
    justify-content: flex-end;
}

/* ============================
   Logs Page: User Search Dropdown
   ============================ */
.sg-user-filter-wrap {
    position: relative;
    flex: 1 1 auto;
    max-width: 280px;
}

.sg-dropdown-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: transparent;
}

.sg-user-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1045;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    max-height: 260px;
    overflow-y: auto;
}

.sg-user-dropdown-item {
    display: block;
    width: 100%;
    text-align: start;
    padding: 8px 12px;
    border: none;
    background: none;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
}

.sg-user-dropdown-item:hover {
    background: #f1f5f9;
}

.sg-user-dropdown-empty {
    padding: 10px 12px;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* ============================
   Logs Page: Pretty Touches
   ============================ */
.sg-users-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-logs-title-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--ora-charcoal), var(--ora-sand));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sg-logs-subtitle {
    margin: 2px 0 0;
    font-size: 0.83rem;
    color: #64748b;
}

.sg-history-modal-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
}

.sg-history-unit-card {
    margin-bottom: 16px;
}

.sg-stat-card {
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.sg-stat-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

.sg-stat-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.sg-stat-card-sand::before {
    background: var(--ora-sand);
}

.sg-stat-card-charcoal::before {
    background: var(--ora-charcoal);
}

.sg-logs-search-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    padding-inline-start: 34px;
}

.sg-logs-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.sg-logs-table tbody tr:hover {
    background: var(--ora-sand-soft);
}

.sg-logs-timestamp {
    color: #64748b;
    font-size: 0.86rem;
}

.sg-result-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.sg-logs-empty {
    text-align: center;
}

.sg-logs-empty svg {
    display: block;
    margin: 0 auto 8px;
}

/* Modal open animation */
@keyframes sg-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sg-modal-scale-in {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sg-history-modal-backdrop {
    animation: sg-modal-fade-in 0.15s ease-out;
}

.sg-history-modal {
    animation: sg-modal-scale-in 0.18s ease-out;
}

/* Tablet: let the filter fields flex to fill the row in twos/threes instead of
   staying pinned to their 280px desktop cap, which left awkward empty space. */
@media (min-width: 641px) and (max-width: 1024px) {
    .sg-logs-filter-row .form-control,
    .sg-logs-filter-row .form-select,
    .sg-user-filter-wrap {
        flex: 1 1 220px;
        max-width: none;
    }
}

@media (max-width: 640px) {
    .sg-stat-cards {
        grid-template-columns: 1fr;
    }

    /* Stack the filter bar into full-width, touch-friendly fields on phones. */
    .sg-logs-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-logs-filter-row .form-control,
    .sg-logs-filter-row .form-select,
    .sg-user-filter-wrap {
        max-width: 100%;
        width: 100%;
    }

    .sg-logs-filter-row .sg-btn {
        width: 100%;
    }

    /* Project/status are secondary details on a phone — drop them to keep the
       table from forcing a wide horizontal scroll for the columns that matter most. */
    .sg-logs-col-optional {
        display: none;
    }

    .sg-users-table.sg-logs-table th,
    .sg-users-table.sg-logs-table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .sg-logs-table .sg-td-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sg-logs-table .sg-td-actions .sg-btn {
        width: 100%;
    }

    /* Let the history popup use nearly the full screen instead of leaving big margins. */
    .sg-history-modal-backdrop {
        padding: 10px;
    }

    .sg-history-modal {
        max-height: 94vh;
    }

    .sg-history-modal-header,
    .sg-history-modal-footer {
        padding: 12px 16px;
    }

    .sg-history-modal-body {
        padding: 16px;
    }

    .sg-history-modal-title {
        font-size: 0.88rem;
    }

    .sg-history-modal-footer .sg-btn {
        width: 100%;
    }
}
