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

:root {
  --ink: #132a2a;
  --muted: #6b7d7b;
  --line: #dfe9e6;
  --soft: #f4f8f6;
  --paper: #ffffff;
  --navy: #102c2b;
  --green: #1ba97f;
  --green-dark: #087a5a;
  --green-soft: #dff6ed;
  --blue-soft: #e6f1ff;
  --violet-soft: #eee9ff;
  --danger: #c94545;
  --shadow: 0 16px 40px rgba(20, 53, 48, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--soft); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--soft); font-family: "IBM Plex Sans Arabic", Tahoma, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; direction: rtl; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 22px 22px; color: #eef9f6; background: var(--navy); display: flex; flex-direction: column; gap: 26px; overflow: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #0d382f; background: #6ee7c0; font-weight: 800; font-size: 22px; box-shadow: 0 8px 20px rgba(73, 218, 171, .25); }
.brand span:last-child { display: grid; line-height: 1.25; }
.brand strong { font-size: 17px; }
.brand small { color: #86aaa4; direction: ltr; font-size: 11px; letter-spacing: .12em; }
.nav { display: grid; gap: 7px; }
.nav a { padding: 11px 13px; display: flex; align-items: center; gap: 12px; color: #a9c3be; border-radius: 11px; transition: .2s; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(49, 205, 157, .22), rgba(49, 205, 157, .08)); box-shadow: inset -3px 0 #45d5a6; }
.nav-icon { width: 23px; text-align: center; color: #6fe0bd; font-size: 20px; }
.sidebar-status { margin-top: auto; padding: 14px; display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07); border-radius: 13px; }
.sidebar-status span:nth-child(2) { display: grid; font-size: 12px; }
.sidebar-status small { color: #89a9a3; direction: ltr; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #44d7a8; box-shadow: 0 0 0 5px rgba(68,215,168,.12); }
.logout-form { margin-top: -14px; }
.sidebar .ghost-button { width: 100%; color: #a9c3be; border-color: rgba(255,255,255,.1); }

.content { padding: 30px clamp(24px, 4vw, 58px) 60px; min-width: 0; }
.topbar { min-height: 62px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.topbar h1 { margin: 1px 0 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--green-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.admin-chip { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.admin-chip b { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--green-dark); border-radius: 50%; }

.hero-strip { overflow: hidden; position: relative; min-height: 180px; padding: 34px 38px; display: flex; align-items: center; justify-content: space-between; color: #f3fffb; background: linear-gradient(125deg, #0c3c34, #12664f); border-radius: 22px; box-shadow: var(--shadow); }
.hero-strip::before, .hero-strip::after { content: ""; position: absolute; border: 1px solid rgba(118,241,196,.2); border-radius: 50%; }
.hero-strip::before { width: 300px; height: 300px; left: -80px; top: -170px; }
.hero-strip::after { width: 180px; height: 180px; left: 70px; bottom: -135px; }
.hero-strip h2 { margin: 12px 0 3px; font-size: clamp(25px, 3vw, 38px); }
.hero-strip p { margin: 0; color: #b9d8d0; }
.hero-strip .primary-button { z-index: 1; background: #fff; color: #0e6048; }
.live-label { display: inline-flex; gap: 8px; align-items: center; color: #a7f5db; font-size: 12px; }
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: #62edbd; box-shadow: 0 0 0 5px rgba(98,237,189,.12); }

.stat-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.stat-card { min-height: 135px; padding: 23px; display: flex; gap: 17px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 26px rgba(20,53,48,.045); }
.stat-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; font-size: 23px; }
.stat-card.mint .stat-icon { color: #0d8060; background: var(--green-soft); }
.stat-card.blue .stat-icon { color: #3577bd; background: var(--blue-soft); }
.stat-card.violet .stat-icon { color: #7056b5; background: var(--violet-soft); }
.stat-card div { display: grid; }
.stat-card small { color: var(--muted); }
.stat-card strong { font-size: 34px; line-height: 1.1; }
.stat-card em { color: #94a29f; font-size: 11px; font-style: normal; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 9px 28px rgba(20,53,48,.045); }
.panel-head { padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 3px 0 0; font-size: 19px; }
.text-link { color: var(--green-dark); font-weight: 600; font-size: 13px; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th { padding: 13px 18px; color: #7a8d88; background: #f8faf9; font-size: 11px; text-align: right; }
td { padding: 15px 18px; border-top: 1px solid #edf2f0; }
td:first-child { display: table-cell; }
td .avatar + strong { margin-inline-start: 9px; }
tbody tr { transition: .15s; }
tbody tr:hover { background: #fbfdfc; }
.clickable-row { cursor: pointer; }
.avatar { width: 29px; height: 29px; display: inline-grid; place-items: center; color: #146d55; background: #e3f6ef; border-radius: 9px; font-weight: 700; }
.avatar.large { width: 42px; height: 42px; border-radius: 12px; font-size: 17px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.message-preview { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.pill { padding: 5px 10px; display: inline-flex; align-items: center; border-radius: 99px; font-size: 11px; font-weight: 700; }
.pill.success { color: #087a59; background: #def6ed; }
.pill.simulated { color: #285f96; background: #e4f0ff; border: 1px solid #c7ddf7; }
.pill.neutral { color: #6c7775; background: #ecf0ef; }
.empty-state { padding: 50px 20px; text-align: center; color: var(--muted); }
.empty-state > span { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 10px; color: var(--green-dark); background: var(--green-soft); border-radius: 15px; font-size: 24px; }
.empty-state h3 { margin: 8px 0 4px; color: var(--ink); }
.empty-state p { margin: 0; }

.primary-button, .secondary-button, .ghost-button { min-height: 43px; padding: 10px 17px; display: inline-flex; justify-content: center; align-items: center; border-radius: 11px; border: 1px solid transparent; font-weight: 700; font-size: 13px; transition: .18s; }
.primary-button { color: #fff; background: var(--green-dark); box-shadow: 0 8px 18px rgba(8,122,90,.18); }
.primary-button:hover { transform: translateY(-1px); background: #076b4f; }
.secondary-button { color: var(--green-dark); background: #eff8f5; border-color: #cfe8df; }
.ghost-button { color: var(--ink); background: transparent; border-color: var(--line); }
.ghost-button.danger { color: var(--danger); border-color: #f0cccc; }
.wide { width: 100%; }
.center { text-align: center; }

.notice { margin-bottom: 18px; padding: 13px 16px; border-radius: 11px; font-size: 13px; }
.notice.success { color: #087a59; background: #e4f8f1; border: 1px solid #c6eadf; }
.notice.error { color: #a13b3b; background: #fff0f0; border: 1px solid #f2d0d0; }

.split-layout { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.3fr); align-items: start; gap: 20px; }
.form-panel .panel-head, .customer-list-panel .panel-head { min-height: 83px; }
.stack-form { padding: 22px 24px 25px; display: grid; gap: 15px; }
.stack-form.compact { padding: 18px 0 8px; }
.stack-form label, .filter-form label { display: grid; gap: 7px; color: #3a514e; font-size: 12px; font-weight: 700; }
.stack-form label small { color: #8b9a97; font-weight: 400; }
input, select { width: 100%; min-height: 43px; padding: 9px 12px; color: var(--ink); background: #fbfdfc; border: 1px solid #cfddda; border-radius: 10px; outline: none; }
input:focus, select:focus { border-color: #43af8e; box-shadow: 0 0 0 3px rgba(67,175,142,.12); }
.form-row { display: grid; grid-template-columns: 1fr 110px; gap: 12px; }
.form-row.wide-first { grid-template-columns: 1fr 110px; }
.customer-list { padding: 6px 18px 18px; }
.customer-item { border-bottom: 1px solid var(--line); }
.customer-item:last-child { border-bottom: 0; }
.customer-item summary { padding: 15px 4px; display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 13px; cursor: pointer; list-style: none; }
.customer-item summary::-webkit-details-marker { display: none; }
.customer-main { display: grid; }
.customer-main small { color: var(--muted); }
.customer-count { min-width: 48px; display: grid; text-align: center; }
.customer-count b { line-height: 1; }
.customer-count small { color: var(--muted); font-size: 10px; }
.customer-edit { padding: 0 58px 18px 5px; background: #fcfefd; border-radius: 12px; }
.button-row, .danger-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.danger-actions { padding: 13px 0 0; border-top: 1px dashed var(--line); justify-content: flex-start; }

.credentials-card { margin-bottom: 20px; overflow: hidden; color: #f2fffb; background: linear-gradient(120deg, #0d3c34, #12664f); border-radius: 18px; box-shadow: var(--shadow); }
.credentials-head { padding: 18px 22px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,.1); }
.credentials-head > div { display: flex; gap: 12px; align-items: center; }
.credentials-head div span:last-child { display: grid; }
.credentials-head small { color: #a7cfc4; }
.success-check { width: 37px; height: 37px; display: grid; place-items: center; color: #0b6048; background: #72e4bf; border-radius: 50%; font-weight: 800; }
.icon-button { color: #fff; background: transparent; border: 0; font-size: 28px; }
.credentials-grid { padding: 19px 22px 23px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.credentials-grid label { display: grid; gap: 5px; color: #9fc8bd; font-size: 11px; }
.password-credential { grid-column: span 2; }
.copy-line { min-width: 0; display: flex; align-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); border-radius: 9px; }
.copy-line code { padding: 9px 10px; flex: 1; overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: left; }
.copy-line button { align-self: stretch; padding: 0 10px; color: #8ceacb; background: transparent; border: 0; border-right: 1px solid rgba(255,255,255,.09); font-size: 11px; }
.copy-line button.copied { color: #fff; background: rgba(98,237,189,.15); }

.filter-head { flex-wrap: wrap; }
.filter-form select { min-width: 180px; }
.detail-grid { display: grid; grid-template-columns: 1.4fr .7fr; gap: 20px; align-items: start; }
.message-body { min-height: 220px; padding: 28px; font-size: 18px; line-height: 1.9; white-space: pre-wrap; }
.subject-line { margin: 0 25px 25px; padding-top: 16px; display: grid; color: var(--muted); border-top: 1px solid var(--line); }
.subject-line small { color: var(--green-dark); }
.metadata-card { padding-bottom: 20px; }
.metadata-card > .eyebrow { padding: 22px 22px 14px; }
.metadata-card dl { margin: 0 22px 20px; }
.metadata-card dl div { padding: 11px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.metadata-card dt { color: var(--muted); font-size: 12px; }
.metadata-card dd { margin: 0; text-align: left; word-break: break-word; }
.metadata-card .secondary-button { width: calc(100% - 44px); margin: 0 22px; }

.login-body { display: grid; grid-template-columns: minmax(480px, 1.2fr) minmax(420px, .8fr); background: #fff; }
.login-visual { min-height: 100vh; overflow: hidden; position: relative; display: grid; place-items: center; color: #f5fffb; background: radial-gradient(circle at 20% 25%, #187c5d, transparent 34%), linear-gradient(145deg, #0a2d29, #0d4a3b); }
.login-visual::before { content: ""; position: absolute; width: 440px; height: 440px; left: -190px; bottom: -180px; border: 1px solid rgba(128,240,201,.17); border-radius: 50%; box-shadow: 0 0 0 70px rgba(99,228,184,.025), 0 0 0 140px rgba(99,228,184,.018); }
.visual-copy { width: min(560px, 75%); position: relative; z-index: 1; }
.visual-badge { padding: 6px 10px; display: inline-block; color: #8af0ce; background: rgba(97,225,182,.1); border: 1px solid rgba(130,240,203,.18); border-radius: 99px; direction: ltr; font-size: 11px; letter-spacing: .12em; }
.visual-copy h1 { margin: 22px 0 10px; font-size: clamp(42px, 5vw, 70px); line-height: 1.15; letter-spacing: -.04em; }
.visual-copy > p { max-width: 440px; color: #a8c8c0; font-size: 16px; line-height: 1.8; }
.flow-card { margin-top: 42px; padding: 16px; display: flex; align-items: center; gap: 10px; color: #9ec7bc; background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.09); border-radius: 15px; backdrop-filter: blur(8px); }
.flow-node { flex: 1; padding: 12px; text-align: center; background: rgba(255,255,255,.045); border-radius: 9px; font-size: 12px; }
.flow-node.accent { color: #9ff4d7; background: rgba(73,210,165,.13); }
.signal { position: absolute; border: 1px solid rgba(111,231,190,.14); border-radius: 50%; }
.signal-one { width: 180px; height: 180px; right: 10%; top: -75px; }
.signal-two { width: 90px; height: 90px; right: 17%; top: -30px; }
.login-panel { min-height: 100vh; padding: 40px; display: grid; place-items: center; }
.login-box { width: min(400px, 100%); }
.login-box h2 { margin: 6px 0 3px; font-size: 34px; }
.muted { color: var(--muted); }
.login-box > .muted { margin: 0 0 26px; }
.login-form { display: grid; gap: 17px; }
.login-form label { display: grid; gap: 7px; color: #314b46; font-size: 13px; font-weight: 700; }
.login-form input { min-height: 49px; }
.password-field { position: relative; }
.password-field .reveal { position: absolute; left: 7px; top: 7px; bottom: 7px; padding: 0 9px; color: var(--green-dark); background: transparent; border: 0; font-size: 11px; }
.login-form .primary-button { min-height: 49px; margin-top: 3px; }
.secure-note { margin-top: 22px; color: #91a19d; text-align: center; font-size: 11px; }
.secure-note span { color: var(--green); }
.mobile-brand { margin-bottom: 44px; display: none; align-items: center; gap: 10px; }
.tester-link { margin-top: 14px; display: block; color: var(--green-dark); text-align: center; font-size: 13px; font-weight: 700; }

.test-body { min-height: 100vh; color: var(--ink); background: linear-gradient(140deg, #eaf5f1 0%, #f7faf9 48%, #edf4f2 100%); }
.test-header { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0; display: flex; align-items: center; justify-content: space-between; }
.test-header .brand { color: var(--ink); }
.test-header .brand small { color: var(--muted); }
.test-main { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 100px); margin: 0 auto; padding: 44px 0 70px; display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(45px, 7vw, 90px); align-items: center; }
.test-intro .live-label { color: var(--green-dark); font-weight: 700; }
.test-intro h1 { margin: 18px 0 14px; font-size: clamp(42px, 5vw, 67px); line-height: 1.12; letter-spacing: -.05em; }
.test-intro > p { max-width: 500px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.server-ticket { margin-top: 34px; overflow: hidden; display: grid; grid-template-columns: 1.7fr .65fr 1fr; background: var(--navy); border-radius: 15px; box-shadow: var(--shadow); }
.server-ticket div { min-width: 0; padding: 16px; display: grid; gap: 3px; border-left: 1px solid rgba(255,255,255,.08); }
.server-ticket div:last-child { border-left: 0; }
.server-ticket small { color: #83a9a1; font-size: 10px; direction: ltr; text-align: left; }
.server-ticket code { overflow: hidden; color: #dffff4; font-size: 12px; direction: ltr; text-align: left; text-overflow: ellipsis; }
.test-points { margin: 26px 0 0; padding: 0; display: grid; gap: 11px; color: #56706b; list-style: none; font-size: 13px; }
.test-points span { width: 22px; height: 22px; margin-left: 7px; display: inline-grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 50%; font-weight: 800; }
.test-form-card { overflow: hidden; background: rgba(255,255,255,.93); border: 1px solid #d6e5e1; border-radius: 22px; box-shadow: 0 24px 70px rgba(15, 62, 52, .12); backdrop-filter: blur(16px); }
.test-card-head { padding: 26px 30px 20px; border-bottom: 1px solid var(--line); }
.test-card-head h2 { margin: 4px 0 2px; font-size: 24px; }
.test-card-head > p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.test-result { margin: 20px 30px 0; padding: 13px 15px; display: flex; gap: 11px; align-items: flex-start; border-radius: 11px; font-size: 13px; }
.test-result span { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.test-result p { margin: 1px 0 0; }
.test-result.success { color: #07694e; background: #e2f7ef; border: 1px solid #bde7d8; }
.test-result.success span { color: #fff; background: var(--green-dark); }
.test-result.error { color: #963a3a; background: #fff0f0; border: 1px solid #efcaca; }
.test-result.error span { color: #fff; background: #be4747; }
.test-form { padding: 24px 30px 18px; display: grid; gap: 15px; }
.test-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.test-form label { display: grid; gap: 7px; color: #344f4a; font-size: 12px; font-weight: 700; }
.test-form textarea { width: 100%; min-height: 115px; padding: 12px; resize: vertical; color: var(--ink); background: #fbfdfc; border: 1px solid #cfddda; border-radius: 10px; outline: none; font: inherit; line-height: 1.7; }
.test-form textarea:focus { border-color: #43af8e; box-shadow: 0 0 0 3px rgba(67,175,142,.12); }
.test-submit { min-height: 50px; gap: 9px; font-size: 14px; }
.test-submit span { font-size: 20px; }
.test-privacy { margin: 0 30px 22px; color: #8b9996; text-align: center; font-size: 10px; }

@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 210px 1fr; }
  .sidebar { padding-inline: 16px; }
  .split-layout, .detail-grid { grid-template-columns: 1fr; }
  .credentials-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 110px; }
  .test-main { grid-template-columns: 1fr; padding-top: 25px; }
  .test-intro { max-width: 700px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .brand { grid-column: 1; }
  .nav { grid-column: 1 / -1; display: flex; overflow: auto; }
  .nav a { flex: 0 0 auto; }
  .sidebar-status, .logout-form { display: none; }
  .content { padding: 20px 15px 45px; }
  .topbar { min-height: 52px; }
  .admin-chip span { display: none; }
  .hero-strip { padding: 26px 22px; align-items: flex-start; flex-direction: column; gap: 24px; }
  .form-row, .form-row.wide-first { grid-template-columns: 1fr; }
  .credentials-grid { grid-template-columns: 1fr; }
  .password-credential { grid-column: auto; }
  .customer-item summary { grid-template-columns: 42px 1fr auto; }
  .customer-count { display: none; }
  .customer-edit { padding-right: 0; }
  .login-body { display: block; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 24px; }
  .mobile-brand { display: flex; }
  .test-header { width: min(100% - 28px, 1180px); padding: 15px 0; }
  .test-header .secondary-button { min-height: 38px; padding: 8px 11px; }
  .test-main { width: min(100% - 28px, 1180px); padding: 25px 0 45px; gap: 30px; }
  .test-intro h1 { font-size: 38px; }
  .server-ticket { grid-template-columns: 1fr; }
  .server-ticket div { border-left: 0; border-bottom: 1px solid rgba(255,255,255,.08); }
  .test-form-row { grid-template-columns: 1fr; }
  .test-card-head, .test-form { padding-left: 20px; padding-right: 20px; }
  .test-result { margin-left: 20px; margin-right: 20px; }
}
