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

/* Smart Station ERP — independent enterprise theme */
:root {
    --ss-primary: #1a365d;
    --ss-primary-dark: #122744;
    --ss-primary-soft: #2b4f7a;
    --ss-accent: #b7791f;
    --ss-accent-soft: #d69e2e;
    --ss-success: #047857;
    --ss-success-soft: #059669;
    --ss-gray: #64748b;
    --ss-bg: #f1f5f9;
    --ss-card: #ffffff;
    --ss-border: #e2e8f0;
    --ss-text: #0f172a;
    --ss-muted: #64748b;
    --ss-danger: #c53030;
    --ss-warning: #c05621;
    --ss-sidebar: #0f172a;
}

html {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    color: var(--ss-text);
}

.fi-body,
.fi-main,
.fi-main-ctn,
.fi-page,
.fi-simple-page {
    direction: rtl;
    background: var(--ss-bg) !important;
    color-scheme: light;
}

html.dark .fi-body,
html.dark .fi-main,
.dark .fi-body,
.dark .fi-main {
    background: var(--ss-bg) !important;
    color: var(--ss-text) !important;
}

.fi-sidebar-nav,
.fi-main,
.fi-header,
.fi-ta-table,
.fi-fo-field-wrp-label,
.fi-wi-stats-overview-stat,
.fi-btn,
.fi-sidebar-item-label,
.ss-modules * {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

/* ===== Sidebar ===== */
.fi-sidebar {
    background: var(--ss-sidebar) !important;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
}

.fi-sidebar .fi-sidebar-header {
    background: var(--ss-primary) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 4.25rem;
    padding-inline: 1rem !important;
}

.fi-sidebar .fi-logo,
.fi-sidebar .fi-sidebar-header .fi-logo,
.fi-sidebar .fi-sidebar-header a {
    color: #fff !important;
    font-weight: 500 !important;
    font-size: 1.12rem !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
}

.fi-sidebar .ss-sidebar-welcome {
    display: inline-flex !important;
    align-items: center;
    gap: 0.7rem;
    max-width: 100%;
    min-width: 0;
}

.fi-sidebar .ss-sidebar-welcome .fi-avatar,
.fi-sidebar .ss-sidebar-welcome .fi-user-avatar {
    width: 2.35rem !important;
    height: 2.35rem !important;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.fi-sidebar .ss-sidebar-welcome__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.25;
}

.fi-sidebar .ss-sidebar-welcome__hello {
    font-size: 0.78rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.82) !important;
    white-space: nowrap;
}

.fi-sidebar .ss-sidebar-welcome__name {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
}

.fi-sidebar-nav {
    padding-block: 0.65rem 1rem !important;
}

.fi-sidebar .fi-sidebar-group {
    margin-bottom: 0.2rem !important;
}

.fi-sidebar .fi-sidebar-group-button {
    min-height: 2.75rem !important;
    padding-block: 0.55rem !important;
    padding-inline: 0.9rem !important;
    margin-inline: 0.35rem !important;
    border-radius: 0.5rem !important;
    gap: 0.65rem !important;
}

.fi-sidebar .fi-sidebar-group-button:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

.fi-sidebar .fi-sidebar-group-label,
.fi-sidebar span.fi-sidebar-group-label {
    color: #ffffff !important;
    font-size: 1.12rem !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.fi-sidebar .fi-sidebar-group-icon,
.fi-sidebar .fi-sidebar-group-collapse-button {
    color: rgba(255, 255, 255, 0.75) !important;
    width: 1.35rem !important;
    height: 1.35rem !important;
}

.fi-sidebar .fi-sidebar-group-items {
    gap: 0.1rem !important;
    padding-bottom: 0.35rem !important;
}

.fi-sidebar .fi-sidebar-item {
    margin-bottom: 0 !important;
}

.fi-sidebar .fi-sidebar-item-button {
    border-radius: 0.5rem !important;
    margin-inline: 0.45rem !important;
    min-height: 2.55rem !important;
    padding-block: 0.5rem !important;
    padding-inline: 0.8rem !important;
    gap: 0.7rem !important;
    align-items: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.fi-sidebar .fi-sidebar-item-label,
.fi-sidebar span.fi-sidebar-item-label {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 1.05rem !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* عند طي القائمة: شريط أيقونات ثابت بدون دفع المحتوى للجانب */
@media (min-width: 1024px) {
    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) {
        width: var(--collapsed-sidebar-width, 4.5rem) !important;
        max-width: var(--collapsed-sidebar-width, 4.5rem) !important;
        overflow-x: hidden !important;
    }

    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .ss-copyright--sidebar,
    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .ss-sidebar-welcome__text {
        display: none !important;
    }

    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .fi-sidebar-nav {
        padding-inline: 0.35rem !important;
        overflow-x: hidden !important;
    }

    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .fi-sidebar-item-button,
    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .fi-sidebar-group-button {
        justify-content: center !important;
        margin-inline: 0.15rem !important;
        padding-inline: 0.45rem !important;
    }

    .fi-sidebar.fi-main-sidebar:not(.fi-sidebar-open) .fi-sidebar-header {
        padding-inline: 0.35rem !important;
        justify-content: center;
    }
}

.fi-sidebar .fi-sidebar-item-icon {
    color: rgba(255, 255, 255, 0.82) !important;
    width: 1.4rem !important;
    height: 1.4rem !important;
    flex-shrink: 0;
}

.fi-sidebar .fi-sidebar-item-icon svg {
    width: 1.4rem !important;
    height: 1.4rem !important;
}

.fi-sidebar .fi-sidebar-item-button:hover {
    background: rgba(26, 54, 93, 0.55) !important;
}

.fi-sidebar .fi-sidebar-item-button:hover .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-button:hover .fi-sidebar-item-icon {
    color: #ffffff !important;
}

.fi-sidebar .fi-sidebar-item-active .fi-sidebar-item-button,
.fi-sidebar .fi-sidebar-item-button[aria-current='page'] {
    background: var(--ss-primary) !important;
    box-shadow: none;
    border-inline-start: 3px solid var(--ss-accent-soft);
}

.fi-sidebar .fi-sidebar-item-active .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-button[aria-current='page'] .fi-sidebar-item-label,
.fi-sidebar .fi-sidebar-item-active .fi-sidebar-item-icon,
.fi-sidebar .fi-sidebar-item-button[aria-current='page'] .fi-sidebar-item-icon {
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* ===== Topbar ===== */
.fi-topbar,
.fi-topbar > nav,
.fi-topbar nav.flex {
    background: var(--ss-primary) !important;
    background-color: var(--ss-primary) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    --tw-ring-color: transparent !important;
}

.fi-topbar,
.fi-topbar * {
    color: #fff !important;
}

.fi-topbar .fi-icon-btn,
.fi-topbar button,
.fi-topbar a {
    color: #fff !important;
}

.fi-topbar .fi-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}

.ss-topbar-welcome {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.3rem 0.9rem 0.3rem 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    max-width: min(16rem, 42vw);
    position: relative;
    z-index: 30;
}

.ss-topbar-welcome .fi-avatar,
.ss-topbar-welcome .fi-user-avatar {
    width: 2.25rem !important;
    height: 2.25rem !important;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.ss-topbar-welcome__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.25;
}

.ss-topbar-welcome__hello {
    font-size: 0.8rem !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    white-space: nowrap;
}

.ss-topbar-welcome__name {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 11rem;
}

.ss-user-bar {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ss-user-account-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ss-user-account-btn:hover {
    background: rgba(255, 255, 255, 0.22) !important;
}

.ss-logout-form {
    margin: 0;
    display: inline-flex;
}

.ss-logout-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 0.35rem;
    height: 2.15rem;
    padding: 0 0.75rem !important;
    border-radius: 999px !important;
    background: rgba(197, 48, 48, 0.28) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    font-family: 'Cairo', 'Segoe UI', sans-serif !important;
}

.ss-logout-btn:hover {
    background: rgba(197, 48, 48, 0.5) !important;
}

.ss-logout-btn__icon {
    width: 1.05rem;
    height: 1.05rem;
}

.ss-user-menu-dropdown-header {
    padding: 0.15rem 0;
}

.ss-user-menu-dropdown-header__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ss-user-menu-dropdown-header__hello {
    font-size: 0.95rem;
    font-weight: 500;
    color: #212529 !important;
}

.ss-user-menu-dropdown-header__email {
    font-size: 0.8rem;
    font-weight: 400;
    color: #6c757d !important;
}

.fi-dropdown-panel .ss-user-menu-dropdown-header__hello {
    color: #212529 !important;
}

.fi-dropdown-panel .ss-user-menu-dropdown-header__email {
    color: #6c757d !important;
}

@media (max-width: 640px) {
    .ss-topbar-welcome__name {
        max-width: 6.5rem;
        font-size: 0.9rem !important;
    }

    .ss-logout-btn__label {
        display: none;
    }

    .ss-logout-btn {
        width: 2.15rem;
        padding: 0 !important;
        justify-content: center;
    }
}

/* ===== Content cards / tables ===== */
.fi-section,
.fi-wi-stats-overview-stat,
.fi-ta-ctn,
.fi-fo-component-ctn {
    border-radius: 0.45rem !important;
}

.fi-wi-stats-overview-stat {
    background: var(--ss-card) !important;
    border: 1px solid var(--ss-border) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.fi-wi-stats-overview-stat-value {
    color: var(--ss-primary) !important;
    font-weight: 700;
}

.fi-wi-stats-overview-stat-label {
    color: var(--ss-muted) !important;
}

.fi-ta-ctn,
.fi-section:not(.fi-collapsed) > .fi-section-content-ctn {
    border: 1px solid var(--ss-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    background: #fff;
}

.fi-ta-header-cell {
    background: #f8fafc !important;
    color: var(--ss-muted) !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    text-transform: uppercase;
}

/* ===== Buttons ===== */
.fi-btn-primary {
    background: var(--ss-primary) !important;
    border-color: var(--ss-primary) !important;
    box-shadow: none !important;
    border-radius: 0.35rem !important;
}

.fi-btn-primary:hover {
    background: var(--ss-primary-dark) !important;
    filter: none;
}

.fi-btn-success,
.fi-ac-btn-action[class*='success'] {
    background: var(--ss-success) !important;
}

/* ===== Badges ===== */
.fi-badge {
    border-radius: 0.25rem !important;
    font-weight: 600;
}

/* ===== Login (صفحات auth فقط — لا يمس لوحة التحكم) ===== */
.fi-simple-layout {
    position: relative;
    isolation: isolate;
    min-height: 100dvh;
    background: #0b1220 !important;
}

.fi-simple-layout .fi-simple-page {
    background: transparent !important;
}

.fi-simple-header,
.fi-simple-header-heading,
.fi-simple-header-subheading {
    display: none !important;
}

/* لوحة العلامة — تظهر كاملة على الكمبيوتر */
.ss-login-hero {
    display: none;
}

.ss-login-brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: right;
    gap: 0.35rem;
    margin: 0 0 1.75rem;
}

.ss-login-brand__mobile-mark {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.9rem;
    display: grid;
    place-items: center;
    margin-bottom: 0.65rem;
    background: linear-gradient(145deg, #122744, #1a365d);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.ss-login-brand__mobile-mark .ss-login-brand__logo {
    max-width: 2.4rem;
    max-height: 2.4rem;
    object-fit: contain;
}

.ss-login-brand__mark-inner {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.ss-login-brand__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b7791f;
}

.ss-login-brand__title {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.ss-login-brand__subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    line-height: 1.5;
}

.fi-simple-main-ctn {
    padding: 1.25rem;
    width: 100%;
}

.fi-simple-main {
    position: relative;
    width: 100% !important;
    max-width: 26rem !important;
    margin-block: 0 !important;
    padding: 1.85rem 1.5rem !important;
    background: #ffffff !important;
    border-radius: 1.1rem !important;
    border: none !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
    overflow: hidden;
}

.fi-simple-main::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline: 0;
    height: 3px;
    background: linear-gradient(90deg, #1a365d, #b7791f, #2b6cb0);
}

.fi-simple-page .fi-fo-field-wrp {
    gap: 0.4rem !important;
}

.fi-simple-page .fi-fo-field-wrp-label span {
    font-family: 'Cairo', 'Segoe UI', sans-serif !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.9rem !important;
}

.fi-simple-page .fi-input-wrp {
    border-radius: 0.7rem !important;
    border-color: #e2e8f0 !important;
    background: #f8fafc !important;
    box-shadow: none !important;
    min-height: 2.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fi-simple-page .fi-input-wrp:focus-within {
    border-color: #1a365d !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(26, 54, 93, 0.1) !important;
}

.fi-simple-page .fi-btn-primary {
    width: 100%;
    margin-top: 0.35rem;
    background: linear-gradient(180deg, #234e7a 0%, #1a365d 100%) !important;
    border-color: #122744 !important;
    border-radius: 0.7rem !important;
    font-weight: 700 !important;
    font-size: 0.98rem !important;
    min-height: 3rem;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 24px rgba(26, 54, 93, 0.3) !important;
}

.fi-simple-page .fi-btn-primary:hover {
    background: linear-gradient(180deg, #1a365d 0%, #122744 100%) !important;
    filter: none;
}

.fi-simple-page .ss-copyright--login {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eef2f7;
    color: #94a3b8;
    font-size: 0.7rem;
}

/* ===== كمبيوتر: شاشة مقسومة احترافية ===== */
@media (min-width: 1024px) {
    .fi-simple-layout {
        background: #f4f7fb !important;
        padding-inline-start: min(52vw, 38rem) !important;
    }

    .fi-simple-main-ctn {
        min-height: 100dvh;
        padding: 2.5rem !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .fi-simple-main {
        max-width: 27rem !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 2.6rem 2.4rem !important;
        border-radius: 1.15rem !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08) !important;
        background: #fff !important;
    }

    .ss-login-hero {
        display: flex;
        position: fixed;
        z-index: 5;
        inset-block: 0;
        inset-inline-start: 0;
        width: min(52vw, 38rem);
        align-items: center;
        justify-content: center;
        padding: 3.5rem 3.25rem;
        overflow: hidden;
        background:
            radial-gradient(ellipse 70% 55% at 20% 15%, rgba(183, 121, 31, 0.22), transparent 55%),
            radial-gradient(ellipse 60% 50% at 90% 90%, rgba(43, 111, 176, 0.2), transparent 50%),
            linear-gradient(155deg, #0b1220 0%, #122744 48%, #1a365d 100%);
        color: #fff;
        border-inline-end: 1px solid rgba(255, 255, 255, 0.06);
    }

    .ss-login-hero__glow {
        position: absolute;
        inset: auto -20% -25% auto;
        width: 28rem;
        height: 28rem;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(183, 121, 31, 0.2), transparent 65%);
        pointer-events: none;
    }

    .ss-login-hero__content {
        position: relative;
        z-index: 1;
        max-width: 26rem;
        width: 100%;
    }

    .ss-login-hero__badge {
        display: inline-flex;
        align-items: center;
        margin-bottom: 1.5rem;
        padding: 0.35rem 0.75rem;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: #f6e05e;
        background: rgba(183, 121, 31, 0.18);
        border: 1px solid rgba(183, 121, 31, 0.35);
    }

    .ss-login-hero__logo-wrap,
    .ss-login-hero__mark {
        width: 5rem;
        height: 5rem;
        border-radius: 1.15rem;
        display: grid;
        place-items: center;
        margin-bottom: 1.35rem;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.14);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
        overflow: hidden;
    }

    .ss-login-hero__logo {
        max-width: 3.4rem;
        max-height: 3.4rem;
        object-fit: contain;
    }

    .ss-login-hero__mark span {
        font-family: 'Cairo', 'Segoe UI', sans-serif;
        font-size: 1.75rem;
        font-weight: 700;
        color: #fff;
    }

    .ss-login-hero__title {
        margin: 0 0 0.85rem;
        font-family: 'Cairo', 'Segoe UI', sans-serif;
        font-size: clamp(1.8rem, 2.4vw, 2.35rem);
        font-weight: 700;
        line-height: 1.25;
        color: #fff;
    }

    .ss-login-hero__lead {
        margin: 0 0 1.75rem;
        font-size: 1.02rem;
        line-height: 1.7;
        color: rgba(255, 255, 255, 0.78);
        max-width: 24rem;
    }

    .ss-login-hero__points {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 0.7rem;
    }

    .ss-login-hero__points li {
        position: relative;
        padding-inline-start: 1.45rem;
        font-size: 0.95rem;
        color: rgba(255, 255, 255, 0.9);
        line-height: 1.45;
    }

    .ss-login-hero__points li::before {
        content: '';
        position: absolute;
        inset-inline-start: 0;
        top: 0.45rem;
        width: 0.55rem;
        height: 0.55rem;
        border-radius: 999px;
        background: #b7791f;
        box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.25);
    }

    .ss-login-hero__meta {
        margin-top: 2rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.65);
    }

    .ss-login-brand__mobile-mark {
        display: none;
    }

    .ss-login-brand__title {
        font-size: 1.7rem;
    }

    .ss-login-brand__subtitle {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    /* إخفاء فوتر الصفحة العام في شاشة الدخول فقط */
    .fi-simple-layout .ss-copyright--page {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fi-simple-page .fi-input-wrp,
    .fi-simple-page .fi-btn-primary {
        transition: none !important;
    }
}

/* ===== Modules dashboard ===== */
.ss-modules {
    margin-bottom: 1.5rem;
}

.ss-modules__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ss-text);
    margin-bottom: 1rem;
}

.ss-modules__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.ss-module {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 0.55rem;
    border-radius: 0.65rem;
    background: var(--ss-card);
    border: 1px solid var(--ss-border);
    text-decoration: none !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ss-module:hover {
    border-color: rgba(26, 54, 93, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.ss-module__icon {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.ss-module__icon svg {
    width: 32px;
    height: 32px;
}

.ss-module__label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ss-text);
    text-align: center;
    line-height: 1.25;
}

.ss-module--sales .ss-module__icon { background: linear-gradient(145deg, #1a365d, #2b6cb0); }
.ss-module--purchase .ss-module__icon { background: linear-gradient(145deg, #234e52, #319795); }
.ss-module--inventory .ss-module__icon { background: linear-gradient(145deg, #2c5282, #4299e1); }
.ss-module--accounting .ss-module__icon { background: linear-gradient(145deg, #276749, #38a169); }
.ss-module--treasury .ss-module__icon { background: linear-gradient(145deg, #975a16, #d69e2e); }
.ss-module--projects .ss-module__icon { background: linear-gradient(145deg, #9c4221, #dd6b20); }
.ss-module--reports .ss-module__icon { background: linear-gradient(145deg, #2a4365, #3182ce); }
.ss-module--settings .ss-module__icon { background: linear-gradient(145deg, #4a5568, #718096); }
.ss-module--customers .ss-module__icon { background: linear-gradient(145deg, #2c5282, #63b3ed); }
.ss-module--serials .ss-module__icon { background: linear-gradient(145deg, #285e61, #38b2ac); }
.ss-module--hr .ss-module__icon { background: linear-gradient(145deg, #553c9a, #805ad5); }
.ss-module--tasks .ss-module__icon { background: linear-gradient(145deg, #1a365d, #4a5568); }

.ss-stats-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0.5rem 0 0.75rem;
    color: var(--ss-muted);
}

/* Copyright */
.ss-copyright {
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    text-align: center;
    line-height: 1.45;
}

.ss-copyright--sidebar {
    margin: 0.35rem 0.75rem 0.9rem;
    padding: 0.55rem 0.5rem;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ss-copyright--login {
    margin-top: 1.25rem;
    font-size: 0.75rem;
    color: #6c757d;
}

.ss-copyright--page {
    margin-top: auto;
    padding: 4rem 1rem 2.5rem;
    font-size: 0.72rem;
    color: #8f8f8f;
}

/* ادفع حقوق النشر لأسفل الواجهة */
.fi-main-ctn {
    min-height: 100dvh;
    display: flex !important;
    flex-direction: column !important;
}

.fi-main-ctn > .fi-main {
    flex: 1 1 auto;
}

/* ===== Mobile only (لا يمس شاشة الكمبيوتر) ===== */
@media (max-width: 1023px) {
    .fi-main {
        padding-inline: 0.75rem !important;
    }

    .fi-header-heading {
        font-size: 1.15rem !important;
        line-height: 1.35 !important;
    }

    .ss-modules__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .ss-module {
        padding: 0.7rem 0.35rem !important;
        gap: 0.45rem !important;
    }

    .ss-module__icon {
        width: 48px !important;
        height: 48px !important;
        border-radius: 0.75rem !important;
    }

    .ss-module__icon svg {
        width: 24px !important;
        height: 24px !important;
    }

    .ss-module__label {
        font-size: 0.72rem !important;
    }

    .ss-stats-title {
        font-size: 0.95rem !important;
        margin-top: 0.25rem !important;
    }

    .fi-wi-stats-overview-stat {
        min-height: auto !important;
    }

    .fi-wi-stats-overview-stat-value {
        font-size: 1.05rem !important;
    }

    /* جداول: تمرير أفقي بدون قص */
    .fi-ta-ctn,
    .fi-ta-content,
    .fi-ta-table-ctn {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    .fi-ta-table {
        min-width: 640px;
    }

    /* نماذج: مسافات أوضح للمس */
    .fi-fo-field-wrp {
        margin-block: 0.15rem !important;
    }

    .fi-input,
    .fi-select-input,
    .fi-ta-search-field input,
    textarea.fi-input {
        min-height: 2.6rem !important;
        font-size: 16px !important; /* يمنع تكبير iOS التلقائي */
    }

    .fi-btn {
        min-height: 2.55rem !important;
    }

    .fi-dropdown-panel,
    .fi-modal-window {
        max-width: calc(100vw - 1rem) !important;
    }

    .fi-modal-content {
        max-height: min(85dvh, 100%) !important;
    }

    /* مكررات الفواتير: لا تفيض عن الشاشة */
    .fi-fo-repeater-item {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .fi-topbar nav {
        gap: 0.35rem !important;
        padding-inline: 0.5rem !important;
    }

    .ss-topbar-welcome__name {
        max-width: 7rem !important;
    }

    .ss-copyright--page {
        padding: 2.5rem 0.75rem 1.75rem !important;
    }

    .fi-simple-main {
        margin-inline: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
        padding: 1.75rem 1.25rem !important;
    }

    .ss-login-brand__title {
        font-size: 1.15rem !important;
    }

    .ss-login-brand__subtitle {
        font-size: 0.78rem !important;
        padding-inline: 0.35rem;
    }
}

@media (max-width: 480px) {
    .ss-modules__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* شريط التصفية أعلى الجداول — موحّد مع سجل الحركة */
.fi-ta-filters {
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ss-border);
    border-radius: 0.75rem;
    background: #f8fafc;
}

.fi-ta-filters .fi-fo-field-wrp-label span {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
}

.fi-ta-filters-actions .fi-btn {
    min-height: 2.4rem;
}
