:root {
    --green: #000;
    --green-dark: #ccc;
    --blue: #09a9e8;
    --ink: #26323b;
    --muted: #7b8790;
    --line: #dfe7ec;
    --panel: #eaf1f5;
    --white: #fff;
    --shadow: 0 20px 50px rgba(15, 31, 45, .08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f3f7fa;
    color: var(--ink);
    font-family: Tahoma, Arial, sans-serif;
    direction: rtl;
}
a { color: inherit; text-decoration: none; }
.topbar {
    background: var(--green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 38px;
    min-height: 58px;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
    direction: ltr;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: #fff; color: var(--green); display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; opacity: .7; font-size: 11px; margin-top: 2px; }
.top-links { display: flex; gap: 18px; align-items: center; }
.top-links a { opacity: .78; padding: 20px 0 17px; border-bottom: 3px solid transparent; }
.top-links a.active, .top-links a:hover { opacity: 1; border-color: #fff; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 22px 60px; }
.alert { padding: 14px 18px; border-radius: 14px; margin-bottom: 18px; }
.alert.success { background: #e9f8ef; border: 1px solid #bfe7ce; }
.alert.danger { background: #fff0f0; border: 1px solid #ffc7c7; }
.alert ul { margin: 8px 0 0; }
.generator-shell { background: #fff; border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 390px; direction: ltr; }
.builder { background: var(--panel); padding-bottom: 28px; direction: ltr; }
.tabs {
    background: var(--green);
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    scrollbar-width: thin;
}
.tabs button {
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.78);
    cursor: pointer;
    padding: 17px 14px;
    font-weight: 700;
    white-space: nowrap;
    font-size: 14px;
    border-bottom: 4px solid transparent;
}
.tabs button.active { color: #fff; border-color: #fff; }
.section-title {
    margin: 32px 32px 22px;
    height: 50px;
    background: #f9fbfc;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    color: #64717b;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.section-title .icon { width: 50px; height: 50px; background: var(--blue); color: #fff; display: grid; place-items: center; margin-right: 16px; }
.form-content { padding: 0 32px; }
label { display: block; color: #68747d; font-size: 13px; font-weight: 700; margin: 15px 0 8px; }
label small { font-weight: 400; color: #8d989f; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], input[type="date"], input[type="datetime-local"], select, textarea {
    width: 100%;
    border: 1px solid #dfe7ec;
    background: #fff;
    min-height: 40px;
    padding: 10px 12px;
    outline: none;
    font: inherit;
    color: #26323b;
    direction: ltr;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,169,232,.13); }
.grid { display: grid; gap: 18px 28px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.compact { gap: 12px; }
.hidden { display: none !important; }
.hint { color: #7c8992; font-size: 13px; margin: 8px 0 0; }
.check, .switchline { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.accordion { background: #fff; border: 1px solid var(--line); margin-top: 20px; }
.accordion-head { height: 50px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; color: #5e6870; border-bottom: 1px solid var(--line); font-weight: 700; }
.accordion-head:after { content: '+'; color: #9aa5ad; font-size: 24px; }
.accordion-body { padding: 16px; }
input[type="color"] { width: 100%; height: 42px; border: 1px solid #dfe7ec; background: #fff; padding: 4px; }
.primary-btn, .secondary-btn {
    display: inline-flex;
    border: 0;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 800;
    font-size: 16px;
    margin-top: 22px;
}
.primary-btn { background: var(--green); color: #fff; }
.primary-btn:hover { background: var(--green); }
.primary-btn.small { min-height: 40px; font-size: 14px; margin-top: 0; }
.secondary-btn { background: #edf7fc; color: #117cad; border: 1px solid #b9e5f7; }
.preview-card {
    background: #fff;
    padding: 38px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    direction: ltr;
}
.empty-preview { justify-content: center; }
.qr-placeholder {
    width: 240px;
    height: 240px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f4f7a, #081b2c);
    color: #fff;
    font-size: 54px;
    font-weight: 900;
    letter-spacing: -4px;
    margin-bottom: 22px;
}
.preview-card h3 { margin: 0 0 8px; }
.preview-card p { color: var(--muted); margin: 0 0 18px; line-height: 1.7; }
.download-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.download-buttons a, .download-buttons span {
    border: 1px solid #68c9f3;
    color: #2aaee8;
    background: #fff;
    padding: 12px 16px;
    border-radius: 4px;
    font-weight: 700;
}
.download-buttons a:first-child { background: #6ec8ef; color: #fff; border-color: #6ec8ef; }
.download-buttons.muted span { opacity: .5; }
.latest-list { margin-top: 28px; }
.latest-list h2 { font-size: 22px; }
.cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.04); }
.mini-card strong { display: block; margin-bottom: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card span { color: var(--muted); font-size: 12px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 24px; align-items: start; direction: ltr; }
.result-info, .panel { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 30px; direction: rtl; }
.result-info h1 { margin: 14px 0 10px; font-size: 30px; }
.result-info p { color: var(--muted); }
.back-link { color: #0b8ec6; font-weight: 700; }
.note-box { background: #f3f9fc; border: 1px solid #cfeef9; color: #315669; padding: 16px; border-radius: 14px; line-height: 1.8; margin: 22px 0; }
.result-card { border-radius: 18px; box-shadow: var(--shadow); }
.qr-image { width: 100%; max-width: 330px; height: auto; image-rendering: crisp-edges; }
.quality-line { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8a96a0; margin: 18px 0 2px; border-top: 4px solid #d8e2f5; padding-top: 12px; }
.quality-line strong { color: #697580; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 22px; }
.panel-head h1 { margin: 0; }
.panel-head p { margin: 6px 0 0; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f3f7fa; font-size: 13px; color: #64717b; }
.url-cell { max-width: 420px; direction: ltr; text-align: left; overflow-wrap: anywhere; }
.actions { display: flex; gap: 10px; align-items: center; }
.actions a, .actions button { border: 1px solid #c8d7df; background: #fff; color: #146a90; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.panel.narrow { max-width: 720px; margin: 0 auto; }
.edit-form { margin-top: 22px; }
@media (max-width: 980px) {
    .workspace, .result-layout { grid-template-columns: 1fr; }
    .grid.three, .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .topbar { padding: 0 16px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .top-links { width: 100%; }
    .form-content, .section-title { margin-left: 16px; margin-right: 16px; padding-left: 0; padding-right: 0; }
    .grid.two, .grid.three, .cards-grid { grid-template-columns: 1fr; }
    .preview-card { padding: 28px 18px; }
}
.logout-form { margin: 0; display: inline-flex; align-items: center; }
.logout-form button { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 700; }
.auth-card { max-width: 900px; margin: 30px auto; background: #fff; border-radius: 22px; box-shadow: var(--shadow); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.auth-intro { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-intro h1 { margin: 18px 0 10px; font-size: 34px; }
.auth-intro p { line-height: 1.8; opacity: .88; }
.brand-mark.large { width: 58px; height: 58px; border-radius: 18px; font-size: 20px; }
.auth-form { padding: 44px; }
.primary-btn.full { width: 100%; }
.remember { margin-top: 18px; }
.small-note { font-size: 13px; }
code { direction: ltr; display: inline-block; background: #eef5f8; padding: 1px 5px; border-radius: 5px; }
.dashboard-panel { padding: 26px; }
.filters-form { display: grid; grid-template-columns: minmax(220px, 1fr) 170px 170px auto; gap: 10px; margin-bottom: 18px; align-items: end; }
.filter-btn { margin-top: 0; min-height: 42px; }
.stats-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stats-row div { background: #f3f9fc; border: 1px solid #d7edf6; border-radius: 14px; padding: 14px 16px; }
.stats-row strong { display: block; font-size: 26px; color: var(--green-dark); }
.stats-row span { color: var(--muted); font-size: 13px; }
.table-title { font-weight: 800; color: #12384f; display: block; margin-bottom: 5px; }
td small { color: var(--muted); display: block; }
.badge { display: inline-flex; background: #eef3f6; color: #5d6b75; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; margin: 2px; }
.badge.green { background: #e6f6ed; color: var(--green-dark); }
.status-pill { border: 0; border-radius: 999px; padding: 7px 11px; background: #fff0f0; color: #a23b3b; font-weight: 800; cursor: pointer; }
.status-pill.active { background: #e6f6ed; color: var(--green-dark); }
.download-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.download-mini a { border: 1px solid #b9e5f7; color: #1588be; background: #f7fcff; border-radius: 7px; padding: 7px 9px; font-size: 12px; font-weight: 800; }
.actions .danger-btn { color: #b34343; border-color: #f0c6c6; }
.pagination-wrap { margin-top: 18px; }
.pagination-wrap nav { display: flex; justify-content: center; }
.edit-shell { margin-bottom: 30px; }
.single-tab { padding-left: 22px; }
@media (max-width: 980px) {
    .auth-card { grid-template-columns: 1fr; }
    .filters-form { grid-template-columns: 1fr 1fr; }
    .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .filters-form, .stats-row { grid-template-columns: 1fr; }
}
