/* VMDK Hosting billing - shared styles for the client area and admin area. */
:root {
  --navy: #0a3677;
  --navy-dark: #072756;
  --blue: #3f97e0;
  --blue-soft: #e8f2fc;
  --ink: #1d2733;
  --muted: #5f6b7a;
  --line: #dde3ea;
  --bg: #f4f6f9;
  --card: #ffffff;
  --green: #2e8540;
  --green-soft: #e6f4ea;
  --red: #c0392b;
  --red-soft: #fbeaea;
  --amber: #b26a00;
  --amber-soft: #fff4e0;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--navy); }
a:hover { color: var(--blue); }
h1 { font-size: 24px; margin: 0 0 16px; font-weight: 600; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .muted { color: var(--muted); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 10px; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- client shell ---------- */
.c-header { background: #fff; border-bottom: 1px solid var(--line); }
.c-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 72px; flex-wrap: wrap; }
.c-logo img { height: 48px; width: auto; display: block; }
.c-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.c-nav a { padding: 8px 10px; font-size: 15px; border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 500; }
.c-nav a:hover { background: var(--blue-soft); color: var(--navy); }
.c-nav a.active { background: var(--navy); color: #fff; }
.c-user { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.c-user a { text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.c-main { padding: 28px 0 48px; }
.c-footer { color: var(--muted); font-size: 13px; padding: 24px 0 40px; text-align: center; }
.masquerade { background: var(--amber-soft); color: var(--amber); border-bottom: 1px solid #f0d9ad; font-size: 14px; }
.masquerade .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; gap: 12px; }
.announcement { background: #fff6e5; border: 1px solid #f2c26b; border-left: 5px solid #e39b12; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.announcement h3 { margin-bottom: 4px; }
.announcement .date { color: var(--muted); font-size: 13px; }

/* ---------- admin shell ---------- */
.a-top { background: var(--navy-dark); color: #fff; }
.a-top .wrap-wide { display: flex; align-items: center; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.a-brand { font-weight: 700; letter-spacing: .3px; color: #fff; text-decoration: none; }
.a-nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.a-nav a { color: #cfe0f5; text-decoration: none; padding: 6px 7px; border-radius: 5px; font-size: 13.5px; }
.a-nav a:hover, .a-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.a-user { font-size: 13px; color: #cfe0f5; display: flex; gap: 12px; }
.a-user a { color: #fff; }
.a-env { background: #e39b12; color: #1d2733; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.a-main { padding: 22px 0 48px; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stat { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat.green { color: var(--green); }
.stat.amber { color: var(--amber); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--blue-soft); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.badge-paid, .badge-active, .badge-answered, .badge-completed, .badge-on, .badge-ok { background: var(--green-soft); color: var(--green); }
.badge-unpaid, .badge-open, .badge-customerreply, .badge-pending, .badge-reenroll { background: var(--amber-soft); color: var(--amber); }
.badge-overdue, .badge-cancelled, .badge-failed, .badge-closed, .badge-terminated, .badge-suspended, .badge-fraud { background: var(--red-soft); color: var(--red); }
.badge-refunded, .badge-collections, .badge-inprogress, .badge-onhold { background: var(--blue-soft); color: var(--navy); }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--green-soft); border-color: #b9dfc3; color: #1e5e2c; }
.alert-error { background: var(--red-soft); border-color: #f0c2bd; color: #8a2a20; }
.alert-info { background: var(--blue-soft); border-color: #c6dcf4; color: var(--navy); }
.alert-warning { background: var(--amber-soft); border-color: #f0d9ad; color: #7a4a00; }

/* ---------- forms ---------- */
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
.field small { display: block; margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c8d1db; border-radius: 6px; font: inherit; color: var(--ink); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
input[readonly] { background: #eef1f4; color: var(--muted); }
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 6px; }
.check input { margin-top: 4px; }
.inline-form { display: inline; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .form-row, .form-row-3 { grid-template-columns: 1fr; } }

.btn { display: inline-block; font: inherit; font-weight: 600; font-size: 14px; padding: 9px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.3; background: var(--navy); color: #fff; }
.btn:hover { background: var(--navy-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #c8d1db; }
.btn-secondary:hover { background: #f0f3f6; color: var(--ink); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #962d22; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #226632; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--navy); padding: 0; font-weight: 500; text-decoration: underline; cursor: pointer; font: inherit; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; font-size: 14px; }
.tabs a.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; margin-bottom: -1px; }

/* ---------- login pages ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box .card { padding: 28px; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo img { height: 70px; width: auto; }
.qr svg { width: 220px; height: 220px; display: block; margin: 0 auto 10px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; font-family: ui-monospace, Menlo, monospace; font-size: 16px; text-align: center; margin: 12px 0; }
.codes span { background: var(--bg); padding: 6px; border-radius: 5px; }

/* ---------- tickets ---------- */
.msg { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; background: #fff; }
.msg-head { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; font-size: 14px; gap: 10px; flex-wrap: wrap; }
.msg.staff .msg-head { background: var(--blue-soft); }
.msg.note .msg-head { background: var(--amber-soft); }
.msg-body { padding: 14px; overflow-wrap: anywhere; }
.msg-body p:last-child { margin-bottom: 0; }
.attachments { padding: 0 14px 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.attachments a { display: block; text-align: center; font-size: 12px; text-decoration: none; max-width: 160px; }
.attachments img { max-width: 160px; max-height: 120px; display: block; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 3px; }
.md-toolbar { display: flex; gap: 4px; margin-bottom: 4px; flex-wrap: wrap; }
.md-toolbar button { font: inherit; font-size: 13px; padding: 3px 8px; border: 1px solid #c8d1db; background: #fff; border-radius: 4px; cursor: pointer; }
.md-preview { border: 1px dashed #c8d1db; border-radius: 6px; padding: 10px; margin-top: 8px; display: none; background: #fff; }

/* ---------- cart ---------- */
.products { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.product { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.product h3 { font-size: 17px; }
.product .price { font-size: 22px; font-weight: 600; color: var(--navy); margin: 6px 0 10px; }
.product .desc { color: var(--muted); font-size: 14px; flex: 1; margin-bottom: 14px; }
.summary-line { display: flex; justify-content: space-between; padding: 6px 0; }
.summary-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 17px; }
#card-element { padding: 12px; border: 1px solid #c8d1db; border-radius: 6px; background: #fff; }

/* ---------- bar chart (reports) ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--blue); border-radius: 3px 3px 0 0; min-height: 1px; position: relative; }
.bars .bar:hover { background: var(--navy); }
.bar-labels { display: flex; gap: 4px; font-size: 11px; color: var(--muted); }
.bar-labels span { flex: 1; text-align: center; overflow: hidden; white-space: nowrap; }

@media print {
  .c-header, .c-footer, .masquerade, .no-print, .a-top { display: none !important; }
  body { background: #fff; }
}

/* Announcements box on the client home page */
.announcements { border-left: 5px solid #e39b12; margin-bottom: 18px; }
.announcements h2 { margin-bottom: 10px; }
.ann-item { padding: 10px 0; border-top: 1px solid var(--line); }
.ann-item:first-of-type { border-top: 0; padding-top: 0; }
.ann-head { margin-bottom: 4px; }
.ann-item summary { cursor: pointer; list-style: none; }
.ann-item summary::-webkit-details-marker { display: none; }
.ann-more::after { content: "Read more"; color: var(--blue); font-weight: 500; white-space: nowrap; }
.ann-item details[open] .ann-more::after { content: "Show less"; }
.ann-item details[open] .ann-preview { display: none; }
.ann-body p:last-child { margin-bottom: 0; }

/* Client menu: secondary items in an "Account" drop-down */
.c-menu { position: relative; }
.c-menu summary { list-style: none; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-weight: 500; font-size: 15px; color: var(--ink); }
.c-menu summary::-webkit-details-marker { display: none; }
.c-menu summary::after { content: " \25BE"; font-size: 12px; }
.c-menu summary:hover, .c-menu[open] summary { background: var(--blue-soft); color: var(--navy); }
.c-menu summary.active { background: var(--navy); color: #fff; }
.c-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 33, 60, .12); min-width: 200px; padding: 6px; display: flex; flex-direction: column; }
.c-menu-list a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.c-menu-list a:hover, .c-menu-list a.active { background: var(--blue-soft); color: var(--navy); }
.c-menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.grid-5 { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
