html.gorp-rtl,
html.gorp-rtl body,
html.gorp-rtl #layout {
    direction: rtl !important;
}

html.gorp-rtl #layout-menu {
    direction: rtl !important;
}

html.gorp-rtl #layout-menu.popover {
    left: auto !important;
    right: 0 !important;
}

html.gorp-rtl #layout-sidebar,
html.gorp-rtl #layout-list {
    border-right: 0 !important;
    border-left: 1px solid #d5d5d5 !important;
}

html.gorp-rtl #layout-sidebar.sidebar-right {
    border-left: 0 !important;
    border-right: 1px solid #d5d5d5 !important;
}

html.gorp-rtl .listing li > a,
html.gorp-rtl .listing tbody td,
html.gorp-rtl .formcontent,
html.gorp-rtl .propform,
html.gorp-rtl .boxcontent,
html.gorp-rtl .popupmenu,
html.gorp-rtl .menu {
    text-align: right !important;
}

html.gorp-rtl .toolbar,
html.gorp-rtl .formcontent .row,
html.gorp-rtl .propform .row {
    direction: rtl !important;
}

html.gorp-rtl #compose-content {
    direction: rtl !important;
}

html.gorp-rtl #compose-content label,
html.gorp-rtl .formcontent label,
html.gorp-rtl .propform label {
    text-align: right !important;
}

html.gorp-rtl #compose-footer,
html.gorp-rtl #compose-content .formbuttons {
    direction: rtl !important;
    text-align: right !important;
}

html.gorp-rtl input[name="_from"],
html.gorp-rtl input[name="_to"],
html.gorp-rtl input[name="_cc"],
html.gorp-rtl input[name="_bcc"],
html.gorp-rtl input[type="email"],
html.gorp-rtl .recipient-input input,
html.gorp-rtl #rcmloginuser,
html.gorp-rtl #rcmloginpwd {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext !important;
}

html.gorp-rtl input[name="_subject"],
html.gorp-rtl textarea[name="_message"],
html.gorp-rtl #composebody {
    text-align: start !important;
    unicode-bidi: plaintext !important;
}

html.gorp-rtl code,
html.gorp-rtl pre,
html.gorp-rtl .email,
html.gorp-rtl .address {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

html.gorp-rtl table {
    direction: rtl;
}

#gorp-compose-direction-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    margin: 8px 0 !important;
    padding: 8px 10px !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 46px !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 10 !important;
    flex-wrap: wrap !important;
    clear: both !important;
    direction: rtl !important;
    background: #f5f7f8 !important;
    border: 1px solid #d6dde1 !important;
    border-radius: 5px !important;
    font-family: Tahoma, Arial, sans-serif !important;
    font-size: 13px !important;
}

#gorp-compose-direction-toolbar .gorp-direction-title {
    margin-inline-end: 3px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
}

#gorp-compose-direction-toolbar button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 90px !important;
    height: 32px !important;
    padding: 6px 10px !important;
    line-height: 1.2 !important;
    border: 1px solid #aebbc3 !important;
    border-radius: 4px !important;
    background: #fff !important;
    color: #263238 !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

#gorp-compose-direction-toolbar button:hover {
    background: #e9f5fc !important;
    border-color: #37beff !important;
}

#gorp-compose-direction-toolbar button.gorp-active-direction {
    background: #37beff !important;
    border-color: #21aeea !important;
    color: #fff !important;
}

#gorp-compose-direction-toolbar .gorp-direction-note {
    margin-inline-start: 6px !important;
    color: #66757f !important;
    font-size: 12px !important;
}

@media (max-width: 600px) {
    #gorp-compose-direction-toolbar button {
        min-width: 74px !important;
    }

    #gorp-compose-direction-toolbar .gorp-direction-note {
        width: 100%;
        margin-inline-start: 0 !important;
    }
}

/* GORP COMPOSE OVERFLOW FIX V0.3.1 */

/*
 * Prevent the compose form from extending underneath the fixed task menu
 * after the Roundcube interface is mirrored to RTL.
 */
html.gorp-rtl.gorp-compose-page #layout-content,
html.gorp-rtl.gorp-compose-page #compose-content,
html.gorp-rtl.gorp-compose-page #compose-content > form,
html.gorp-rtl.gorp-compose-page #compose-content .formcontent,
html.gorp-rtl.gorp-compose-page #composebodycontainer {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html.gorp-rtl.gorp-compose-page #layout-content {
    overflow-x: hidden !important;
}

html.gorp-rtl.gorp-compose-page #compose-content {
    width: auto !important;
    overflow-x: hidden !important;
}

html.gorp-rtl.gorp-compose-page #composebodycontainer,
html.gorp-rtl.gorp-compose-page #composebody,
html.gorp-rtl.gorp-compose-page textarea#composebody,
html.gorp-rtl.gorp-compose-page #gorp-compose-direction-toolbar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
}

html.gorp-rtl.gorp-compose-page #composebody {
    display: block !important;
}

/* GORP COMPOSE WIDTH FIX V0.3.1 */

/*
 * Roundcube Elastic uses a flex layout.
 * On the mirrored compose screen the content area must be allowed
 * to shrink inside the space between the attachment sidebar
 * and the task menu.
 */
html.gorp-rtl.gorp-compose-page #layout-content {
    flex: 6 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow-x: hidden !important;
}

html.gorp-rtl.gorp-compose-page #compose-content,
html.gorp-rtl.gorp-compose-page #compose-content > form,
html.gorp-rtl.gorp-compose-page #compose-content .formcontent,
html.gorp-rtl.gorp-compose-page #compose-headers,
html.gorp-rtl.gorp-compose-page #composebodycontainer {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

html.gorp-rtl.gorp-compose-page #gorp-compose-direction-toolbar {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    box-sizing: border-box !important;
}

html.gorp-rtl.gorp-compose-page #composebody,
html.gorp-rtl.gorp-compose-page textarea#composebody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
    box-sizing: border-box !important;
}


/* GORP LOGIN BACKGROUND START */
body.task-login,
body.task-login #layout,
body.task-login #layout-content {
    background: linear-gradient(180deg, #F7F9FC 0%, #EEF4FA 100%) !important;
}

body.task-login #login-form {
    background: transparent !important;
}

body.task-login #logo {
    filter: drop-shadow(0 2px 8px rgba(20, 60, 110, 0.08));
}
/* GORP LOGIN BACKGROUND END */

/* GORP OIL LOGIN BACKGROUND START */
body.task-login,
body.task-login #layout,
body.task-login #layout-content {
    background-color: #f7f9fc !important;
    background-image:
        linear-gradient(
            rgba(248, 250, 253, 0.76),
            rgba(248, 250, 253, 0.76)
        ),
        url("/gorp-login-bg.png?v=20260730") !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* لوگوی اصلی Roundcube/GORP بدون تغییر باقی می‌ماند */
body.task-login #logo {
    position: relative;
    z-index: 2;
}
/* GORP OIL LOGIN BACKGROUND END */

/* GORP MINIMAL OIL BACKGROUND */
body.task-login,
body.task-login #layout,
body.task-login #layout-content {
    background:
        linear-gradient(rgba(255,255,255,.18), rgba(247,250,253,.28)),
        url("/plugins/gorp_rtl/login-oil-bg.png") center center / cover no-repeat fixed !important;
    min-height: 100vh !important;
}

/* FORCE GORP LOGIN BACKGROUND */
body.task-login {
    background: url("/plugins/gorp_rtl/login-oil-bg.png?v=1784735039") center center / cover no-repeat fixed !important;
}

body.task-login #layout,
body.task-login #layout-content {
    background: transparent !important;
}

/* FINAL GORP LOGIN BACKGROUND */
html:has(#login-form),
body:has(#login-form),
body:has(#login-form) #layout,
body:has(#login-form) #layout-content {
    background: url("/gorp-login-bg.png?v=20260730") center center / cover no-repeat fixed !important;
}





