/**
 * User Domain Manager — unified account dashboard [udm_account]
 * Two-column responsive layout, RTL. Card-based domain list.
 */

.udm-account {
    direction: rtl;
    font-family: Tahoma, Arial, sans-serif;
    color: #515861;
    max-width: 1080px;
    margin: 0 auto;
    box-sizing: border-box;
}
.udm-account *,
.udm-account *::before,
.udm-account *::after { box-sizing: border-box; }

/* Header */
.udm-account-header { margin-bottom: 22px; text-align: right; }
.udm-account-header-text { text-align: right; }
.udm-account-header-text h2 { margin: 0; font-size: 22px; font-weight: 800; color: #515861; }
.udm-account-header-text p { margin: 4px 0 0; font-size: 13px; color: #9aa1ad; }

/* Grid: main on the right (wider), sidebar on the left */
.udm-account-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    width: 100%;
}
.udm-account-main { width: 100%; }
.udm-account-sidebar { display: flex; flex-direction: column; gap: 20px; width: 100%; }
.udm-account-sidebar > .udm-card { margin-bottom: 0; }

/* Cards */
.udm-card {
    width: 100%;
    padding: 20px;
    background: #FFF;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #d5d8dc;
    align-items: center;
    transition: all .3s;
    color: #515861;
}
.udm-card-head { margin-bottom: 18px; text-align: right; }
.udm-card-head-text { text-align: right; }
.udm-card-head-text h3 { margin: 0; font-size: 16px; font-weight: 800; color: #515861; }
.udm-card-head-text p { margin: 5px 0 0; font-size: 12.5px; color: #9aa1ad; }
.udm-card-note { margin: 14px 0 0; font-size: 12px; color: #9aa1ad; line-height: 1.9; text-align: right; }
.udm-card-note-center { text-align: center; }

/* License key — click the text itself to copy */
.udm-license-key-box {
    position: relative;
    display: flex; align-items: center;
    border: 1px solid #e7e9f0; border-radius: 6px;
    padding: 2px; background: #fbfbfe;
}
.udm-license-key-value {
    position: relative;
    flex: 1; min-width: 0; direction: ltr; text-align: left;
    font-family: "Courier New", monospace; font-size: 13px; color: #2794da;
    background: none; padding: 9px 10px; overflow-x: auto; white-space: nowrap;
    cursor: pointer; border-radius: 8px; transition: background .15s; outline: none;
}
.udm-license-key-value:hover { background: #eef6fc; }
.udm-license-key-value:focus { background: #eef6fc; }
.udm-copied-tip {
    position: absolute; top: -24px; right: 8px;
    background: #2794da; color: #fff;
    font-family: Tahoma, Arial, sans-serif; font-size: 11px; font-weight: 700;
    padding: 3px 9px; border-radius: 6px; white-space: nowrap;
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .15s, transform .15s; pointer-events: none;
}
.udm-copied-tip::after {
    content: ""; position: absolute; bottom: -4px; right: 12px;
    border: 4px solid transparent; border-top-color: #2794da; border-bottom: 0;
}
.udm-license-key-value.copied + .udm-copied-tip { opacity: 1; visibility: visible; transform: translateY(0); }

/* Limited products list */
.udm-limits-list { display: flex; flex-direction: column; gap: 20px; }
.udm-limit-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.udm-limit-name { text-align: right; font-size: 13.5px; font-weight: 700; color: #515861; min-width: 0; }
.udm-limit-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.udm-limit-count { font-size: 12px; color: #515861; white-space: nowrap; direction: ltr; }
.udm-limit-count b { color: var(--udm-success, #0f7b3f); font-size: 15px; }
.udm-limit-count.low { color: #e5484d; }
.udm-limit-count.low b { color: #e5484d; }

/* Progress bar (green by default; red when running out) */
.udm-progress { height: 8px; border-radius: 999px; background: #eef1f4; overflow: hidden; }
.udm-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--udm-success, #0f7b3f); transition: width .3s, background .3s; }
.udm-progress > span.low { background: #e5484d; }
.udm-limit-legend { margin-top: 6px; font-size: 12px; color: #9aa1ad; text-align: right; }

/* Domains list — card based (no table/tr/td) */
.udm-domains-list { display: block; }
.udm-domains-listhead {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 20px; margin-bottom: 6px;
    font-size: 12px; font-weight: 700; color: #9aa1ad;
}
.udm-domains-listhead .udm-col-domain { flex: 1; }
.udm-domains-listhead .udm-col-date { flex: 0 0 170px; }
.udm-domains-listhead .udm-col-actions { flex: 0 0 90px; }
.udm-domain-card {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #FFF;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #d5d8dc;
    transition: all .3s;
    color: #515861;
}
.udm-domain-card:hover {
    border-color: #0500a3;
    box-shadow: 0 0 0 1px #0500a3;
    transition: all .3s;
}
.udm-domain-card .udm-col-domain { flex: 1; }
.udm-domain-card .udm-col-date { flex: 0 0 170px; }
.udm-domain-card .udm-col-actions { flex: 0 0 90px; }
.udm-domain-card .udm-domain-name { font-size: 16px; font-weight: 700; color: #515861; direction: ltr; display: inline-block; }
.udm-col-domain { text-align: right; }
.udm-col-date { font-size: 16px; color: #7a8290; white-space: nowrap; text-align: right; }
.udm-col-actions { text-align: left; }
.udm-col-actions form { margin: 0; }

/* Delete button */
.udm-delete-btn {
    cursor: pointer !important;
    background: #f0f0ff !important;
    border: 2px solid #f0f0ff !important;
    transition: all .5s !important;
    color: #0500a3 !important;
    font-weight: 400 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    border-radius: 3px !important;
    padding: 3px 15px !important;
    margin: 0 0 0 5px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
}
.udm-delete-btn:hover {
    color: #f0f0ff !important;
    background: #0500a3 !important;
    border-color: #0500a3 !important;
    transition: all .5s;
    filter: brightness(100%);
}

/* Notices / empty / errors */
.udm-notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 13px; }
.udm-notice-success { background: #e7f8ee; color: #12703f; border: 1px solid #bfead2; }
.udm-notice-error { background: #fdecec; color: #8a1f24; border: 1px solid #f5c6c8; }
.udm-empty, .udm-no-license, .udm-error {
    padding: 18px; text-align: center; color: #9aa1ad; font-size: 13px;
    background: #fbfbfe; border: 1px dashed #e7e9f0; border-radius: 12px;
}

/* Responsive */
@media (max-width: 860px) {
    .udm-account-grid { display: flex; flex-direction: column; width: 100%; }
    .udm-account-sidebar { order: 1; width: 100%; }
    .udm-account-main { order: 2; width: 100%; }
}
@media (max-width: 480px) {
    .udm-card { padding: 18px; }
    .udm-account-header-text h2 { font-size: 19px; }
    .udm-domains-listhead { display: none; }
    .udm-domain-card { flex-wrap: wrap; gap: 6px 10px; padding: 16px; }
    .udm-domain-card .udm-col-domain,
    .udm-domain-card .udm-col-date,
    .udm-domain-card .udm-col-actions { flex: 1 1 auto; }
}

/* Domains consuming each product limit (account panel) */
.udm-limit-domains { margin-top: 10px; }
.udm-limit-domains-title { margin: 0 0 6px; font-size: 12px; font-weight: 700; color: #515861; }
.udm-limit-domains-empty { margin: 0; font-size: 12px; color: #9aa1ad; }
.udm-limit-domains-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.udm-limit-domain-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #eceef2; border-radius: 8px; background: #fbfcfd; }
.udm-limit-domain-num { min-width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: rgba(39,148,218,.12); color: #2794da; flex: none; }
.udm-limit-domain-name { font-size: 16px; font-weight: 600; color: #333b45; direction: ltr; unicode-bidi: embed; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.udm-limit-domain-date { margin-inline-start: auto; font-size: 16px; color: #9aa1ad; white-space: nowrap; }
