/* HamrahTel demo — shared product-app theme */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e3e6eb;
  --text: #1a1d29;
  --text-muted: #6b7280;
  --brand: #2f5bea;
  --brand-dark: #1f3fb0;
  --ok: #17845b;
  --ok-bg: #e7f7f0;
  --warn: #b45309;
  --warn-bg: #fef3e2;
  --danger: #c0293c;
  --danger-bg: #fdeaec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 18px; flex: 1; }
.nav-link { color: var(--text-muted); font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav-link.active, .nav-link:hover { color: var(--text); border-bottom-color: var(--brand); text-decoration: none; }

.app-switcher { position: relative; }
.switcher-trigger {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer; color: var(--text);
}
.switcher-menu {
  display: none; position: absolute; top: 110%; left: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow);
  min-width: 200px; padding: 6px; z-index: 30;
}
.switcher-menu.open { display: block; }
.switcher-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 14px; }
.switcher-item:hover { background: var(--bg); text-decoration: none; }
.switcher-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.header-right { margin-left: auto; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.balance-pill, .plan-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.balance-pill { background: #eef2ff; color: var(--brand-dark); transition: background .3s; }
.balance-pill.pulse { background: #d7e0ff; }
.balance-icon { opacity: .8; }
.balance-label { font-weight: 400; opacity: .7; }
.plan-pill { background: #f1f3f5; color: var(--text-muted); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.user-name { font-size: 14px; font-weight: 500; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-primary:disabled { background: #c6ccd8; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }

.page { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; margin: 0 0 4px; }
.page-header p { color: var(--text-muted); margin: 0; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card + .card { margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

.action-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow);
}
.action-card-blocked { background: #fafbfc; }
.action-card-body h3 { margin: 0 0 6px; font-size: 16px; }
.action-card-body p { margin: 0; color: var(--text-muted); font-size: 13px; }
.gate-reason { margin-top: 10px; padding: 8px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; }
.gate-reason-permission, .gate-reason-plan { background: var(--warn-bg); color: var(--warn); }
.gate-reason-credits { background: var(--danger-bg); color: var(--danger); }
.action-card-footer { display: flex; align-items: center; justify-content: space-between; }
.action-cost { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: #eef2ff; color: var(--brand-dark); }

table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
table.simple th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #f1f3f5; color: var(--text-muted); }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef2ff, #f5f6f8); }
.login-card { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); padding: 36px; width: 380px; }
.login-card h1 { font-size: 20px; margin: 0 0 4px; }
.login-card p.sub { color: var(--text-muted); margin: 0 0 20px; font-size: 13.5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; }
.persona-list { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.persona-list h4 { font-size: 12.5px; text-transform: uppercase; color: var(--text-muted); margin: 0 0 8px; }
.persona-btn {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 9px 12px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); cursor: pointer; font-size: 13px; text-align: left;
}
.persona-btn:hover { border-color: var(--brand); }
.persona-btn small { color: var(--text-muted); }

.helper-text { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
