/* =========================================================
   DeutschLernen - Global UI
   RTL content + LEFT sidebar
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================================
   ROOT
   ========================================================= */

:root {
    --primary: #7654d8;
    --primary-dark: #6543c7;
    --primary-light: #f0ecff;

    --bg: #f7f7fb;
    --surface: #ffffff;
    --border: #ececf3;

    --text: #25263a;
    --muted: #85879b;

    --success: #35a56a;
    --warning: #e7a83d;
    --danger: #d85d68;

    --sidebar-width: 250px;
    --topbar-height: 82px;

    --radius: 14px;

    --shadow:
        0 3px 18px rgba(35, 32, 70, 0.06);
}


/* =========================================================
   GLOBAL
   ========================================================= */

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;

    min-height: 100vh;

    background: var(--bg);

    color: var(--text);

    font-family:
        "Vazirmatn",
        "Tahoma",
        Arial,
        sans-serif;

    font-size: 13px;

    line-height: 1.8;

    direction: rtl;

    /*
     * چون TOPBAR فیکس است،
     * این فضا برای آن رزرو می‌شود.
     */
    padding-top: var(--topbar-height);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    width: 100%;
    min-height: 100vh;
}


/* =========================================================
   TOPBAR
   ثابت در بالاترین قسمت صفحه
   ========================================================= */

.topbar {
    position: fixed;

    top: 0;
    right: 0;
    left: 0;

    width: 100%;

    height: var(--topbar-height);
    min-height: var(--topbar-height);

    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 50px 30px;

    background: #ffffff;

    border-bottom: 1px solid var(--border);

    /*
     * همیشه بالاتر از sidebar باشد
     */
    z-index: 1100;

    box-shadow:
        0 4px 18px rgba(35, 32, 70, 0.045);
}

.topbar h1 {
    margin: 0;

    color: var(--text);

    font-size: 17px;

    font-weight: 800;

    line-height: 1.5;
}

.topbar p {
    margin: 2px 0 0;

    color: var(--muted);

    font-size: 10px;
}

.topbar-actions {
    display: flex;

    align-items: center;

    gap: 12px;
}

.topbar-search {
    width: 250px;
    height: 38px;

    display: flex;

    align-items: center;

    background: #fafafe;

    border: 1px solid var(--border);

    border-radius: 9px;

    overflow: hidden;
}

.topbar-search input {
    width: 100%;
    height: 100%;

    border: 0;
    outline: 0;

    background: transparent;

    padding: 0 12px;

    color: var(--text);

    font-size: 10px;
}

.topbar-search input::placeholder {
    color: #aaaaba;
}

.topbar-search button {
    width: 38px;
    height: 100%;

    flex: 0 0 38px;

    border: 0;

    background: transparent;

    color: #8c8da0;

    font-size: 15px;
}

.topbar-search button:hover {
    color: var(--primary);
}

.topbar-user {
    display: flex;

    align-items: center;

    gap: 8px;
}

.topbar-avatar {
    width: 34px;
    height: 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 50%;

    color: var(--primary);

    background:
        linear-gradient(
            145deg,
            #f2edff,
            #dcd2ff
        );

    border: 1px solid rgba(255,255,255,.8);

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -3px 5px rgba(118,84,216,.10),
        0 4px 9px rgba(60,45,100,.10);

    font-size: 11px;

    font-weight: 800;
}

.topbar-username {
    color: var(--text);

    font-size: 10px;

    font-weight: 600;
}


/* =========================================================
   SIDEBAR
   سمت چپ
   از زیر TOPBAR شروع می‌شود
   ========================================================= */

.sidebar {
    position: fixed;

    /*
     * مهم:
     * sidebar دیگر از top: 0 شروع نمی‌شود.
     */
    top: var(--topbar-height);

    left: 0;

    bottom: 0;

    width: var(--sidebar-width);

    height: calc(100vh - var(--topbar-height));

    background: #ffffff;

    border-right: 1px solid var(--border);

    /*
     * پایین‌تر از topbar
     */
    z-index: 1000;

    display: flex;

    flex-direction: column;

    overflow-y: auto;

    overflow-x: hidden;

    direction: rtl;

    /*
     * اسکرول بار تمیز
     */
    scrollbar-width: thin;

    scrollbar-color:
        #ddd7ef
        transparent;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ddd7ef;

    border-radius: 20px;
}




/* =========================================================
   SIDEBAR NAV
   ========================================================= */

.sidebar-nav {
    flex: 1;

    padding: 20px 13px;
}

.nav-section {
    margin-bottom: 22px;
}

.nav-section-title {
    padding: 0 11px 8px;

    color: #a0a1b0;

    font-size: 10px;

    font-weight: 600;
}

.nav-item {
    min-height: 42px;

    display: flex;

    align-items: center;

    gap: 11px;

    padding: 0 13px;

    margin-bottom: 4px;

    border-radius: 10px;

    color: #66687b;

    font-size: 12px;

    font-weight: 500;

    transition:
        background .18s ease,
        color .18s ease,
        transform .18s ease;
}

.nav-item > span:first-child {
    width: 21px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    color: #9799a9;

    font-size: 16px;
}

.nav-item:hover {
    background: #f7f4ff;

    color: var(--primary);

    transform: translateX(-2px);
}

.nav-item:hover > span:first-child {
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-light);

    color: var(--primary);

    font-weight: 700;
}

.nav-item.active > span:first-child {
    color: var(--primary);
}


/* =========================================================
   SIDEBAR USER
   ========================================================= */

.sidebar-bottom {
    flex: 0 0 auto;

    padding: 14px;

    border-top: 1px solid var(--border);
}

.sidebar-user {
    min-height: 54px;

    display: flex;

    align-items: center;

    gap: 10px;

    padding: 8px 9px;

    border-radius: 11px;

    background: #fafaff;
}

.sidebar-user .av {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #f2edff,
            #dcd2ff
        );

    color: var(--primary);

    border: 1px solid rgba(255,255,255,.8);

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -3px 5px rgba(118,84,216,.10),
        0 4px 9px rgba(60,45,100,.10);

    font-size: 12px;

    font-weight: 800;
}

.sidebar-user .info {
    min-width: 0;

    display: flex;

    flex-direction: column;
}

.sidebar-user .info b {
    color: var(--text);

    font-size: 11px;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}

.sidebar-user .info span {
    color: var(--muted);

    font-size: 9px;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {
    /*
     * فضای sidebar فقط در دسکتاپ
     */
    margin-left: var(--sidebar-width);

    min-height: calc(100vh - var(--topbar-height));

    width: calc(100% - var(--sidebar-width));

    direction: rtl;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    /*
     * body قبلاً فضای TOPBAR را رزرو کرده،
     * بنابراین اینجا دیگر padding-top بزرگ نمی‌گذاریم.
     */
    padding-top: 0;

    min-height: calc(100vh - var(--topbar-height));
}

.main-inner {
    width: 100%;

    max-width: 1440px;

    margin: 0 auto;

    padding:
        28px
        30px
        45px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 1023px) {

    :root {
        --topbar-height: 72px;
    }

    body {
        padding-top: var(--topbar-height);
    }

    .topbar {
        height: var(--topbar-height);
        min-height: var(--topbar-height);

        padding:
            12px 16px;
    }

    /*
     * sidebar در موبایل مخفی می‌شود
     * و JS آن را باز می‌کند.
     */
    .sidebar {
        top: var(--topbar-height);

        height: calc(100vh - var(--topbar-height));

        transform: translateX(-100%);

        transition:
            transform .25s ease;

        z-index: 1050;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main {
        width: 100%;

        margin-left: 0;
    }

    .main-content {
        min-height:
            calc(100vh - var(--topbar-height));
    }

    .main-inner {
        padding:
            20px 16px 35px;
    }

    .topbar-search {
        width: 190px;
    }
}


@media (max-width: 600px) {

    .topbar {
        gap: 10px;
    }

    .topbar-search {
        width: 150px;
    }

    .topbar-username {
        display: none;
    }

    .main-inner {
        padding:
            18px 12px 30px;
    }
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-head {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}

.page-title {
    margin: 0;

    color: var(--text);

    font-size: 20px;
    font-weight: 800;
}

.page-sub {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 10px;
}


/* =========================================================
   CARDS
   ========================================================= */

.card,
.dashboard-chart-card {
    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);
}

.card-body {
    padding: 18px;
}

.card-title {
    color: var(--text);

    font-size: 13px;
    font-weight: 800;
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    min-height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 0 15px;

    border-radius: 9px;

    border: 1px solid transparent;

    font-size: 10px;
    font-weight: 700;

    transition:
        background .18s ease,
        border-color .18s ease,
        color .18s ease,
        transform .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #fff;

    border-color: var(--border);

    color: #626478;
}

.btn-secondary:hover {
    border-color: #d9d3f3;
    color: var(--primary);
}


/* =========================================================
   DASHBOARD
   ========================================================= */

.dashboard-stats-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 14px;
}

.dashboard-stat-card {
    min-height: 115px;

    padding: 17px;

    background: #fff;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    position: relative;

    overflow: hidden;
}

.dashboard-stat-card::after {
    content: "";

    position: absolute;

    left: -30px;
    bottom: -45px;

    width: 100px;
    height: 100px;

    border-radius: 50%;

    background: #f7f3ff;
}

.dashboard-stat-icon {
    width: 35px;
    height: 35px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 9px;

    border-radius: 10px;

    background: var(--primary-light);

    font-size: 15px;
}

.dashboard-stat-label {
    display: block;

    color: var(--muted);

    font-size: 9px;
}

.dashboard-stat-value {
    display: block;

    margin-top: 1px;

    color: var(--text);

    font-size: 21px;
    font-weight: 800;
}

.dashboard-two-column {
    display: grid;

    grid-template-columns:
        minmax(0, 1.45fr)
        minmax(280px, .85fr);

    gap: 14px;
}

.dashboard-chart-card {
    overflow: hidden;
}

.dashboard-chart-header {
    min-height: 65px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 14px 18px;

    border-bottom: 1px solid var(--border);
}

.dashboard-chart-body {
    padding: 18px;
}

.type-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 25px;

    padding: 0 9px;

    border-radius: 7px;

    background: #f3f0ff;

    color: var(--primary);

    font-size: 9px;
    font-weight: 700;
}

.info-list {
    display: grid;

    gap: 8px;
}

.info-item {
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    padding: 8px 11px;

    border: 1px solid #f0f0f5;

    border-radius: 9px;

    background: #fcfcfe;
}

.info-item .l {
    color: var(--muted);

    font-size: 9px;
}

.info-item .v {
    color: var(--text);

    font-size: 11px;
    font-weight: 800;
}


/* =========================================================
   STATUS
   ========================================================= */

.status-pill {
    min-height: 23px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0 8px;

    border-radius: 7px;

    font-size: 8px;
    font-weight: 700;

    white-space: nowrap;
}

.status-pill.ok {
    background: #eaf8f0;
    color: var(--success);
}

.status-pill.pending {
    background: #fff5df;
    color: var(--warning);
}

.status-pill.notok {
    background: #fdecef;
    color: var(--danger);
}


/* =========================================================
   DASHBOARD STATUS
   ========================================================= */

.dashboard-status-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;
}

.cc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;

    margin-bottom: 11px;
}

.cc-pm-label {
    color: var(--muted);

    font-size: 9px;
}

.cc-name {
    color: var(--text);

    font-size: 13px;
    font-weight: 800;

    margin-bottom: 3px;
}


/* =========================================================
   DEVICE GRID
   ========================================================= */

.device-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 13px;
}

.device-card {
    padding: 14px;

    background: #fff;

    border: 1px solid var(--border);

    border-radius: 12px;

    transition:
        box-shadow .18s ease,
        transform .18s ease;
}

.device-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 24px rgba(35, 32, 70, .08);
}

.dc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin-bottom: 12px;
}

.dc-model {
    margin-bottom: 8px;

    color: var(--text);

    font-size: 13px;
    font-weight: 800;
}

.dc-row {
    min-height: 27px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    color: var(--muted);

    font-size: 9px;

    border-bottom: 1px solid #f3f3f7;
}

.dc-row:last-child {
    border-bottom: 0;
}


/* =========================================================
   TABLE
   ========================================================= */

.table-wrap {
    width: 100%;

    overflow-x: auto;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: #fff;
}

.table-wrap table {
    width: 100%;

    min-width: 650px;

    border-collapse: collapse;
}

.table-wrap th {
    height: 44px;

    padding: 0 13px;

    background: #fafafe;

    border-bottom: 1px solid var(--border);

    color: #77798d;

    font-size: 9px;
    font-weight: 700;

    text-align: right;

    white-space: nowrap;
}

.table-wrap td {
    min-height: 45px;

    padding: 9px 13px;

    border-bottom: 1px solid #f1f1f5;

    color: #55576b;

    font-size: 9px;

    text-align: right;
}

.table-wrap tr:last-child td {
    border-bottom: 0;
}

.table-wrap tbody tr {
    transition: background .15s ease;
}

.table-wrap tbody tr:hover {
    background: #fbfaff;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    color: #66687b;

    font-size: 10px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea,
input.form-control,
select.form-control,
textarea.form-control {
    width: 100%;

    min-height: 39px;

    padding: 0 11px;

    background: #fff;

    border: 1px solid #e4e4ec;

    border-radius: 8px;

    outline: 0;

    color: var(--text);

    font-size: 10px;

    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.form-group textarea,
textarea.form-control {
    min-height: 100px;

    padding-top: 9px;
    padding-bottom: 9px;

    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #bcaef0;

    box-shadow:
        0 0 0 3px rgba(118, 84, 216, .08);
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    width: 100%;

    margin-bottom: 15px;

    padding: 11px 14px;

    border-radius: 9px;

    font-size: 10px;

    border: 1px solid transparent;
}

.alert-success {
    background: #eaf8f0;
    color: #257c4d;
}

.alert-error,
.alert-danger {
    background: #fdecef;
    color: #b54856;
}

.alert-warning {
    background: #fff5df;
    color: #9a6a18;
}

.alert-info {
    background: #edf5ff;
    color: #3d6e9e;
}


/* =========================================================
   MOBILE TOGGLE
   ========================================================= */

.ui-mobile-toggle {
    display: none;

    width: 38px;
    height: 38px;

    align-items: center;
    justify-content: center;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: #fff;

    color: var(--text);
}


/* =========================================================
   MOBILE OVERLAY
   ========================================================= */

.ui-sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    background: rgba(20, 18, 35, .35);

    z-index: 999;
}


/* =========================================================
   MOBILE BOTTOM NAV
   ========================================================= */

.mobile-bottom-nav {
    display: none;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .dashboard-stats-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .device-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 1023px) {

    :root {
        --sidebar-width: 250px;
    }

    .sidebar {
        transform: translateX(-100%);

        transition:
            transform .22s ease;

        box-shadow:
            8px 0 30px rgba(20, 18, 35, .12);
    }

    body.ui-sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.ui-sidebar-open .ui-sidebar-overlay {
        display: block;
    }

    .main {
        margin-left: 0;
    }

    .ui-mobile-toggle {
        display: inline-flex;
    }

    .topbar {
        min-height: 65px;

        padding: 12px 16px;
    }

    .topbar-search {
        width: 190px;
    }

    .main-inner {
        padding: 20px 16px 85px;
    }

    .dashboard-two-column {
        grid-template-columns: 1fr;
    }

    .dashboard-status-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 650px) {

    .topbar {
        gap: 10px;
    }

    .topbar > div:first-of-type {
        min-width: 0;
    }

    .topbar h1 {
        font-size: 14px;
    }

    .topbar p {
        display: none;
    }

    .topbar-actions {
        margin-left: auto;
    }

    .topbar-search {
        display: none;
    }

    .topbar-username {
        display: none;
    }

    .page-head {
        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
    }

    .page-head .btn {
        width: 100%;
    }

    .page-title {
        font-size: 17px;
    }

    .dashboard-stats-grid {
        grid-template-columns: 1fr 1fr;

        gap: 9px;
    }

    .dashboard-stat-card {
        min-height: 105px;

        padding: 13px;
    }

    .dashboard-stat-value {
        font-size: 18px;
    }

    .device-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .dashboard-chart-header {
        padding: 12px 14px;
    }

    .dashboard-chart-body {
        padding: 14px;
    }

    .mobile-bottom-nav {
        position: fixed;

        left: 0;
        right: 0;
        bottom: 0;

        height: 62px;

        display: flex;
        align-items: stretch;
        justify-content: space-around;

        background: #fff;

        border-top: 1px solid var(--border);

        z-index: 990;
    }

    .mobile-bottom-nav a {
        flex: 1;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;

        gap: 1px;

        color: #8b8d9f;

        font-size: 17px;
    }

    .mobile-bottom-nav small {
        font-size: 8px;
    }

    .mobile-bottom-nav a:hover,
    .mobile-bottom-nav a.active {
        color: var(--primary);
    }

}


@media (max-width: 400px) {

    .dashboard-stats-grid {
        grid-template-columns: 1fr;
    }

    .main-inner {
        padding-left: 11px;
        padding-right: 11px;
    }

}



/* =========================================================
   INNER PAGES — DEUTSCHLERNEN PREMIUM UI
   ========================================================= */

.page-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 8px;
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -.5px;
}

.page-header p {
    margin: 0;
    color: #85819a;
    font-size: 14px;
    line-height: 1.9;
}


/* =========================================================
   PREMIUM BUTTONS
   ========================================================= */

.btn,
button {
    font-family: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 0 18px;

    border: 0;
    border-radius: 12px;

    text-decoration: none;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #8060df,
            #6545c5
        );

    box-shadow:
        0 8px 18px rgba(105, 73, 201, .20),
        inset 0 1px 1px rgba(255,255,255,.22);
}

.btn-primary:hover {
    box-shadow:
        0 12px 24px rgba(105, 73, 201, .28),
        inset 0 1px 1px rgba(255,255,255,.25);
}

.btn-secondary {
    color: #625b79;

    background: #f4f2f9;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.9);
}

.btn-danger {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #e97979,
            #d95765
        );

    box-shadow:
        0 8px 18px rgba(217,87,101,.18);
}

.btn-success {
    color: #fff;

    background:
        linear-gradient(
            135deg,
            #38b98b,
            #21966f
        );

    box-shadow:
        0 8px 18px rgba(33,150,111,.18);
}


/* =========================================================
   FORMS
   ========================================================= */

.form-card {
    padding: 28px;

    background: rgba(255,255,255,.88);

    border: 1px solid #ece9f3;

    border-radius: 20px;

    box-shadow:
        0 12px 35px rgba(55,45,85,.06),
        inset 0 1px 1px rgba(255,255,255,.9);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    color: #514b65;

    font-size: 13px;
    font-weight: 700;
}

.form-control,
.form-card input,
.form-card select,
.form-card textarea,
.filter-card input,
.filter-card select,
.search-panel input,
.quiz-answer {
    width: 100%;

    min-height: 46px;

    padding: 0 14px;

    border: 1px solid #e5e1ed;

    border-radius: 12px;

    outline: none;

    background: #fbfaff;

    color: #393443;

    font-family: inherit;

    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.form-card textarea,
.note-textarea {
    padding: 14px;

    min-height: 150px;

    resize: vertical;
}

.form-control:focus,
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus,
.filter-card input:focus,
.filter-card select:focus,
.search-panel input:focus,
.quiz-answer:focus {
    border-color: #8b72dc;

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(118,84,216,.09);
}

.errorlist {
    padding: 0;
    margin: 6px 0 0;

    list-style: none;

    color: #d95d68;

    font-size: 12px;
}


/* =========================================================
   DICTIONARY
   ========================================================= */

.search-panel {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 25px;

    padding: 8px;

    background: #fff;

    border: 1px solid #ece8f3;

    border-radius: 16px;

    box-shadow:
        0 8px 24px rgba(55,45,85,.05);
}

.search-panel input {
    border: 0;
    background: transparent;

    box-shadow: none;
}

.search-panel input:focus {
    box-shadow: none;
}

.dictionary-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.word-card {
    position: relative;

    padding: 23px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 20px;

    box-shadow:
        0 10px 28px rgba(55,45,85,.055);

    transition:
        transform .22s ease,
        box-shadow .22s ease;
}

.word-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 16px 35px rgba(55,45,85,.10);
}

.word-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 15px;
}

.word-title {
    margin: 0;

    color: #302b3d;

    font-size: 24px;
    font-weight: 800;
}

.word-language {
    display: inline-flex;

    margin-top: 7px;

    padding: 5px 10px;

    border-radius: 8px;

    color: #7654d8;

    background: #f1edff;

    font-size: 11px;
    font-weight: 700;
}

.word-meaning {
    margin: 7px 0;

    color: #686276;

    font-size: 14px;

    line-height: 1.9;
}

.word-meaning strong {
    color: #403a4f;
}

.word-meta {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 16px;
}

.meta-chip {
    display: inline-flex;

    align-items: center;

    min-height: 29px;

    padding: 0 10px;

    border-radius: 9px;

    color: #68617b;

    background: #f6f4fa;

    font-size: 11px;
    font-weight: 600;
}

.word-card-actions {
    display: flex;

    gap: 9px;

    margin-top: 19px;
}

.status {
    display: inline-flex;

    align-items: center;

    min-height: 34px;

    padding: 0 12px;

    border-radius: 10px;

    color: #21845f;

    background: #e9faf2;

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    margin-top: 28px;
}

.pagination a,
.pagination span {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 38px;
    height: 38px;

    padding: 0 10px;

    border-radius: 10px;

    color: #655e78;

    background: #fff;

    border: 1px solid #e9e5f0;

    text-decoration: none;

    font-size: 12px;
    font-weight: 700;
}

.pagination .current {
    color: #fff;

    border-color: #7654d8;

    background: #7654d8;

    box-shadow:
        0 5px 13px rgba(118,84,216,.20);
}


/* =========================================================
   LEARNING LIST
   ========================================================= */

.filter-card {
    margin-bottom: 25px;

    padding: 22px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 18px;

    box-shadow:
        0 8px 25px rgba(55,45,85,.05);
}

.filter-title {
    margin: 0 0 18px;

    font-size: 16px;
    font-weight: 800;
}

.filter-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 14px;

    align-items: end;
}

.filter-field label {
    display: block;

    margin-bottom: 7px;

    color: #625c71;

    font-size: 12px;
    font-weight: 700;
}

.filter-check {
    display: flex;

    align-items: center;

    gap: 8px;

    min-height: 46px;

    color: #5f596d;

    font-size: 13px;
}

.filter-check input {
    width: 17px;
    height: 17px;

    min-height: 0;
}

.learning-count {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 17px;
}

.learning-count h2 {
    margin: 0;

    font-size: 18px;
}

.learning-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.learning-card {
    padding: 23px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 20px;

    box-shadow:
        0 10px 28px rgba(55,45,85,.055);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.learning-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 16px 34px rgba(55,45,85,.09);
}

.learning-card-head {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 15px;
}

.learning-word {
    margin: 0;

    font-size: 23px;
    font-weight: 800;
}

.favorite-badge {
    width: 38px;
    height: 38px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 11px;

    color: #d99432;

    background: #fff5df;
}

.learning-detail {
    display: grid;

    gap: 8px;

    margin-bottom: 17px;
}

.learning-detail p {
    margin: 0;

    color: #6b6577;

    font-size: 13px;

    line-height: 1.8;
}

.learning-detail strong {
    color: #403a4e;
}

.learning-tags {
    display: flex;

    flex-wrap: wrap;

    gap: 6px;

    margin: 12px 0;
}

.tag-chip {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    min-height: 28px;

    padding: 0 9px;

    border-radius: 8px;

    color: #7057b9;

    background: #f1edff;

    font-size: 11px;
    font-weight: 700;
}

.learning-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    padding-top: 16px;

    border-top: 1px solid #f0edf4;
}

.inline-form {
    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 8px;

    margin-top: 13px;
}

.inline-form label {
    color: #686174;

    font-size: 12px;
    font-weight: 700;
}

.inline-form select {
    min-height: 38px;

    padding: 0 10px;

    border: 1px solid #e5e1ed;

    border-radius: 9px;

    background: #fbfaff;

    font-family: inherit;
}


/* =========================================================
   REVIEW PAGE
   ========================================================= */

.review-sections {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 20px;
}

.review-section {
    padding: 24px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 20px;

    box-shadow:
        0 10px 28px rgba(55,45,85,.055);
}

.section-heading {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;

    font-size: 18px;
}

.section-count {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    min-width: 31px;
    height: 31px;

    padding: 0 8px;

    border-radius: 9px;

    color: #7654d8;

    background: #f0ecff;

    font-size: 12px;
    font-weight: 800;
}

.review-list {
    display: grid;

    gap: 10px;
}

.review-item {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    padding: 14px;

    border-radius: 13px;

    background: #faf9fc;

    border: 1px solid #f0edf4;

    transition:
        background .2s ease,
        transform .2s ease;
}

.review-item:hover {
    transform: translateX(-3px);

    background: #f7f4ff;
}

.review-word {
    margin: 0 0 4px;

    font-size: 16px;
    font-weight: 800;
}

.review-subtitle {
    margin: 0;

    color: #8b8596;

    font-size: 11px;
}


/* =========================================================
   FLASHCARD
   ========================================================= */

.flashcard-page {
    max-width: 720px;

    margin: 30px auto;
}

.flashcard {
    position: relative;

    min-height: 420px;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 45px;

    text-align: center;

    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(143,118,223,.10),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            #fff,
            #faf8ff
        );

    border: 1px solid #e9e4f4;

    border-radius: 28px;

    box-shadow:
        0 20px 50px rgba(55,45,85,.10),
        inset 0 1px 1px rgba(255,255,255,.9);
}

.flashcard-label {
    margin-bottom: 16px;

    color: #887e9f;

    font-size: 12px;
    font-weight: 700;
}

.flashcard-word {
    margin: 0;

    color: #302a3e;

    font-size: clamp(42px, 7vw, 65px);

    font-weight: 900;

    letter-spacing: -1px;
}

.flashcard-answer {
    margin: 25px 0;

    padding: 17px 28px;

    border-radius: 15px;

    color: #5e4b9b;

    background: #f0ecff;

    font-size: 20px;
    font-weight: 800;
}

.flashcard-actions {
    display: flex;

    gap: 10px;

    margin-top: 22px;
}


/* =========================================================
   QUIZ
   ========================================================= */

.quiz-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 17px;
}

.quiz-card {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 21px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 18px;

    box-shadow:
        0 9px 25px rgba(55,45,85,.05);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.quiz-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 15px 30px rgba(55,45,85,.09);
}

.quiz-card h3 {
    margin: 0 0 7px;

    font-size: 20px;
    font-weight: 800;
}

.quiz-card p {
    margin: 0 0 7px;

    color: #777183;

    font-size: 13px;
}

.quiz-card span {
    color: #9a94a5;

    font-size: 11px;
}

.quiz-action {
    flex-shrink: 0;
}

.quiz-box {
    max-width: 720px;

    margin: 25px auto;

    padding: 35px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 24px;

    box-shadow:
        0 15px 40px rgba(55,45,85,.08);
}

.quiz-type {
    display: inline-flex;

    padding: 7px 11px;

    margin-bottom: 18px;

    border-radius: 9px;

    color: #7654d8;

    background: #f0ecff;

    font-size: 11px;
    font-weight: 800;
}

.quiz-question {
    margin: 0 0 25px;

    font-size: 28px;
    line-height: 1.7;

    text-align: center;
}

.quiz-form {
    display: grid;

    gap: 14px;
}

.quiz-options {
    display: grid;

    gap: 10px;
}

.quiz-option {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 14px 16px;

    border: 1px solid #e8e4ef;

    border-radius: 13px;

    background: #fbfaff;

    cursor: pointer;

    transition:
        border-color .2s ease,
        background .2s ease;
}

.quiz-option:hover {
    border-color: #b6a5e9;

    background: #f7f4ff;
}

.quiz-option input {
    accent-color: #7654d8;
}


/* =========================================================
   RESULT
   ========================================================= */

.result-card {
    max-width: 620px;

    margin: 35px auto;

    padding: 40px;

    text-align: center;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 26px;

    box-shadow:
        0 18px 45px rgba(55,45,85,.08);
}

.result-icon {
    width: 76px;
    height: 76px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin: 0 auto 20px;

    border-radius: 22px;

    font-size: 31px;

    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.9),
        0 10px 20px rgba(55,45,85,.10);
}

.result-success {
    color: #20845f;

    background:
        linear-gradient(
            145deg,
            #edfff7,
            #d3f4e4
        );
}

.result-wrong {
    color: #d25e69;

    background:
        linear-gradient(
            145deg,
            #fff0f2,
            #fbd9dd
        );
}

.result-card h1 {
    margin: 0 0 10px;

    font-size: 27px;
}

.result-card p {
    color: #716a7d;

    line-height: 1.9;
}


/* =========================================================
   NOTES
   ========================================================= */

.notes-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 17px;
}

.note-card {
    position: relative;

    padding: 22px;

    background: #fffef8;

    border: 1px solid #eee9d8;

    border-radius: 18px;

    box-shadow:
        0 9px 25px rgba(90,78,45,.05);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.note-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 15px 30px rgba(90,78,45,.09);
}

.note-card::before {
    content: "";

    position: absolute;

    top: 0;
    right: 22px;

    width: 45px;
    height: 4px;

    border-radius: 0 0 5px 5px;

    background: #d9a847;
}

.note-title {
    margin: 0 0 9px;

    font-size: 18px;
    font-weight: 800;
}

.note-type {
    display: inline-flex;

    margin-bottom: 13px;

    padding: 5px 9px;

    border-radius: 7px;

    color: #8b6c29;

    background: #fff1c9;

    font-size: 10px;
    font-weight: 800;
}

.note-content {
    margin: 0;

    color: #696254;

    line-height: 2;

    white-space: pre-wrap;
}

.note-date {
    display: block;

    margin-top: 15px;

    color: #a49c8c;

    font-size: 10px;
}

.note-actions {
    display: flex;

    gap: 7px;

    margin-top: 17px;

    padding-top: 14px;

    border-top: 1px solid #eee9da;
}


/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notification-list {
    display: grid;

    gap: 12px;
}

.notification-card {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 17px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 15px;

    box-shadow:
        0 7px 20px rgba(55,45,85,.04);
}

.notification-icon {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 12px;

    color: #7654d8;

    background: #f0ecff;
}

.notification-content {
    flex: 1;
}

.notification-content strong {
    display: block;

    margin-bottom: 4px;

    color: #403a4c;

    font-size: 13px;
}

.notification-content span {
    color: #96909f;

    font-size: 11px;
}


/* =========================================================
   PROFILE
   ========================================================= */

.profile-layout {
    display: grid;

    grid-template-columns: 290px 1fr;

    gap: 20px;
}

.profile-card {
    padding: 28px;

    text-align: center;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 22px;

    box-shadow:
        0 10px 30px rgba(55,45,85,.06);
}

.profile-avatar {
    width: 82px;
    height: 82px;

    display: flex;

    align-items: center;
    justify-content: center;

    margin: 0 auto 15px;

    border-radius: 25px;

    color: #fff;

    background:
        linear-gradient(
            145deg,
            #8c6ee4,
            #6043bd
        );

    font-size: 30px;
    font-weight: 900;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.25),
        0 12px 24px rgba(96,67,189,.24);
}

.profile-name {
    margin: 0;

    font-size: 19px;
    font-weight: 800;
}

.profile-role {
    margin-top: 5px;

    color: #96909f;

    font-size: 11px;
}

.profile-info {
    display: grid;

    gap: 12px;
}

.info-row {
    display: flex;

    justify-content: space-between;

    gap: 15px;

    padding: 15px;

    border-radius: 13px;

    background: #faf9fc;
}

.info-row span:first-child {
    color: #898394;

    font-size: 12px;
}

.info-row strong {
    color: #443e51;

    font-size: 13px;
}


/* =========================================================
   DANGER ZONE
   ========================================================= */

.danger-card {
    margin-top: 20px;

    padding: 22px;

    border: 1px solid #f1d9dd;

    border-radius: 18px;

    background: #fff8f9;
}

.danger-card h3 {
    margin: 0 0 7px;

    color: #c45662;

    font-size: 16px;
}

.danger-card p {
    color: #8c7075;

    font-size: 12px;

    line-height: 1.9;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 55px 25px;

    text-align: center;

    background: #fff;

    border: 1px dashed #dcd6e8;

    border-radius: 20px;
}

.empty-state h3 {
    margin: 0 0 8px;

    font-size: 18px;
}

.empty-state p {
    max-width: 480px;

    margin: 0 auto 18px;

    color: #8a8495;

    font-size: 13px;

    line-height: 1.9;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    margin-bottom: 18px;

    padding: 13px 16px;

    border-radius: 12px;

    font-size: 13px;
}

.alert-error {
    color: #a84753;

    background: #fff0f2;

    border: 1px solid #f4d4d9;
}

.alert-success {
    color: #237a5d;

    background: #ecfaf4;

    border: 1px solid #d1eee1;
}

.alert-warning {
    color: #8b6b28;

    background: #fff8e6;

    border: 1px solid #f1e2bc;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1000px) {

    .dictionary-grid,
    .learning-grid,
    .quiz-list,
    .notes-grid {
        grid-template-columns: 1fr;
    }

    .review-sections {
        grid-template-columns: 1fr;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


@media (max-width: 700px) {

    .page-shell {
        width: 100%;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .search-panel {
        flex-direction: column;

        align-items: stretch;

        padding: 10px;
    }

    .search-panel .btn {
        width: 100%;
    }

    .quiz-card {
        flex-direction: column;

        align-items: stretch;
    }

    .quiz-action .btn {
        width: 100%;
    }

    .word-card-actions,
    .learning-actions,
    .flashcard-actions {
        flex-direction: column;
    }

    .word-card-actions .btn,
    .learning-actions .btn,
    .flashcard-actions .btn {
        width: 100%;
    }

    .flashcard {
        min-height: 360px;

        padding: 30px 20px;
    }

    .flashcard-word {
        font-size: 42px;
    }

    .quiz-box,
    .form-card,
    .result-card {
        padding: 24px 18px;
    }

}
/* =========================================================
   AUTH PAGES
   ========================================================= */

.auth-page {
    min-height: calc(100vh - 60px);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 460px;

    padding: 38px;

    background: rgba(255,255,255,.92);

    border: 1px solid #ebe7f2;
    border-radius: 28px;

    box-shadow:
        0 22px 55px rgba(55,45,85,.09),
        inset 0 1px 1px rgba(255,255,255,.95);
}

.auth-logo {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.auth-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent !important;
}
.auth-title {
    margin: 0;

    text-align: center;

    color: #332d40;

    font-size: 27px;
    font-weight: 900;
}

.auth-subtitle {
    margin: 9px 0 28px;

    text-align: center;

    color: #8a8496;

    font-size: 13px;

    line-height: 1.9;
}

.auth-form {
    display: grid;

    gap: 17px;
}

.auth-field {
    display: grid;

    gap: 7px;
}

.auth-field label {
    color: #514b61;

    font-size: 12px;
    font-weight: 800;
}

.auth-field input {
    width: 100%;
    min-height: 48px;

    padding: 0 15px;

    border: 1px solid #e4dfec;
    border-radius: 13px;

    outline: none;

    background: #fbfaff;

    color: #393342;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease,
        background .2s ease;
}

.auth-field input:focus {
    border-color: #8467dc;

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(118,84,216,.09);
}

.auth-submit {
    width: 100%;

    min-height: 50px;

    margin-top: 5px;
}

.auth-footer {
    margin: 22px 0 0;

    padding-top: 19px;

    border-top: 1px solid #eeeaf3;

    text-align: center;

    color: #888293;

    font-size: 12px;
}

.auth-footer a {
    color: #7255c7;

    font-weight: 800;

    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}


/* =========================================================
   ACCOUNT
   ========================================================= */

.account-layout {
    display: grid;

    grid-template-columns: 280px minmax(0, 1fr);

    gap: 22px;
}

.account-sidebar {
    padding: 27px;

    background: #fff;

    border: 1px solid #ece9f3;
    border-radius: 22px;

    box-shadow:
        0 11px 30px rgba(55,45,85,.055);
}

.account-user {
    padding-bottom: 22px;

    margin-bottom: 20px;

    text-align: center;

    border-bottom: 1px solid #efecf3;
}

.account-avatar {
    width: 78px;
    height: 78px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 14px;

    border-radius: 24px;

    color: #fff;

    background:
        linear-gradient(
            145deg,
            #9172e6,
            #6346c1
        );

    font-size: 28px;
    font-weight: 900;

    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.25),
        0 12px 24px rgba(99,70,193,.22);
}

.account-user h2 {
    margin: 0;

    color: #3b3548;

    font-size: 18px;
}

.account-user p {
    margin: 5px 0 0;

    color: #9992a3;

    font-size: 11px;
}

.account-menu {
    display: grid;

    gap: 7px;
}

.account-menu a {
    display: flex;

    align-items: center;

    min-height: 43px;

    padding: 0 13px;

    border-radius: 11px;

    color: #676174;

    text-decoration: none;

    font-size: 12px;
    font-weight: 700;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.account-menu a:hover {
    color: #7053c5;

    background: #f3efff;

    transform: translateX(-2px);
}

.account-main {
    min-width: 0;
}

.account-info-card {
    padding: 29px;

    background: #fff;

    border: 1px solid #ece9f3;
    border-radius: 22px;

    box-shadow:
        0 11px 30px rgba(55,45,85,.055);
}

.account-info-card h2 {
    margin: 0 0 22px;

    font-size: 19px;
    font-weight: 900;
}

.account-info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;
}

.account-info-item {
    padding: 17px;

    border: 1px solid #efecf4;
    border-radius: 14px;

    background: #faf9fc;
}

.account-info-item span {
    display: block;

    margin-bottom: 6px;

    color: #96909f;

    font-size: 10px;
    font-weight: 700;
}

.account-info-item strong {
    color: #433d50;

    font-size: 14px;
}

.account-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 9px;

    margin-top: 22px;

    padding-top: 20px;

    border-top: 1px solid #efecf3;
}


/* =========================================================
   NOTES
   ========================================================= */

.notes-toolbar {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 23px;
}

.notes-toolbar h2 {
    margin: 0;

    font-size: 19px;
}

.notes-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 18px;
}

.note-card {
    position: relative;

    padding: 24px;

    background:
        linear-gradient(
            145deg,
            #fffefb,
            #fffdf5
        );

    border: 1px solid #eee9d9;

    border-radius: 20px;

    box-shadow:
        0 10px 28px rgba(70,60,35,.055);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.note-card:hover {
    transform: translateY(-4px);

    box-shadow:
        0 17px 34px rgba(70,60,35,.09);
}

.note-card::before {
    content: "";

    position: absolute;

    top: 0;
    right: 25px;

    width: 48px;
    height: 4px;

    border-radius: 0 0 6px 6px;

    background:
        linear-gradient(
            90deg,
            #d7a83d,
            #e9c86e
        );
}

.note-card-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 14px;
}

.note-card h2 {
    margin: 0;

    color: #403a49;

    font-size: 18px;
    font-weight: 900;
}

.note-type {
    display: inline-flex;

    flex-shrink: 0;

    padding: 6px 9px;

    border-radius: 8px;

    color: #8b6b2b;

    background: #fff1c9;

    font-size: 10px;
    font-weight: 800;
}

.note-body {
    color: #686254;

    font-size: 13px;

    line-height: 2;

    white-space: pre-wrap;
}

.note-date {
    display: block;

    margin-top: 16px;

    color: #aaa18f;

    font-size: 10px;
}

.note-actions {
    display: flex;

    gap: 8px;

    margin-top: 17px;

    padding-top: 15px;

    border-top: 1px solid #eee9da;
}

.note-form-card {
    max-width: 760px;

    margin: 0 auto;

    padding: 30px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 22px;

    box-shadow:
        0 12px 32px rgba(55,45,85,.06);
}

.note-form-card form {
    display: grid;

    gap: 18px;
}

.note-form-card p {
    margin: 0;
}

.note-form-card label {
    display: block;

    margin-bottom: 7px;

    color: #514b61;

    font-size: 12px;
    font-weight: 800;
}

.note-form-card input,
.note-form-card select,
.note-form-card textarea {
    width: 100%;

    min-height: 47px;

    padding: 11px 14px;

    border: 1px solid #e5e1ec;

    border-radius: 12px;

    outline: none;

    background: #fbfaff;

    font-family: inherit;
    font-size: 13px;

    resize: vertical;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.note-form-card textarea {
    min-height: 190px;
}

.note-form-card input:focus,
.note-form-card select:focus,
.note-form-card textarea:focus {
    border-color: #8568dc;

    box-shadow:
        0 0 0 4px rgba(118,84,216,.08);
}

.note-form-actions {
    display: flex;

    flex-wrap: wrap;

    gap: 9px;

    padding-top: 8px;
}


/* =========================================================
   DELETE CONFIRMATION
   ========================================================= */

.confirm-card {
    max-width: 570px;

    margin: 50px auto;

    padding: 38px;

    text-align: center;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 25px;

    box-shadow:
        0 18px 45px rgba(55,45,85,.08);
}

.confirm-icon {
    width: 72px;
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 19px;

    border-radius: 22px;

    color: #d15e69;

    background:
        linear-gradient(
            145deg,
            #fff1f3,
            #fbdde1
        );

    font-size: 29px;

    box-shadow:
        inset 0 2px 4px rgba(255,255,255,.9),
        0 10px 22px rgba(100,50,60,.08);
}

.confirm-card h1 {
    margin: 0 0 11px;

    font-size: 25px;
}

.confirm-card p {
    margin: 7px 0;

    color: #7f7889;

    font-size: 13px;

    line-height: 1.9;
}

.confirm-actions {
    display: flex;

    justify-content: center;

    flex-wrap: wrap;

    gap: 9px;

    margin-top: 25px;
}


/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notifications-list {
    display: grid;

    gap: 12px;
}

.notification-card {
    display: flex;

    align-items: center;

    gap: 15px;

    padding: 18px;

    background: #fff;

    border: 1px solid #ece9f3;

    border-radius: 16px;

    box-shadow:
        0 7px 20px rgba(55,45,85,.045);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.notification-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 27px rgba(55,45,85,.07);
}

.notification-icon {
    width: 45px;
    height: 45px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 13px;

    color: #7654d8;

    background:
        linear-gradient(
            145deg,
            #f4f0ff,
            #e9e2ff
        );

    font-size: 19px;

    box-shadow:
        inset 0 2px 3px rgba(255,255,255,.8);
}

.notification-text {
    flex: 1;
}

.notification-text strong {
    display: block;

    margin-bottom: 4px;

    color: #443e50;

    font-size: 13px;
}

.notification-text span {
    color: #9992a1;

    font-size: 10px;
}


/* =========================================================
   QUIZ
   ========================================================= */

.quiz-box {
    max-width: 760px;

    margin: 15px auto;

    padding: 35px;

    background:
        radial-gradient(
            circle at 90% 5%,
            rgba(130,103,218,.08),
            transparent 32%
        ),
        #fff;

    border: 1px solid #ece9f3;

    border-radius: 25px;

    box-shadow:
        0 16px 42px rgba(55,45,85,.075);
}

.quiz-progress {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 22px;

    color: #90899c;

    font-size: 11px;
    font-weight: 700;
}

.quiz-progress-bar {
    height: 6px;

    margin-bottom: 28px;

    overflow: hidden;

    border-radius: 10px;

    background: #efecf5;
}

.quiz-progress-bar span {
    display: block;

    height: 100%;

    border-radius: inherit;

    background:
        linear-gradient(
            90deg,
            #9375e4,
            #694bc4
        );
}

.quiz-label {
    display: inline-flex;

    margin-bottom: 15px;

    padding: 7px 11px;

    border-radius: 9px;

    color: #7654d8;

    background: #f1edff;

    font-size: 10px;
    font-weight: 900;
}

.quiz-box h1,
.quiz-box h2 {
    margin: 0 0 14px;

    color: #383242;

    font-weight: 900;
}

.quiz-box h1 {
    font-size: 27px;
}

.quiz-box h2 {
    font-size: 20px;
}

.quiz-word {
    margin: 20px 0 30px;

    text-align: center;

    color: #302b3c;

    font-size: clamp(36px, 7vw, 55px);

    font-weight: 900;
}

.quiz-answer-form {
    display: grid;

    gap: 13px;
}

.quiz-answer-form input[type="text"] {
    width: 100%;

    min-height: 54px;

    padding: 0 17px;

    border: 1px solid #e2ddec;

    border-radius: 14px;

    outline: none;

    background: #fbfaff;

    font-family: inherit;

    font-size: 15px;

    text-align: center;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.quiz-answer-form input[type="text"]:focus {
    border-color: #8568dc;

    background: #fff;

    box-shadow:
        0 0 0 4px rgba(118,84,216,.08);
}

.quiz-radio-list {
    display: grid;

    gap: 10px;

    margin: 20px 0;
}

.quiz-radio {
    position: relative;

    display: flex;

    align-items: center;

    gap: 11px;

    min-height: 52px;

    padding: 0 16px;

    border: 1px solid #e7e3ee;

    border-radius: 13px;

    background: #fbfaff;

    color: #514b5d;

    cursor: pointer;

    font-size: 13px;
    font-weight: 700;

    transition:
        border-color .2s ease,
        background .2s ease,
        transform .2s ease;
}

.quiz-radio:hover {
    transform: translateY(-1px);

    border-color: #b7a8e5;

    background: #f7f4ff;
}

.quiz-radio input {
    width: 17px;
    height: 17px;

    accent-color: #7654d8;
}

.quiz-submit {
    width: 100%;

    min-height: 49px;

    margin-top: 7px;
}

.quiz-unavailable {
    margin: 20px 0;

    padding: 17px;

    border: 1px solid #f0e1bd;

    border-radius: 13px;

    color: #81682f;

    background: #fff8e7;

    font-size: 13px;

    line-height: 1.9;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 850px) {

    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-sidebar {
        padding: 20px;
    }

    .account-menu {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .notes-grid {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 600px) {

    .auth-card {
        padding: 28px 20px;
    }

    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .account-menu {
        grid-template-columns: 1fr;
    }

    .account-info-card {
        padding: 22px 17px;
    }

    .note-form-card,
    .quiz-box,
    .confirm-card {
        padding: 24px 18px;
    }

    .notes-toolbar {
        align-items: stretch;

        flex-direction: column;
    }

    .notes-toolbar .btn {
        width: 100%;
    }

    .note-actions {
        flex-direction: column;
    }

    .note-actions .btn {
        width: 100%;
    }

    .confirm-actions {
        flex-direction: column;
    }

    .confirm-actions .btn {
        width: 100%;
    }

}
/* =========================================================
   FIX — PREMIUM COLORED NAV ICONS
   ========================================================= */

.sidebar .nav-item > .modern-nav-icon {
    width: 22px !important;
    height: 22px !important;

    flex: 0 0 22px !important;

    display: inline-flex !important;

    align-items: center;
    justify-content: center;

    position: relative;

    border-radius: 8px;

    color: #7654d8 !important;

    transition:
        transform .22s ease,
        filter .22s ease;
}


/* SVG باید رنگ والد را بگیرد */
.sidebar .nav-item > .modern-nav-icon svg {
    width: 18px !important;
    height: 18px !important;

    color: inherit !important;

    stroke: currentColor !important;

    fill: none !important;

    stroke-width: 1.8 !important;

    stroke-linecap: round;
    stroke-linejoin: round;

    position: relative;

    z-index: 2;
}


/* =========================================================
   DASHBOARD — PURPLE
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(1) .modern-nav-icon {
    color: #7654d8 !important;

    background:
        linear-gradient(
            145deg,
            #f1ecff,
            #ddd3ff
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(118,84,216,.14),
        0 3px 8px rgba(118,84,216,.18);
}


/* =========================================================
   WORDS — BLUE
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(2) .modern-nav-icon {
    color: #3182ce !important;

    background:
        linear-gradient(
            145deg,
            #edf7ff,
            #d4eaff
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(49,130,206,.14),
        0 3px 8px rgba(49,130,206,.18);
}


/* =========================================================
   LESSONS — GREEN
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(3) .modern-nav-icon {
    color: #20a878 !important;

    background:
        linear-gradient(
            145deg,
            #edfff8,
            #d2f5e8
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(32,168,120,.14),
        0 3px 8px rgba(32,168,120,.18);
}


/* =========================================================
   PRACTICE — ORANGE
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(4) .modern-nav-icon {
    color: #e99a32 !important;

    background:
        linear-gradient(
            145deg,
            #fff8e9,
            #ffebc8
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(233,154,50,.14),
        0 3px 8px rgba(233,154,50,.18);
}


/* =========================================================
   REVIEW — PINK
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(5) .modern-nav-icon {
    color: #d85b87 !important;

    background:
        linear-gradient(
            145deg,
            #fff0f6,
            #fbd9e7
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(216,91,135,.14),
        0 3px 8px rgba(216,91,135,.18);
}


/* =========================================================
   STATISTICS — CYAN
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(6) .modern-nav-icon {
    color: #269bb4 !important;

    background:
        linear-gradient(
            145deg,
            #eafcff,
            #d1f1f6
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(38,155,180,.14),
        0 3px 8px rgba(38,155,180,.18);
}


/* =========================================================
   NOTES — INDIGO
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(7) .modern-nav-icon {
    color: #6875d8 !important;

    background:
        linear-gradient(
            145deg,
            #f0f1ff,
            #dfe2ff
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(104,117,216,.14),
        0 3px 8px rgba(104,117,216,.18);
}


/* =========================================================
   PROFILE — TEAL
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(8) .modern-nav-icon {
    color: #238f91 !important;

    background:
        linear-gradient(
            145deg,
            #eaffff,
            #d1f1f0
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(35,143,145,.14),
        0 3px 8px rgba(35,143,145,.18);
}


/* =========================================================
   SETTINGS — SLATE
   ========================================================= */

.sidebar .nav-section .nav-item:nth-child(9) .modern-nav-icon {
    color: #766e9d !important;

    background:
        linear-gradient(
            145deg,
            #f5f3ff,
            #e6e2f5
        ) !important;

    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        inset 0 -2px 3px rgba(118,110,157,.14),
        0 3px 8px rgba(118,110,157,.18);
}


/* =========================================================
   LIGHT 3D HIGHLIGHT
   ========================================================= */

.sidebar .modern-nav-icon::before {
    content: "";

    position: absolute;

    inset: 1px;

    border-radius: 7px;

    background: currentColor;

    opacity: .10;

    pointer-events: none;
}


.sidebar .modern-nav-icon::after {
    content: "";

    position: absolute;

    width: 9px;
    height: 4px;

    left: 3px;
    bottom: 1px;

    border-radius: 50%;

    background: currentColor;

    opacity: .16;

    filter: blur(2px);

    transform: rotate(-12deg);

    pointer-events: none;
}


/* =========================================================
   HOVER
   ========================================================= */

.sidebar .nav-item:hover .modern-nav-icon {
    transform:
        translateY(-2px)
        scale(1.07);

    filter:
        saturate(1.15)
        brightness(1.03);
}


.sidebar .nav-item:hover .modern-nav-icon svg {
    transform:
        translateY(-1px)
        scale(1.05);

    filter:
        drop-shadow(
            0 3px 2px rgba(0,0,0,.20)
        );
}


/* =========================================================
   ACTIVE
   ========================================================= */

.sidebar .nav-item.active .modern-nav-icon {
    transform:
        translateY(-1px)
        scale(1.04);

    filter:
        saturate(1.2);
}


.sidebar .nav-item.active .modern-nav-icon svg {
    stroke-width: 2 !important;

    filter:
        drop-shadow(
            0 2px 2px rgba(0,0,0,.22)
        );
}


/* =========================================================
   IMPORTANT — جلوگیری از سیاه شدن آیکون
   ========================================================= */

.sidebar .nav-item > span:first-child.modern-nav-icon {
    color: inherit !important;
}

.sidebar .nav-item:hover > span:first-child.modern-nav-icon {
    color: inherit !important;
}

.sidebar .nav-item.active > span:first-child.modern-nav-icon {
    color: inherit !important;
}
/* =========================================================
   DASHBOARD STAT ICONS — FINAL FIX
   ========================================================= */

.dashboard-stat-card .dashboard-stat-icon {
    position: relative !important;
    overflow: hidden !important;

    width: 46px;
    height: 46px;

    display: flex !important;
    align-items: center;
    justify-content: center;

    border-radius: 14px;

    border: 1px solid rgba(255,255,255,.8);

    transition:
        transform .22s ease,
        box-shadow .22s ease,
        filter .22s ease;
}


/* =========================================================
   ICON SVG
   ========================================================= */

.dashboard-stat-card .dashboard-stat-icon svg {
    position: relative;
    z-index: 3;

    width: 22px !important;
    height: 22px !important;

    fill: none !important;

    stroke: currentColor !important;

    stroke-width: 1.8 !important;

    stroke-linecap: round;
    stroke-linejoin: round;

    filter:
        drop-shadow(
            0 2px 1px rgba(0,0,0,.20)
        );

    transition:
        transform .22s ease,
        filter .22s ease;
}


/* =========================================================
   اگر آیکون با I / FONT استفاده شده باشد
   ========================================================= */

.dashboard-stat-card .dashboard-stat-icon i {
    position: relative;
    z-index: 3;

    color: inherit !important;

    font-size: 20px;

    filter:
        drop-shadow(
            0 2px 1px rgba(0,0,0,.18)
        );
}


/* =========================================================
   HIGHLIGHT
   ========================================================= */

.dashboard-stat-card .dashboard-stat-icon::before {
    content: "";

    position: absolute;

    width: 42px;
    height: 42px;

    top: -23px;
    right: -17px;

    border-radius: 50%;

    background: rgba(255,255,255,.58);

    filter: blur(1px);

    pointer-events: none;
}


/* =========================================================
   SHADOW / DEPTH
   ========================================================= */

.dashboard-stat-card .dashboard-stat-icon::after {
    content: "";

    position: absolute;

    left: 5px;
    bottom: 4px;

    width: 20px;
    height: 6px;

    border-radius: 50%;

    background: rgba(40,30,70,.13);

    filter: blur(3px);

    transform: rotate(-8deg);

    pointer-events: none;
}


/* =========================================================
   1 — TOTAL WORDS
   PURPLE
   ========================================================= */

.dashboard-stat-card:nth-child(1)
.dashboard-stat-icon {

    color: #7351d5 !important;

    background:
        linear-gradient(
            145deg,
            #f4f0ff 0%,
            #ddd3ff 55%,
            #cfc1ff 100%
        ) !important;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -4px 7px rgba(118,84,216,.15),
        0 6px 14px rgba(118,84,216,.16);
}


/* =========================================================
   2 — LEARNING
   BLUE
   ========================================================= */

.dashboard-stat-card:nth-child(2)
.dashboard-stat-icon {

    color: #327ec4 !important;

    background:
        linear-gradient(
            145deg,
            #eef8ff 0%,
            #d5eaff 55%,
            #c6e2ff 100%
        ) !important;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -4px 7px rgba(50,126,196,.15),
        0 6px 14px rgba(50,126,196,.16);
}


/* =========================================================
   3 — MASTERED
   GREEN
   ========================================================= */

.dashboard-stat-card:nth-child(3)
.dashboard-stat-icon {

    color: #24966a !important;

    background:
        linear-gradient(
            145deg,
            #effff7 0%,
            #d2f3e3 55%,
            #c0ead5 100%
        ) !important;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -4px 7px rgba(36,150,106,.15),
        0 6px 14px rgba(36,150,106,.16);
}


/* =========================================================
   4 — STREAK
   CORAL
   ========================================================= */

.dashboard-stat-card:nth-child(4)
.dashboard-stat-icon {

    color: #e06b42 !important;

    background:
        linear-gradient(
            145deg,
            #fff5ed 0%,
            #ffe0d0 55%,
            #ffd0bd 100%
        ) !important;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -4px 7px rgba(224,107,66,.15),
        0 6px 14px rgba(224,107,66,.16);
}


/* =========================================================
   HOVER
   ========================================================= */

.dashboard-stat-card:hover
.dashboard-stat-icon {

    transform:
        translateY(-3px)
        rotate(-1deg)
        scale(1.03);

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,.95),
        inset 0 -5px 8px rgba(0,0,0,.08),
        0 10px 22px rgba(55,45,100,.17);

    filter:
        saturate(1.08);
}


.dashboard-stat-card:hover
.dashboard-stat-icon svg {

    transform:
        translateY(-1px)
        scale(1.08);

    filter:
        drop-shadow(
            0 3px 2px rgba(0,0,0,.22)
        );
}


.dashboard-stat-card:hover
.dashboard-stat-icon i {

    transform:
        translateY(-1px)
        scale(1.08);
}


/* =========================================================
   ACTIVE / FOCUS
   ========================================================= */

.dashboard-stat-card:focus-within
.dashboard-stat-icon {

    filter:
        saturate(1.08);
}


/* =========================================================
   IMPORTANT
   جلوگیری از سیاه شدن توسط قوانین عمومی
   ========================================================= */

.dashboard-stat-icon,
.dashboard-stat-icon *,
.dashboard-stat-icon svg,
.dashboard-stat-icon i {

    --icon-color: currentColor;
}


/* SVG رنگ خودش را از کارت بگیرد */
.dashboard-stat-card .dashboard-stat-icon svg {
    color: inherit !important;
}


/* آیکون‌های فونتی */
.dashboard-stat-card .dashboard-stat-icon i {
    color: inherit !important;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .dashboard-stat-card .dashboard-stat-icon {
        width: 42px;
        height: 42px;

        border-radius: 12px;
    }

    .dashboard-stat-card .dashboard-stat-icon svg {
        width: 20px !important;
        height: 20px !important;
    }
}
/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notifications-page {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notification-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-height: 82px;
    padding: 17px 20px;
    background: #ffffff;
    border: 1px solid #ececf3;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(35, 32, 70, 0.055);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.notification-card:hover {
    transform: translateY(-2px);
    border-color: #ddd7f5;
    box-shadow: 0 9px 25px rgba(35, 32, 70, 0.09);
}

.notification-icon {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: linear-gradient(
        145deg,
        #f4f0ff,
        #e4dcff
    );
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.9),
        0 5px 12px rgba(118,84,216,.14);
    font-size: 22px;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-main {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.notification-title {
    color: #292a3d;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.7;
}

.notification-time {
    color: #85879b;
    font-size: 12px;
    font-weight: 600;
    direction: ltr;
    text-align: right;
}

.empty-state-card {
    width: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #dcdbe8;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(35, 32, 70, 0.04);
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        #f4f0ff,
        #ded5ff
    );
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        0 8px 18px rgba(118,84,216,.13);
    font-size: 30px;
}

.empty-state-card h3 {
    margin: 0 0 8px;
    color: #292a3d;
    font-size: 17px;
    font-weight: 800;
}

.empty-state-card p {
    margin: 0;
    color: #85879b;
    font-size: 13px;
}


/* =========================================================
   DELETE NOTE PAGE
   ========================================================= */

.delete-page {
    width: 100%;
    min-height: calc(100vh - var(--topbar-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 35px 20px;
}

.delete-card {
    width: 100%;
    max-width: 600px;
    padding: 38px 35px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #ececf3;
    border-radius: 22px;
    box-shadow:
        0 8px 35px rgba(35, 32, 70, 0.08),
        0 2px 8px rgba(35, 32, 70, 0.035);
}

.delete-icon {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border-radius: 23px;
    background: linear-gradient(
        145deg,
        #fff4f4,
        #ffe1e3
    );
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        0 8px 20px rgba(216,93,104,.12);
    font-size: 31px;
}

.delete-title {
    margin: 0 0 12px;
    color: #292a3d;
    font-size: 23px;
    font-weight: 900;
}

.delete-message {
    margin: 0 0 24px;
    color: #85879b;
    font-size: 14px;
    line-height: 1.9;
}

.delete-note-preview {
    width: 100%;
    margin: 0 0 28px;
    padding: 20px;
    text-align: right;
    background: #f9f9fc;
    border: 1px solid #ececf3;
    border-radius: 15px;
}

.delete-note-title {
    margin: 0 0 10px;
    color: #292a3d;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.8;
}

.delete-note-content {
    margin: 0;
    color: #66687b;
    font-size: 13px;
    line-height: 2;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.delete-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
}

.btn-delete-confirm,
.btn-delete-cancel {
    min-height: 46px;
    padding: 0 22px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease,
        color .18s ease;
}

.btn-delete-confirm {
    border: 0;
    color: #ffffff;
    background: linear-gradient(
        145deg,
        #df6873,
        #c94f5b
    );
    box-shadow:
        0 5px 13px rgba(216,93,104,.22),
        inset 0 1px 1px rgba(255,255,255,.22);
}

.btn-delete-confirm:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 18px rgba(216,93,104,.28),
        inset 0 1px 1px rgba(255,255,255,.25);
}

.btn-delete-confirm:active {
    transform: translateY(0);
}

.btn-delete-cancel {
    color: #62647a;
    background: #f4f4f8;
    border: 1px solid #e7e7ef;
}

.btn-delete-cancel:hover {
    color: #7654d8;
    background: #f0ecff;
    border-color: #ddd5fa;
    transform: translateY(-2px);
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #292a3d;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.5;
}

.page-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(
        145deg,
        #f4f0ff,
        #ded5ff
    );
    box-shadow:
        inset 0 1px 1px rgba(255,255,255,.95),
        0 5px 12px rgba(118,84,216,.12);
    font-size: 20px;
}

.page-subtitle {
    margin: 5px 0 0;
    color: #85879b;
    font-size: 13px;
    font-weight: 500;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .page-header {
        margin-bottom: 18px;
    }

    .page-title {
        font-size: 21px;
    }

    .page-title-icon {
        width: 38px;
        height: 38px;
        border-radius: 11px;
        font-size: 18px;
    }

    .notification-card {
        min-height: 74px;
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
    }

    .notification-icon {
        flex-basis: 43px;
        width: 43px;
        height: 43px;
        border-radius: 13px;
        font-size: 19px;
    }

    .notification-title {
        font-size: 13px;
    }

    .notification-time {
        font-size: 11px;
    }

    .empty-state-card {
        min-height: 240px;
        padding: 25px 15px;
    }

    .delete-page {
        padding: 20px 12px;
    }

    .delete-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    .delete-icon {
        width: 66px;
        height: 66px;
        border-radius: 20px;
        font-size: 27px;
    }

    .delete-title {
        font-size: 20px;
    }

    .delete-message {
        font-size: 13px;
    }

    .delete-note-preview {
        padding: 15px;
    }

    .delete-form {
        flex-direction: column;
        width: 100%;
    }

    .btn-delete-confirm,
    .btn-delete-cancel {
        width: 100%;
    }
}
/* =========================================================
   RESPONSIVE HEADER IMAGE
   ========================================================= */


.topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;

    height: var(--topbar-height);
    min-height: var(--topbar-height);

    overflow: hidden;

    background: #f7f7fb;
    z-index: 1100;
}

/* خود تصویر */
.topbar::before {
    content: "";

    position: absolute;

    /* عرض بیشتر تا تصویر کاملاً دیده شود */
    width: 62%;

    /* دقیقاً هم‌اندازه ارتفاع هدر */
    height: 100%;

    /* محل قرارگیری */
    right: 9%;
    top: 0;

    background-image: url("/static/images/german-header.png");
    background-repeat: no-repeat;

    /* تصویر کل محدوده را پر کند */
    background-size: cover;

    /* تمرکز روی قسمت زیبای تصویر */
    background-position: center center;

    /*
       فقط لبه‌های تصویر محو شوند
       خود تصویر وسط کاملاً واضح باشد
    */
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0,0,0,.55) 5%,
        #000 13%,
        #000 87%,
        rgba(0,0,0,.55) 95%,
        transparent 100%
    );

    mask-image: linear-gradient(
        to right,
        transparent 0%,
        rgba(0,0,0,.55) 5%,
        #000 13%,
        #000 87%,
        rgba(0,0,0,.55) 95%,
        transparent 100%
    );

    /* عکس واضح‌تر */
    opacity: 1;

    filter:
        saturate(1.08)
        contrast(1.04)
        drop-shadow(0 5px 15px rgba(70,45,130,.12));

    pointer-events: none;
    z-index: 0;
}


/* یک لایه خیلی ملایم برای هماهنگ شدن عکس با هدر */
.topbar::after {
    content: "";

    position: absolute;
    inset: 0;

    background: linear-gradient(
        to right,
        rgba(247,247,251,.72) 0%,
        rgba(247,247,251,.25) 7%,
        rgba(247,247,251,0) 16%,
        rgba(247,247,251,0) 84%,
        rgba(247,247,251,.25) 93%,
        rgba(247,247,251,.72) 100%
    );

    pointer-events: none;
    z-index: 1;
}


/* محتوای هدر بالای تصویر */
.topbar > * {
    position: relative;
    z-index: 2;
}

/* =========================================================
   WORTELLA - TOPBAR BRAND
   ========================================================= */

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;

    direction: rtl;

    margin-right: 24px;

    position: relative;
    z-index: 5;

    padding: 6px 10px 6px 14px;

    border-radius: 16px;

    background: transparent;

    border: none;

    box-shadow: none;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


/* لوگو */
.topbar-logo {
    width: 70px;
    height: 70px;

    object-fit: contain;

    background: transparent;

    flex-shrink: 0;

    filter:
        drop-shadow(0 5px 7px rgba(94, 62, 180, .18))
        drop-shadow(0 1px 2px rgba(118, 84, 216, .18));

    transition:
        transform .25s ease,
        filter .25s ease;
}


.topbar-brand:hover .topbar-logo {
    transform: translateY(-2px) scale(1.04);

    filter:
        drop-shadow(0 7px 10px rgba(94, 62, 180, .24))
        drop-shadow(0 2px 3px rgba(118, 84, 216, .20));
}


/* بخش نوشته */
.topbar-text {
    display: flex;
    flex-direction: column;

    justify-content: center;

    min-width: 130px;
}


/* Wortella */
.topbar-text h1 {
    margin: 0;

    font-family:
        "Segoe UI",
        Tahoma,
        Arial,
        sans-serif;

    font-size: 19px;

    line-height: 1.15;

    font-weight: 900;

    letter-spacing: -.4px;

    background: linear-gradient(
        135deg,
        #4d269f 0%,
        #7654d8 48%,
        #a477e8 100%
    );

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    background-clip: text;

    filter:
        drop-shadow(0 2px 3px rgba(118,84,216,.12));
}


/* توضیح زیر نام */
.topbar-text p {
    margin: 4px 0 0;

    font-size: 10px;

    line-height: 1.4;

    font-weight: 600;

    color: #88859c;

    white-space: nowrap;
}


/* خط ظریف زیر برند */
.topbar-text::after {
    content: "";

    display: block;

    width: 34px;
    height: 2px;

    margin-top: 5px;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        #7654d8,
        #c5a9f5
    );

    opacity: .8;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

    .topbar-brand {
        margin-right: 12px;
        gap: 9px;
        padding: 5px 8px;
    }

    .topbar-logo {
        width: 46px;
        height: 46px;
    }

    .topbar-text h1 {
        font-size: 17px;
    }

    .topbar-text p {
        font-size: 9px;
    }
}


@media (max-width: 768px) {

    .topbar-brand {
        padding: 4px;
        margin-right: 6px;

        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .topbar-logo {
        width: 44px;
        height: 44px;
    }

    .topbar-text {
        min-width: auto;
    }

    .topbar-text h1 {
        font-size: 16px;
    }

    .topbar-text p {
        display: none;
    }

    .topbar-text::after {
        display: none;
    }
}


@media (max-width: 480px) {

    .topbar-brand {
        margin-right: 2px;
    }

    .topbar-logo {
        width: 40px;
        height: 40px;
    }


}

/* =========================================================
   AUTH BACKGROUND OVERRIDE
   Login / Register only
   ========================================================= */
/* =========================================================
   AUTH BACKGROUND OVERRIDE
   Login / Register only
   ========================================================= */

/* app.css has a global topbar padding on body.
   Auth pages must not inherit that spacing. */
html:has(body.auth-page),
html:has(body.auth-page) body {
    min-height: 100%;
}

body.auth-page {
    position: relative !important;

    min-height: 100vh !important;
    min-height: 100dvh !important;

    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;

    background: #17142a !important;
}

/* Blurred Germany / Cologne background */
body.auth-page::before {
    content: "";

    position: fixed !important;
    z-index: 0 !important;

    top: -30px;
    right: -30px;
    bottom: -30px;
    left: -30px;

    background-image: url("../images/germany-auth-bg.png") !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-size: cover !important;

    filter: blur(5px) !important;

    transform: scale(1.06);

    animation: auth-bg-slow-motion 22s ease-in-out infinite alternate;

    will-change: transform;

    pointer-events: none;
}

/* Soft dark/purple glass layer */
body.auth-page::after {
    content: "";

    position: fixed !important;
    z-index: 1 !important;

    inset: 0;

    background:
        linear-gradient(
            135deg,
            rgba(25, 18, 55, .48),
            rgba(91, 58, 145, .22),
            rgba(10, 14, 35, .48)
        ) !important;

    pointer-events: none;
}

/* The existing inner .auth-page from the user's HTML */
body.auth-page > .auth-page {
    position: relative !important;
    z-index: 2 !important;

    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 !important;
    padding: 34px 20px !important;

    background: transparent !important;
}

/* Keep the original card structure, only make it sit above the background */
body.auth-page > .auth-page > .auth-card {
    position: relative !important;
    z-index: 3 !important;

    width: 100% !important;
    max-width: 460px !important;

    margin: 0 auto !important;

    padding: 38px !important;

    background: rgba(255, 255, 255, .92) !important;

    border: 1px solid rgba(255, 255, 255, .72) !important;
    border-radius: 28px !important;

    box-shadow:
        0 22px 55px rgba(20, 12, 45, .24),
        0 5px 20px rgba(20, 12, 45, .10),
        inset 0 1px 1px rgba(255, 255, 255, .96) !important;

    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
}

/* Logo stays transparent; no purple square */
body.auth-page .auth-logo {
    width: 110px !important;
    height: 110px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 auto 20px !important;
    padding: 0 !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.auth-page .auth-logo img {
    display: block !important;

    width: 100% !important;
    height: 100% !important;

    max-width: 100% !important;

    object-fit: contain !important;

    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Prevent global styles from changing the auth controls */
body.auth-page .auth-field input {
    box-sizing: border-box !important;
}

body.auth-page .auth-submit {
    box-sizing: border-box !important;
}

@keyframes auth-bg-slow-motion {
    0% {
        transform: scale(1.06) translate3d(0, 0, 0);
    }

    50% {
        transform: scale(1.085) translate3d(-.45%, -.25%, 0);
    }

    100% {
        transform: scale(1.06) translate3d(.45%, .25%, 0);
    }
}

/* Tablet / mobile */
@media (max-width: 768px) {

    body.auth-page::before {
        top: -24px;
        right: -24px;
        bottom: -24px;
        left: -24px;

        filter: blur(4px) !important;
        background-position: center center !important;
    }

    body.auth-page > .auth-page {
        min-height: 100vh !important;
        min-height: 100dvh !important;

        padding: 20px 12px !important;
    }

    body.auth-page > .auth-page > .auth-card {
        max-width: 460px !important;

        padding: 30px 22px !important;

        border-radius: 22px !important;
    }
}

@media (max-width: 480px) {

    body.auth-page > .auth-page {
        padding: 10px 8px !important;
    }

    body.auth-page > .auth-page > .auth-card {
        padding: 26px 18px !important;
        border-radius: 20px !important;
    }

    body.auth-page .auth-logo {
        width: 90px !important;
        height: 90px !important;

        margin-bottom: 15px !important;
    }

    body.auth-page .auth-title {
        font-size: 24px !important;
    }

    body.auth-page .auth-subtitle {
        margin-bottom: 22px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page::before {
        animation: none !important;
    }
}

/* =========================================================
   GUEST AUTH BUTTON
   ========================================================= */

.guest-auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    background: linear-gradient(135deg, #7654d8, #5e45c8);
    box-shadow: 0 8px 20px rgba(118, 84, 216, .20);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    white-space: nowrap;
}

.guest-auth-button:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 11px 24px rgba(118, 84, 216, .28);
    filter: brightness(1.03);
}

.guest-auth-icon {
    font-size: 17px;
    line-height: 1;
}
/* =========================================================
   WELCOME MODAL
   ========================================================= */

.welcome-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    visibility: hidden;
    opacity: 0;

    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.welcome-modal.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.welcome-modal-overlay {
    position: absolute;
    inset: 0;

    background: rgba(20, 22, 38, 0.62);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.welcome-modal-card {
    position: relative;
    z-index: 2;

    width: min(680px, 100%);
    max-height: calc(100vh - 48px);

    overflow-y: auto;

    direction: rtl;
    text-align: right;

    background: #ffffff;

    border: 1px solid rgba(118, 84, 216, 0.12);

    border-radius: 24px;

    padding: 34px;

    box-shadow:
        0 30px 80px rgba(25, 25, 50, 0.24),
        0 8px 30px rgba(25, 25, 50, 0.10);

    transform: translateY(18px) scale(0.97);

    transition:
        transform 0.28s ease,
        opacity 0.28s ease;

    opacity: 0;
}

.welcome-modal.is-visible .welcome-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Close */

.welcome-modal-close {
    position: absolute;

    top: 16px;
    left: 16px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 50%;

    background: #f4f3f9;

    color: #55566a;

    font-family: inherit;
    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.welcome-modal-close:hover {
    background: #7654d8;
    color: #ffffff;

    transform: rotate(90deg);
}

/* Header */

.welcome-modal-header {
    padding-left: 42px;
}

.welcome-modal-brand {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 18px;

    border-radius: 16px;

    background:
        linear-gradient(
            145deg,
            #7654d8,
            #6543c7
        );

    box-shadow:
        0 10px 24px rgba(118, 84, 216, 0.25);
}

.welcome-modal-brand span {
    color: #ffffff;

    font-size: 16px;
    font-weight: 800;

    letter-spacing: 0.5px;
}

.welcome-modal-label {
    display: inline-block;

    margin-bottom: 8px;

    color: #7654d8;

    font-size: 12px;
    font-weight: 700;
}

.welcome-modal-header h2 {
    margin: 0 0 12px;

    color: #25263a;

    font-size: 27px;
    font-weight: 800;

    line-height: 1.5;
}

.welcome-modal-header p {
    margin: 0;

    color: #707286;

    font-size: 14px;
    line-height: 2;
}

/* Features */

.welcome-modal-features {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 12px;

    margin-top: 24px;
}

.welcome-feature {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 15px;

    border: 1px solid #eeeef4;

    border-radius: 15px;

    background: #fafafd;
}

.welcome-feature-number {
    flex: 0 0 36px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #f0edfc;

    color: #7654d8;

    font-size: 11px;
    font-weight: 800;

    direction: ltr;
}

.welcome-feature h3 {
    margin: 0 0 4px;

    color: #303145;

    font-size: 13px;
    font-weight: 800;
}

.welcome-feature p {
    margin: 0;

    color: #77798d;

    font-size: 12px;

    line-height: 1.9;
}

/* Account */

.welcome-modal-account {
    margin-top: 18px;

    padding: 18px;

    border-radius: 16px;

    background: #f7f5ff;

    border: 1px solid rgba(118, 84, 216, 0.10);
}

.welcome-modal-account h3 {
    margin: 0 0 7px;

    color: #3a3260;

    font-size: 14px;
    font-weight: 800;
}

.welcome-modal-account p {
    margin: 0;

    color: #6f6d82;

    font-size: 12px;

    line-height: 2;
}

/* Footer */

.welcome-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 18px;

    margin-top: 22px;
}

.welcome-modal-footer p {
    margin: 0;

    color: #66687c;

    font-size: 12px;

    line-height: 1.8;
}

.welcome-modal-button {
    flex: 0 0 auto;

    min-width: 145px;

    padding: 12px 22px;

    border: 0;
    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #7654d8,
            #6543c7
        );

    color: #ffffff;

    font-family: inherit;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(118, 84, 216, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.welcome-modal-button:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 26px rgba(118, 84, 216, 0.30);
}

/* Prevent page scrolling */

body.welcome-modal-open {
    overflow: hidden;
}

/* Mobile */

@media (max-width: 700px) {

    .welcome-modal {
        padding: 14px;
    }

    .welcome-modal-card {
        max-height: calc(100vh - 28px);

        padding: 24px 18px;

        border-radius: 20px;
    }

    .welcome-modal-header {
        padding-left: 32px;
    }

    .welcome-modal-header h2 {
        font-size: 22px;
    }

    .welcome-modal-header p {
        font-size: 13px;
    }

    .welcome-modal-features {
        grid-template-columns: 1fr;

        gap: 9px;

        margin-top: 18px;
    }

    .welcome-feature {
        padding: 12px;
    }

    .welcome-modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .welcome-modal-footer p {
        text-align: center;
    }

    .welcome-modal-button {
        width: 100%;
    }

    .welcome-modal-close {
        top: 12px;
        left: 12px;
    }
}
/* فیلتر زبان در جست‌وجوی فرهنگ لغات */
.search-panel .search-lang {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid #e5e1ed;
    border-radius: 12px;
    background: #faf9fd;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

@media (max-width: 640px) {
    .search-panel { flex-wrap: wrap; }
    .search-panel .search-lang { width: 100%; }
}

/* فیلترهای جست‌وجو و صفحه‌ی واژه */
.search-panel { flex-wrap: wrap; }
.search-filters {
    flex-basis: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.search-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}
.search-panel .search-check input {
    width: auto;
    min-height: 0;
    padding: 0;
}
.word-title a { color: inherit; text-decoration: none; }
.word-title a:hover { text-decoration: underline; }
.word-article { color: #7654d8; margin-inline-end: 6px; }
.detail-heading { font-size: 15px; margin: 18px 0 6px; color: #6b6480; }
.breadcrumb { font-size: 14px; margin-bottom: 14px; display: flex; gap: 8px; }
.breadcrumb a { color: #7654d8; text-decoration: none; }
.word-detail .word-title { font-size: 32px; }

/* =========================================================
   فلش‌کارت: چهار دکمه‌ی دشواری
   ========================================================= */
.grade-form { width: 100%; }

.grade-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.grade-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 6px 14px;
    border: 1px solid transparent;
    border-radius: 16px;
    font: inherit;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}

.grade-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(55,45,85,.12); }
.grade-btn:focus-visible { outline: 3px solid rgba(118,84,216,.35); outline-offset: 2px; }

.grade-label { font-weight: 800; font-size: 15px; }
.grade-interval { font-size: 12px; opacity: .8; }

.grade-btn kbd, #show-answer kbd {
    font: 600 11px/1 monospace;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255,255,255,.55);
    color: inherit;
    border: 1px solid rgba(0,0,0,.08);
}
.grade-btn kbd { position: absolute; top: 6px; inset-inline-start: 8px; }
#show-answer kbd { margin-inline-start: 8px; background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.3); }

.grade-again { background: #fde8ea; color: #b3394a; border-color: #f6c6cc; }
.grade-hard  { background: #fff3e0; color: #a35f10; border-color: #f6dcb1; }
.grade-good  { background: #e3f6ee; color: #1b7a58; border-color: #b9e6d3; }
.grade-easy  { background: #e6eefc; color: #2e5cb5; border-color: #bfd2f4; }

@media (max-width: 640px) {
    .grade-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #show-answer kbd { display: none; }
}

/* =========================================================
   تمرین چندسؤاله
   ========================================================= */
.notice { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
    padding:12px 16px; border-radius:14px; margin-bottom:16px; font-size:14px; }
.notice-info { background:#eef3ff; color:#2e5cb5; border:1px solid #cfdcf7; }
.notice-warn { background:#fff3e0; color:#a35f10; border:1px solid #f6dcb1; }

.practice-form { display:grid; gap:18px; margin-bottom:24px; }
.practice-block { background:#fff; border:1px solid #ece8f3; border-radius:18px; padding:18px 20px;
    box-shadow:0 8px 24px rgba(55,45,85,.04); margin-bottom:16px; }
.practice-form .practice-block { margin-bottom:0; }
.practice-block h2 { margin:0 0 12px; font-size:16px; }
.practice-block summary { cursor:pointer; font-weight:800; }
.hint { color:#887e9f; font-size:12px; font-weight:400; }

.option-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:10px; }
.option-card { position:relative; display:flex; flex-direction:column; gap:4px; padding:14px 16px;
    border:1.5px solid #e5e1ed; border-radius:14px; background:#faf9fd; cursor:pointer;
    transition:border-color .12s, box-shadow .12s, background .12s; }
.option-card input { position:absolute; opacity:0; pointer-events:none; }
.option-card:hover { border-color:#b9a8ee; }
.option-card:has(input:checked) { border-color:#7654d8; background:#f3efff; box-shadow:0 0 0 3px rgba(118,84,216,.12); }
.option-card:has(input:focus-visible) { outline:3px solid rgba(118,84,216,.35); }
.option-card.is-disabled { opacity:.5; cursor:not-allowed; }
.option-title { font-weight:800; }
.option-sub { font-size:12px; color:#887e9f; line-height:1.6; }

.count-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.count-chip input { position:absolute; opacity:0; pointer-events:none; }
.count-chip span { display:inline-flex; min-width:48px; height:42px; align-items:center; justify-content:center;
    border:1.5px solid #e5e1ed; border-radius:12px; background:#faf9fd; font-weight:800; cursor:pointer; }
.count-chip { position:relative; }
.count-chip:has(input:checked) span { border-color:#7654d8; background:#f3efff; color:#5e4b9b; }
.count-custom { display:flex; align-items:center; gap:8px; font-size:14px; }
.count-custom input { width:110px; height:42px; border:1.5px solid #e5e1ed; border-radius:12px; padding:0 12px; font:inherit; }

.type-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-top:12px; }
.type-check { display:flex; align-items:center; gap:8px; font-size:14px; cursor:pointer; }
.practice-start { min-height:50px; font-size:16px; }

.stat-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; margin-bottom:16px; }
.stat-card { display:flex; flex-direction:column; align-items:center; gap:4px; padding:16px; border-radius:16px;
    background:#faf9fd; border:1px solid #ece8f3; text-decoration:none; color:inherit; }
.stat-num { font-size:26px; font-weight:900; color:#5e4b9b; }
.stat-label { font-size:12px; color:#887e9f; }
.stat-link:hover { border-color:#b9a8ee; }

.recent-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.recent-list a { display:flex; justify-content:space-between; gap:12px; padding:10px 14px; border-radius:12px;
    background:#faf9fd; color:inherit; text-decoration:none; font-size:14px; }
.recent-list a:hover { background:#f3efff; }

.play-box { max-width:680px; margin-inline:auto; }
.play-meta { display:flex; justify-content:space-between; font-size:13px; color:#887e9f; margin:8px 0 14px; }
.play-type { font-weight:800; color:#5e4b9b; }
.toast-ok { background:#e3f6ee; color:#1b7a58; border:1px solid #b9e6d3; border-radius:12px; padding:10px 14px;
    margin-bottom:12px; font-weight:800; text-align:center; animation:toastfade 2.4s ease forwards; }
@keyframes toastfade { 0%,70% { opacity:1; } 100% { opacity:0; height:0; padding:0; margin:0; border:0; } }
.play-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:18px; flex-wrap:wrap; }
.play-quit { font-size:12px; color:#887e9f; text-decoration:none; }
.play-quit:hover { text-decoration:underline; }

.order-area, .order-pool { display:flex; flex-wrap:wrap; gap:8px; min-height:52px; padding:10px; border-radius:14px; }
.order-area { border:2px dashed #cfc5ee; background:#faf9fd; margin-bottom:12px; }
.order-chip { padding:8px 14px; border-radius:12px; border:1.5px solid #d9d0f2; background:#fff; font:inherit;
    font-weight:700; cursor:pointer; }
.order-chip:hover { border-color:#7654d8; background:#f3efff; }

.result-almost { color:#a35f10; background:#fff3e0; }
.answer-compare { display:grid; grid-template-columns:auto 1fr; gap:8px 16px; text-align:start; margin:18px auto;
    max-width:460px; }
.answer-compare dt { color:#887e9f; font-size:13px; }
.answer-compare dd { margin:0; font-weight:800; }
.answer-compare .is-wrong { color:#b3394a; }
.answer-compare .is-right { color:#1b7a58; }
.feedback-word { text-align:center; padding:14px; border-radius:14px; background:#faf9fd; margin-bottom:16px; }
.feedback-example { color:#6b6480; font-size:14px; }
.feedback-card kbd, .summary-card kbd { font:600 11px/1 monospace; padding:2px 6px; border-radius:6px;
    background:rgba(255,255,255,.25); border:1px solid rgba(255,255,255,.35); margin-inline-start:6px; }

.score-ring { --p:0; width:120px; height:120px; border-radius:50%; margin:0 auto 14px; display:grid; place-items:center;
    background:conic-gradient(#7654d8 calc(var(--p) * 1%), #ece8f3 0); position:relative; }
.score-ring::before { content:""; position:absolute; inset:10px; border-radius:50%; background:#fff; }
.score-ring span { position:relative; font-size:26px; font-weight:900; color:#5e4b9b; }
.summary-list { list-style:none; margin:18px 0; padding:0; display:grid; gap:6px; text-align:start; }
.summary-list li { display:flex; align-items:center; gap:10px; padding:8px 12px; border-radius:10px; background:#faf9fd; font-size:14px; }
.summary-list .mark { width:22px; text-align:center; font-weight:900; }
.summary-list .ok .mark { color:#1b7a58; } .summary-list .bad .mark { color:#b3394a; } .summary-list .almost .mark { color:#a35f10; }
.summary-q { flex:1; }
.summary-ans { color:#1b7a58; font-weight:800; }

.bar-row { display:grid; grid-template-columns:110px 1fr 110px; align-items:center; gap:10px; margin-bottom:8px; font-size:14px; }
.bar-track { height:12px; border-radius:99px; background:#ece8f3; overflow:hidden; }
.bar-fill { height:100%; border-radius:99px; background:#38b98b; }
.bar-fill.mid { background:#f0a63a; } .bar-fill.low { background:#e97979; }
.bar-value { font-size:12px; color:#6b6480; text-align:end; }
.tips { margin:0; padding-inline-start:20px; display:grid; gap:6px; line-height:1.8; }
.weak-list { list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.weak-list li { display:grid; grid-template-columns:140px 1fr auto; gap:10px; padding:10px 14px; border-radius:12px; background:#faf9fd; align-items:center; }

@media (max-width: 640px) {
    .bar-row { grid-template-columns:80px 1fr 80px; }
    .weak-list li { grid-template-columns:1fr; }
}


/* =========================================================================
   RESPONSIVE LAYER  (آخرین لایه؛ همه‌ی اندازه‌ها از گوشی تا دسکتاپ)
   نقطه‌های شکست:  ≥1280 دسکتاپ | 1024–1279 لپ‌تاپ | 768–1023 تبلت
                   ≤767 گوشی بزرگ | ≤480 گوشی | ≤360 گوشی کوچک
   ========================================================================= */

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }

img, svg, video, canvas { max-width: 100%; }

/* هیچ فرزند grid/flex اجازه ندارد صفحه را عریض کند */
.main-inner :where(div, section, article, form, aside, header, nav, ul, li, label) {
    min-width: 0;
}

/* واژه‌های بلند آلمانی (مثل Einzelverbindungsnachweis) نشکنند و سرریز نکنند */
.main-inner :where(h1, h2, h3, h4, p, a, span, strong, li, td, th, label, button, .word-title, .quiz-word, .flashcard-word) {
    overflow-wrap: anywhere;
}
.main-inner :where(.btn, button, .nav-item) { overflow-wrap: normal; }

/* جدول‌ها اگر باشند، اسکرول افقی داخل خودشان */
.main-inner table { display: block; max-width: 100%; overflow-x: auto; }

/* هدف لمسی راحت‌تر روی گوشی */
@media (pointer: coarse) {
    .btn, button, select, input[type="text"], input[type="search"], input[type="password"],
    input[type="email"], input[type="number"], textarea { min-height: 44px; }
    input[type="checkbox"], input[type="radio"] { min-width: 20px; min-height: 20px; }
}

/* فیلد جست‌وجوی داخل منوی کشویی (فقط گوشی) */
.sidebar-search { display: none; }

/* ---------- لپ‌تاپ کوچک: 1024–1279 ---------- */
@media (max-width: 1279px) {
    :root { --sidebar-width: 230px; }
    .main-inner { padding-left: 22px; padding-right: 22px; }
    .topbar-search { width: 220px; }
    .topbar::before { width: 50%; }
}

/* ---------- تبلت و گوشی: منوی کشویی (≤1023) ---------- */
@media (max-width: 1023px) {
    :root { --topbar-height: 64px; --sidebar-width: min(300px, 84vw); }

    body { padding-top: var(--topbar-height); }

    .topbar {
        height: var(--topbar-height);
        min-height: var(--topbar-height);
        padding: 0 14px;
        gap: 10px;
    }
    .topbar::before { display: none; }          /* تصویر تزئینی هدر فقط دسکتاپ */
    .topbar::after  { display: none; }

    .topbar-brand { margin: 0; padding: 0; flex: 1 1 auto; min-width: 0; }
    .topbar-logo  { width: 46px; height: 46px; }
    .topbar-actions { gap: 8px; flex: 0 0 auto; }
    .topbar-user { padding: 3px; }

    /* دکمه‌ی همبرگری: آیکون سه‌خطی دیده شود */
    .ui-mobile-toggle {
        display: inline-flex;
        flex: 0 0 auto;
        width: 42px; height: 42px;
        border-radius: 12px;
        background: #fff;
        border: 1px solid var(--border);
        color: var(--text);
        box-shadow: 0 2px 8px rgba(35,32,70,.06);
    }
    .ui-mobile-toggle svg {
        width: 22px; height: 22px;
        fill: none; stroke: currentColor;
        stroke-width: 2; stroke-linecap: round;
    }

    /* منوی کشویی: از بالای صفحه تا پایین، روی همه چیز */
    .sidebar {
        top: 0; bottom: 0;
        height: 100dvh;
        width: var(--sidebar-width);
        padding-top: 14px;
        z-index: 1200;
        transform: translateX(-100%);
        visibility: hidden;                      /* سایه‌ی منوی بسته نشت نکند */
        box-shadow: none;
        transition: transform .24s ease, visibility 0s linear .24s;
    }
    body.ui-sidebar-open .sidebar {
        transform: translateX(0);
        visibility: visible;
        box-shadow: 10px 0 40px rgba(20,18,35,.22);
        transition: transform .24s ease, visibility 0s;
    }
    .ui-sidebar-overlay { z-index: 1150; }
    body.ui-sidebar-open { overflow: hidden; }

    .main { margin-left: 0; width: 100%; }
    .main-inner { padding: 20px 18px 40px; max-width: 100%; }
}

/* ---------- گوشی بزرگ و تبلت عمودی: ≤767 ---------- */
@media (max-width: 767px) {
    .main-inner { padding: 16px 14px 36px; }
    .topbar-search { display: none; }            /* جست‌وجو داخل منوی کشویی است */
    .sidebar-search {
        display: flex; align-items: center; gap: 6px;
        margin: 4px 14px 10px;
        padding: 4px 6px 4px 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #fafafe;
    }
    .sidebar-search input {
        flex: 1; min-width: 0; height: 38px;
        border: 0; outline: 0; background: transparent; font: inherit;
    }
    .sidebar-search button {
        width: 36px; height: 36px; border: 0; border-radius: 9px;
        background: var(--primary); color: #fff; font-size: 18px; cursor: pointer;
    }

    .page-header { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 18px; }
    .page-head { gap: 12px; }
    .page-header h1, .page-title { font-size: 22px; }
    .page-header p { font-size: 13.5px; }

    /* گریدهای کارت‌ها تک‌ستونه */
    .dictionary-grid, .learning-grid, .quiz-list, .notes-grid,
    .review-sections, .profile-layout, .dashboard-two-column,
    .dashboard-status-grid, .device-grid { grid-template-columns: 1fr; }

    .dashboard-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .filter-grid { grid-template-columns: 1fr; }

    /* کارت آزمون/مرور: متن و دکمه زیر هم اگر جا نبود */
    .quiz-card { flex-wrap: wrap; }
    .quiz-card .quiz-action, .quiz-card .btn { width: 100%; }
    .review-section { padding: 16px; border-radius: 16px; }
    .section-heading { flex-wrap: wrap; gap: 8px; }

    .search-panel { padding: 10px; }
    .search-panel input[type="text"] { flex: 1 1 100%; }
    .search-panel .btn { flex: 1 1 100%; }

    .word-card-actions, .learning-actions, .account-actions { flex-direction: column; align-items: stretch; }
    .word-card-actions .btn, .learning-actions .btn, .account-actions .btn { width: 100%; }

    .pagination { flex-wrap: wrap; justify-content: center; gap: 8px; }

    .alert { font-size: 13.5px; }
}

/* ---------- گوشی: ≤480 ---------- */
@media (max-width: 480px) {
    :root { --topbar-height: 58px; }
    .topbar-logo { width: 40px; height: 40px; }
    .topbar-username { display: none; }
    .main-inner { padding: 14px 12px 32px; }

    .dashboard-stat-card { padding: 14px 12px; min-height: 0; }
    .dashboard-stat-card strong, .dashboard-stat-card .value { font-size: 24px; }

    .flashcard { padding: 26px 16px; min-height: 340px; border-radius: 22px; }
    .quiz-box, .result-card, .form-card { padding: 22px 16px; border-radius: 18px; }
    .grade-actions { gap: 8px; }
    .grade-btn { padding: 11px 4px 12px; }
    .count-chip { min-width: 48px; }
}

/* ---------- گوشی کوچک: ≤360 ---------- */
@media (max-width: 360px) {
    .main-inner { padding-left: 10px; padding-right: 10px; }
    .dashboard-stats-grid { gap: 8px; }
    .grade-label { font-size: 14px; }
    h1 { font-size: 21px; }
}

/* ---------- صفحه‌های بزرگ: محتوا بیش از حد کشیده نشود ---------- */
@media (min-width: 1600px) {
    .main-inner { max-width: 1520px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .grade-btn { transition: none !important; }
}


/* =========================================================
   AI EXPLAIN — توضیح هوش مصنوعی در صفحه جزئیات واژه
   ========================================================= */

.ai-box { margin-top: 18px; padding-top: 16px; border-top: 1px dashed #e4dcf5; }
.ai-btn { gap: 6px; }
.ai-box [hidden] { display: none !important; }
.ai-result {
    margin-top: 14px; padding: 16px 18px; border-radius: 18px;
    background: linear-gradient(150deg, #f7f2ff, #fff3f9);
    border: 1px solid #e6dcfa; color: #3a3350; line-height: 1.9;
}
.ai-result.is-loading { opacity: .7; }
.ai-result.is-error { background: #fff3e0; border-color: #f6dcb1; color: #a35f10; }
.ai-text { margin: 0; font-size: 14px; }
.ai-tip {
    margin-top: 12px; padding: 10px 14px; border-radius: 14px;
    background: rgba(255, 255, 255, .75); font-size: 13.5px;
}
.ai-tip strong { display: block; margin-bottom: 2px; color: #6543c7; }
.ai-heading { margin: 14px 0 6px; font-size: 14px; color: #6b6480; }
.ai-examples { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.ai-examples li { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .75); }
.ai-de { font-weight: 700; color: #282344; }
.ai-tr { color: #6b6480; font-size: 13px; }
.ai-note { margin: 10px 2px 0; font-size: 11.5px; color: #9288a8; }


/* =========================================================
   AI CHAT — دکمه شناور (پایین-راست) + پنل گفتگو
   ========================================================= */

.wl-ai [hidden] { display: none !important; }

.wl-ai-fab {
    position: fixed; right: 22px; bottom: 22px; z-index: 9999;
    width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%;
    display: grid; place-items: center; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #a07df5 0%, #6543c7 62%, #c0409a 130%);
    box-shadow: 0 14px 30px rgba(101, 67, 199, .45), 0 0 0 4px rgba(255, 255, 255, .75);
    transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.wl-ai-fab:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 18px 36px rgba(101, 67, 199, .55), 0 0 0 4px rgba(255, 255, 255, .85); }
.wl-ai-fab:active { transform: scale(.94); }
.wl-ai-fab:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #6543c7; }
.wl-ai-fab svg { width: 28px; height: 28px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linejoin: round; position: relative; z-index: 1; }
.wl-ai-fab-ring {
    position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
    border: 2px solid rgba(118, 84, 216, .5); animation: wl-ai-pulse 2.8s ease-out infinite;
}
.wl-ai-fab.is-wiggle { animation: wl-ai-wiggle 1.2s ease both; }
.wl-ai-fab.is-wiggle .wl-ai-fab-ring { animation: wl-ai-pulse-strong 1.2s ease-out both; }
.wl-ai.is-open .wl-ai-fab-ring { animation: none; opacity: 0; }

@keyframes wl-ai-pulse { 0% { transform: scale(.92); opacity: .75; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes wl-ai-pulse-strong { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes wl-ai-wiggle {
    0%, 100% { transform: translateY(0) rotate(0) scale(1); }
    15% { transform: translateY(-10px) rotate(-14deg) scale(1.12); }
    30% { transform: translateY(0) rotate(12deg) scale(1.06); }
    45% { transform: translateY(-6px) rotate(-9deg) scale(1.08); }
    60% { transform: translateY(0) rotate(6deg) scale(1.03); }
    80% { transform: translateY(-2px) rotate(-3deg); }
}

.wl-ai-teaser {
    position: fixed; right: 22px; bottom: 94px; z-index: 1250; max-width: 230px;
    padding: 12px 16px; border-radius: 18px 18px 6px 18px; cursor: pointer;
    background: #fff; color: #282344; font-size: 13.5px; font-weight: 700; line-height: 1.7;
    box-shadow: 0 14px 34px rgba(94, 64, 190, .28);
    opacity: 0; transform: translateY(10px) scale(.95); transform-origin: bottom right;
    transition: opacity .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1);
}
.wl-ai-teaser.is-visible { opacity: 1; transform: none; }

.wl-ai-backdrop { position: fixed; inset: 0; z-index: 1290; background: transparent; pointer-events: none; }

.wl-ai-panel {
    position: fixed; right: 22px; bottom: 96px; z-index: 1300;
    width: 380px; max-width: calc(100vw - 24px);
    height: min(600px, calc(100dvh - 130px));
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 26px; background: rgba(255, 255, 255, .97);
    border: 1px solid rgba(255, 255, 255, .95);
    box-shadow: 0 30px 70px rgba(70, 45, 150, .32), 0 4px 14px rgba(70, 45, 150, .12);
    opacity: 0; transform: translateY(14px) scale(.96); transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.wl-ai.is-open .wl-ai-panel { opacity: 1; transform: none; }

.wl-ai-head {
    display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 16px; color: #fff;
    background: linear-gradient(135deg, #9b78f4, #6543c7);
}
.wl-ai-avatar { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 18px; }
.wl-ai-head-text { flex: 1 1 0; min-width: 0; display: grid; line-height: 1.5; }
.wl-ai-head-text strong { font-size: 15px; font-weight: 800; }
.wl-ai-head-text span { font-size: 11.5px; opacity: .85; }
.wl-ai-iconbtn {
    flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: rgba(255, 255, 255, .18); cursor: pointer; transition: background .15s ease;
}
.wl-ai-iconbtn:hover { background: rgba(255, 255, 255, .3); }
.wl-ai-iconbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wl-ai-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #fbf8ff, #fff8fc); }
.wl-ai-msg {
    max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.85;
    white-space: pre-wrap; overflow-wrap: anywhere; text-align: start;   /* جهت از خود صفحه؛ آلمانی داخل متن فارسی درست جابه‌جا می‌شود */
    animation: wl-ai-in .22s ease both;
}
.wl-ai-msg.is-bot { align-self: flex-start; background: #f1ebfd; color: #282344; border-end-start-radius: 6px; }
.wl-ai-msg.is-user { align-self: flex-end; background: linear-gradient(135deg, #9370f0, #6543c7); color: #fff; border-end-end-radius: 6px; }
.wl-ai-msg.is-error { background: #fff3e0; color: #a35f10; }
.wl-ai-msg.is-typing { color: #9288a8; }
.wl-ai-msg.is-typing::after { content: "…"; display: inline-block; animation: wl-ai-dots 1.2s steps(4, end) infinite; width: 1em; overflow: hidden; vertical-align: bottom; }
@keyframes wl-ai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes wl-ai-dots { 0% { width: 0; } 100% { width: 1em; } }

.wl-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; background: #fff8fc; }
.wl-ai-chip {
    min-height: 38px; padding: 7px 14px; border-radius: 999px; border: 1.5px solid #e2d8fa; background: #fff;
    color: #5b3bbd; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.5; cursor: pointer; text-align: start;
    transition: background .15s ease, transform .1s ease;
}
.wl-ai-chip:hover { background: #f3edff; }
.wl-ai-chip:active { transform: scale(.97); }

.wl-ai-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #eee8f5; background: #fff; }
.wl-ai-form textarea {
    flex: 1 1 0; min-width: 0; min-height: 46px; max-height: 120px; padding: 11px 16px; resize: none;
    border: 1.5px solid #e6dcfa; border-radius: 23px; background: #fbf9ff; color: #282344;
    font: inherit; font-size: 16px; line-height: 1.6; outline: 0;
}
.wl-ai-form textarea:focus { border-color: #7654d8; box-shadow: 0 0 0 4px rgba(118, 84, 216, .14); }
.wl-ai-send {
    flex: 0 0 46px; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: linear-gradient(135deg, #9370f0, #6543c7); box-shadow: 0 8px 18px rgba(101, 67, 199, .4); cursor: pointer;
}
.wl-ai-send:disabled { opacity: .5; cursor: default; box-shadow: none; }
.wl-ai-send svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .wl-ai-send svg { transform: scaleX(-1); }
.wl-ai-foot { margin: 0; padding: 0 14px 10px; background: #fff; text-align: center; font-size: 11px; color: #9288a8; }

body.ui-sidebar-open .wl-ai-fab, body.ui-sidebar-open .wl-ai-teaser { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    .wl-ai-fab, .wl-ai-fab-ring, .wl-ai-panel, .wl-ai-teaser, .wl-ai-msg, .wl-ai-msg.is-typing::after { animation: none !important; transition: none !important; }
}
.account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.account-actions .btn {
    width: auto;
    min-width: 110px;
}

/* =====================================================
   Welcome modal v2 (پیام اولین ورود)
   هدر و فوتر ثابت؛ فقط بدنه اسکرول می‌شود. روی گوشی و لپ‌تاپ کامل دیده می‌شود.
   ===================================================== */
.welcome-modal { padding: 20px; }

.welcome-modal-card {
    display: flex;
    flex-direction: column;
    width: min(620px, 100%);
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    padding: 0;
}

.welcome-modal-header { padding: 30px 34px 18px 76px; flex: 0 0 auto; }
.welcome-modal-header h2 { font-size: 26px; margin-bottom: 8px; }
.welcome-modal-header p { font-size: 14px; line-height: 1.9; }

.welcome-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 34px 18px;
    overscroll-behavior: contain;
}
.welcome-modal-body .welcome-modal-features { margin-top: 0; }
.welcome-modal-body .welcome-feature h3 { font-size: 14px; }
.welcome-modal-body .welcome-feature p { font-size: 12.5px; line-height: 1.85; }
.welcome-modal-body .welcome-modal-account { margin-top: 14px; }
.welcome-modal-body .welcome-modal-account p { font-size: 12.5px; }

.welcome-modal-footer {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    margin: 0;
    padding: 14px 34px 22px;
    border-top: 1px solid #eeeef4;
    background: #fff;
}
.welcome-modal-footer .welcome-modal-button { min-width: 160px; }
.welcome-modal-secondary {
    padding: 12px 18px;
    border-radius: 12px;
    color: #6543c7;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}
.welcome-modal-secondary:hover { background: #f0edfc; }
.welcome-modal-close { top: 14px; left: 14px; z-index: 3; }

@media (max-width: 700px) {
    .welcome-modal { padding: 12px; align-items: flex-end; }
    .welcome-modal-card {
        width: 100%;
        max-height: calc(100dvh - 24px);
        border-radius: 22px;
    }
    .welcome-modal-header { padding: 22px 18px 12px 58px; }
    .welcome-modal-header h2 { font-size: 21px; }
    .welcome-modal-header p { font-size: 13px; line-height: 1.8; }
    .welcome-modal-body { padding: 2px 16px 14px; }
    .welcome-modal-body .welcome-modal-features { grid-template-columns: 1fr; gap: 8px; }
    .welcome-modal-body .welcome-feature { padding: 10px 12px; gap: 10px; }
    .welcome-modal-body .welcome-feature-number { flex-basis: 30px; width: 30px; height: 30px; border-radius: 9px; }
    .welcome-modal-body .welcome-feature h3 { font-size: 13px; margin-bottom: 2px; }
    .welcome-modal-body .welcome-feature p { font-size: 12px; line-height: 1.7; }
    .welcome-modal-body .welcome-modal-account { padding: 12px 14px; }
    .welcome-modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    }
    .welcome-modal-footer .welcome-modal-button { width: 100%; }
    .welcome-modal-secondary { text-align: center; padding: 10px; }
    .welcome-modal-close { top: 10px; left: 10px; }
}

/* =====================================================
   Feedback (نظرات + پاپ‌آپ نظرسنجی)
   ===================================================== */
/* honeypot: بدون آفست منفی (در RTL آفست چپِ منفی صفحه را ده‌هزار پیکسل پهن می‌کند) */
.fb-hp { position: absolute !important; width: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
.fb-card .errorlist { margin: 6px 0 0; padding: 0; list-style: none; color: #b54856; font-size: 12px; }
.fb-card .errorlist li { margin: 0; }

.fb-survey {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center; padding: 16px;
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
}
.fb-survey.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
.fb-survey[hidden] { display: none; }
.fb-survey-overlay { position: absolute; inset: 0; background: rgba(20, 22, 38, .45); }
.fb-survey-card {
    position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
    padding: 26px 24px 22px; border-radius: 22px; background: #fff; direction: rtl; text-align: right;
    border: 1px solid rgba(118, 84, 216, .12);
    box-shadow: 0 30px 70px rgba(25, 25, 50, .26), 0 8px 24px rgba(25, 25, 50, .10);
    transform: translateY(14px) scale(.97); transition: transform .25s ease;
}
.fb-survey.is-open .fb-survey-card { transform: none; }
.fb-survey-card h2 { margin: 0 0 6px; padding-left: 34px; color: #25263a; font-size: 18px; font-weight: 800; line-height: 1.6; }
.fb-survey-card p { margin: 0 0 14px; color: #707286; font-size: 13px; line-height: 1.9; }
.fb-survey-close {
    position: absolute; top: 12px; left: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: #f3f1fa; color: #5b4a99; font-size: 20px; line-height: 1; cursor: pointer;
}
.fb-survey-close:hover { background: #e9e5f7; }
.fb-stars { display: flex; justify-content: center; gap: 6px; margin: 4px 0 14px; direction: ltr; }
.fb-star {
    width: 46px; height: 46px; border: 0; border-radius: 12px; background: #f6f4fc; color: #cfc8e6;
    font-size: 28px; line-height: 1; cursor: pointer; transition: transform .12s ease, color .12s ease, background .12s ease;
}
.fb-star:hover { transform: scale(1.08); }
.fb-star.is-on { color: #f2b01e; background: #fff6dd; }
.fb-star:focus-visible { outline: 3px solid #8568dc; outline-offset: 2px; }
.fb-text {
    width: 100%; min-height: 84px; padding: 11px 14px; border: 1px solid #e5e1ec; border-radius: 12px;
    background: #fbfaff; font-family: inherit; font-size: 13px; resize: vertical; outline: none; box-sizing: border-box;
}
.fb-text:focus { border-color: #8568dc; box-shadow: 0 0 0 4px rgba(118, 84, 216, .08); }
.fb-error { margin-top: 8px; color: #b54856; font-size: 12px; }
.fb-actions { display: flex; gap: 8px; margin-top: 14px; }
.fb-actions .btn { flex: 1 1 auto; }
.fb-actions .btn[disabled] { opacity: .5; cursor: not-allowed; }
.fb-thanks { text-align: center; padding: 8px 0 0; }
.fb-thanks h2 { padding-left: 0; }
.fb-thanks-ico { font-size: 42px; margin-bottom: 6px; }
body.fb-open { overflow: hidden; }
html[dir="ltr"] .fb-survey-card { direction: ltr; text-align: left; }
html[dir="ltr"] .fb-survey-card h2 { padding-left: 0; padding-right: 34px; }
html[dir="ltr"] .fb-survey-close { left: auto; right: 12px; }
@media (max-width: 480px) {
    .fb-survey { align-items: flex-end; padding: 10px; }
    .fb-survey-card { padding: 22px 18px 18px; border-radius: 20px; }
    .fb-star { width: 42px; height: 42px; }
}
