/* ============================================================
   KANIL PRWIRE — CLIENT DASHBOARD CSS v2.0
   PATH: dashboard/assets/css/dash.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ink:  #0c0e12;
  --i2:   #353840;
  --i3:   #6c717d;
  --bg:   #f4f3f0;
  --bg2:  #eeede9;
  --bg3:  #e5e4df;
  --ln:   #dddbd6;
  --wh:   #ffffff;
  --bl:   #1b4fdb;
  --bld:  #1239b0;
  --bll:  #edf1fc;
  --gn:   #0a6b49;
  --gnl:  #d1fae5;
  --am:   #b45309;
  --aml:  #fef3c7;
  --rd:   #dc2626;
  --rdl:  #fee2e2;
  --pp:   #7c3aed;
  --ppl:  #ede9fe;
  --nav-h: 60px;
  --r:  6px;
  --r-lg: 10px;
}

body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }

/* ── TOPNAV ────────────────────────────────────────────── */
.topnav {
  height: var(--nav-h);
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 40px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.topnav-logo img { height: 28px; filter: brightness(10); opacity: .9; }
.topnav-logo-tag { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bl); background: rgba(27,79,219,.25); padding: 2px 8px; border-radius: 3px; }

.topnav-links { display: flex; align-items: center; gap: 2px; }
.topnav-link {
  padding: 7px 12px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255,255,255,.55);
  transition: all .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topnav-link svg { opacity: .6; }
.topnav-link:hover  { background: rgba(255,255,255,.07); color: #fff; }
.topnav-link:hover svg { opacity: .9; }
.topnav-link.active { background: rgba(27,79,219,.25); color: #fff; }
.topnav-link.active svg { opacity: 1; }

.topnav-right { display: flex; align-items: center; gap: 8px; }

/* Credits badge in nav */
.topnav-credits {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.08);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
}
.topnav-credits svg { opacity: .6; }

/* Bell */
.topnav-bell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: rgba(255,255,255,.55);
  transition: all .15s;
}
.topnav-bell:hover { background: rgba(255,255,255,.07); color: #fff; }
.topnav-bell-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--rd); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--ink);
}

/* User dropdown */
.topnav-user-dropdown { position: relative; }
.topnav-avatar-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}
.topnav-avatar-btn:hover { background: rgba(255,255,255,.07); }
.topnav-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bl); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.topnav-user-name { font-size: 12px; font-weight: 600; color: rgba(255,255,255,.75); }

.user-dd-menu {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--wh);
  border: 1px solid var(--ln);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,.12);
  min-width: 180px;
  padding: 6px;
  z-index: 200;
}
.topnav-user-dropdown.open .user-dd-menu { display: block; }
.user-dd-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--i2);
  border-radius: 4px;
  transition: background .12s;
}
.user-dd-menu a:hover { background: var(--bg); }
.user-dd-menu a svg { color: var(--i3); flex-shrink: 0; }
.user-dd-menu hr { border: none; border-top: 1px solid var(--ln); margin: 4px 0; }
.user-dd-menu .dd-logout { color: var(--rd); }

.topnav-hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 4px; }
.topnav-hamburger span { width: 20px; height: 2px; background: rgba(255,255,255,.6); border-radius: 2px; display: block; }

/* Mobile nav */
.mobile-nav { display: none; position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--ink); z-index: 99; padding: 8px 16px 16px; border-top: 1px solid rgba(255,255,255,.07); max-height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.mobile-nav.open { display: block; }
.mobile-nav .topnav-link { display: flex; margin-bottom: 2px; }

/* ── MAIN ──────────────────────────────────────────────── */
.dash-main { max-width: 1100px; margin: 0 auto; padding: clamp(20px, 4vw, 36px) clamp(16px, 4vw, 32px); }

/* ── FLASH ── */
.flash { padding: 12px 16px; border-radius: var(--r); font-size: 13px; font-weight: 500; margin-bottom: 16px; border-left: 3px solid; }
.flash-success { background: var(--gnl); color: var(--gn); border-color: var(--gn); }
.flash-error   { background: var(--rdl); color: var(--rd); border-color: var(--rd); }
.flash-warning { background: var(--aml); color: var(--am); border-color: var(--am); }
.flash-info    { background: var(--bll); color: var(--bl); border-color: var(--bl); }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 18px; font-weight: 700; color: var(--ink); }
.page-header-sub { font-size: 13px; color: var(--i3); margin-top: 2px; }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--wh); border: 1px solid var(--ln); border-radius: var(--r-lg); padding: 16px 18px; }
.stat-card-n { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 4px; }
.stat-card-l { font-size: 10.5px; font-weight: 600; color: var(--i3); letter-spacing: .08em; text-transform: uppercase; }
.stat-card.pending .stat-card-n { color: var(--am); }
.stat-card.success .stat-card-n { color: var(--gn); }

/* ── TABLE ── */
.table-wrap { background: var(--wh); border: 1px solid var(--ln); border-radius: var(--r-lg); overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ln); gap: 10px; flex-wrap: wrap; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 9px 14px; text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--i3); background: var(--bg); border-bottom: 1px solid var(--ln); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--bg3); color: var(--i2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg); }
.tbl-title { font-weight: 600; color: var(--ink); display: block; margin-bottom: 2px; }
.tbl-sub { font-size: 11px; color: var(--i3); display: block; }

/* ── BADGES ── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; white-space: nowrap; }
.badge-draft, .badge-gray       { background: var(--bg3);  color: var(--i3); }
.badge-pending, .badge-amber    { background: var(--aml);  color: var(--am); }
.badge-approved, .badge-blue    { background: var(--bll);  color: var(--bl); }
.badge-published, .badge-green,
.badge-active, .badge-live      { background: var(--gnl);  color: var(--gn); }
.badge-rejected, .badge-red     { background: var(--rdl);  color: var(--rd); }
.badge-pr                       { background: var(--bll);  color: var(--bld); }
.badge-gp                       { background: var(--gnl);  color: var(--gn); }
.badge-purple                   { background: var(--ppl);  color: var(--pp); }
.badge-submitted  { background: var(--bll);  color: var(--bl); }
.badge-in_review  { background: var(--ppl);  color: var(--pp); }
.badge-processing { background: var(--ppl);  color: var(--pp); }
.badge-cancelled  { background: var(--bg3);  color: var(--i3); }
.badge-suspended  { background: var(--rdl);  color: var(--rd); }
.badge-in\ progress { background: var(--ppl);  color: var(--pp); }
.badge-open       { background: var(--bll);  color: var(--bl); }
.badge-closed     { background: var(--bg3);  color: var(--i3); }
.badge-resolved   { background: var(--gnl);  color: var(--gn); }
.badge-completed  { background: var(--gnl);  color: var(--gn); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font); font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 4px; border: 1.5px solid transparent; cursor: pointer; transition: all .15s; white-space: nowrap; text-decoration: none; }
.btn-primary   { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--bl); border-color: var(--bl); }
.btn-secondary { background: var(--wh); color: var(--ink); border-color: var(--ln); }
.btn-secondary:hover { border-color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-wa { background: #25d366; color: #fff; border-color: #25d366; }
.btn-wa:hover { background: #1da851; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ln); }

/* ── FORMS ── */
.form-card { background: var(--wh); border: 1px solid var(--ln); border-radius: var(--r-lg); overflow: hidden; }
.form-card-header { padding: 12px 18px; border-bottom: 1px solid var(--ln); background: var(--bg); font-size: 13px; font-weight: 700; color: var(--ink); }
.form-card-body { padding: 18px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label.form-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--i3); }
.req { color: var(--rd); margin-left: 2px; }
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], select, textarea {
  font-family: var(--font); font-size: 13px; color: var(--ink);
  background: var(--wh); border: 1.5px solid var(--ln); border-radius: 4px;
  padding: 9px 12px; width: 100%; outline: none; transition: border-color .18s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--bl); }
input::placeholder, textarea::placeholder { color: var(--i3); opacity: .7; }
textarea { min-height: 90px; resize: vertical; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' viewBox='0 0 10 6'%3E%3Cpath stroke='%236c717d' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.form-help { font-size: 11px; color: var(--i3); margin-top: 3px; }

/* Editor */
.editor-wrap { border: 1.5px solid var(--ln); border-radius: 4px; overflow: hidden; transition: border-color .18s; }
.editor-wrap:focus-within { border-color: var(--bl); }
.editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: var(--bg); border-bottom: 1px solid var(--ln); flex-wrap: wrap; }
.editor-btn { background: none; border: none; padding: 4px 7px; border-radius: 3px; font-size: 13px; cursor: pointer; color: var(--i2); font-family: var(--font); transition: background .12s; }
.editor-btn:hover { background: var(--bg3); }
.editor-sep { width: 1px; height: 18px; background: var(--ln); margin: 0 3px; }
.editor-area { min-height: 220px; padding: 12px 14px; font-size: 14px; line-height: 1.8; color: var(--ink); outline: none; font-family: var(--font); }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--i3); opacity: .7; pointer-events: none; }

/* ── ORDER TYPE SELECTOR ── */
.type-card { flex: 1; cursor: pointer; }
.type-card input[type="radio"] { display: none; }
.type-card-inner {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid var(--ln);
  border-radius: var(--r);
  transition: all .15s;
}
.type-card-inner strong { font-size: 13px; color: var(--ink); }
.type-card-inner span { font-size: 11px; color: var(--i3); }
.type-card input:checked + .type-card-inner {
  border-color: var(--bl);
  background: var(--bll);
}

/* ── SITE SELECTION GRID ── */
.site-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bg3);
  cursor: pointer;
  transition: background .1s;
}
.site-row:hover { background: var(--bg); }
.site-row:last-child { border-bottom: none; }
.site-row input[type="checkbox"] {
  width: 18px; height: 18px; flex-shrink: 0;
  accent-color: var(--bl);
}
.site-info { flex: 1; min-width: 0; }
.site-name { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.site-meta { font-size: 11px; color: var(--i3); margin-top: 2px; }
.site-cost { font-size: 12px; font-weight: 700; color: var(--bl); white-space: nowrap; flex-shrink: 0; }

/* ── ORDER VIEW DETAIL GRID ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--i3); }
.detail-item span:last-child { font-size: 13px; color: var(--ink); }
.content-preview { font-size: 13.5px; line-height: 1.75; color: var(--i2); max-height: 400px; overflow-y: auto; }
.content-preview h3 { font-size: 15px; margin: 16px 0 6px; }
.content-preview p { margin-bottom: 10px; }
.content-preview ul, .content-preview ol { padding-left: 20px; margin-bottom: 10px; }

/* Site status rows in order view */
.site-status-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--bg3);
}
.site-status-row:last-child { border-bottom: none; }
.live-link { font-size: 11px; color: var(--bl); font-weight: 600; }
.live-link:hover { text-decoration: underline; }

/* ── STATUS TIMELINE ── */
.status-timeline { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; overflow-x: auto; justify-content: center; }
.st-step { display: flex; align-items: center; gap: 0; }
.st-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ln); background: var(--wh); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--i3); flex-shrink: 0; }
.st-dot.done    { background: var(--gn); border-color: var(--gn); color: #fff; }
.st-dot.current { background: var(--bl); border-color: var(--bl); color: #fff; }
.st-dot.rejected{ background: var(--rd); border-color: var(--rd); color: #fff; }
.st-label { font-size: 10px; color: var(--i3); margin-top: 4px; white-space: nowrap; }
.st-line  { width: 40px; height: 2px; background: var(--ln); flex-shrink: 0; }
.st-line.done { background: var(--gn); }
.st-item  { display: flex; flex-direction: column; align-items: center; }

/* ── NOTIFICATIONS ── */
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg3);
  transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--bll); }
.notif-item.unread:hover { background: #e2e8fc; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ln); flex-shrink: 0; margin-top: 5px; }
.notif-dot.active { background: var(--bl); }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--i3); margin-top: 2px; }
.notif-msg { font-size: 11.5px; color: var(--i3); margin-top: 3px; line-height: 1.45; }

/* Full-width notification items */
.notif-item-full {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--bg3);
  transition: background .1s;
}
.notif-item-full:last-child { border-bottom: none; }
.notif-item-full:hover { background: var(--bg); }
.notif-item-full.unread { background: var(--bll); }

/* ── TICKET THREAD ── */
.ticket-thread { display: flex; flex-direction: column; gap: 12px; }
.ticket-msg {
  background: var(--wh);
  border: 1px solid var(--ln);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.ticket-msg.msg-admin { border-left: 3px solid var(--bl); }
.ticket-msg.msg-client { border-left: 3px solid var(--ink); }
.ticket-msg-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--ln);
}
.ticket-msg-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.ticket-msg-body { padding: 14px 16px; font-size: 13.5px; line-height: 1.7; color: var(--i2); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--i3); }
.empty-state-icon { font-size: 28px; margin-bottom: 10px; }
.empty-state h3 { font-size: 14px; font-weight: 600; color: var(--i2); margin-bottom: 5px; }
.empty-state p { font-size: 13px; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--ln); flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 7px; border: 1.5px solid var(--ln); border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--i2); background: var(--wh); transition: all .15s; }
.page-btn:hover  { border-color: var(--bl); color: var(--bl); }
.page-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--wh); border-radius: var(--r-lg); max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-header { padding: 14px 18px; border-bottom: 1px solid var(--ln); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--i3); cursor: pointer; padding: 2px 6px; border-radius: 3px; }
.modal-close:hover { background: var(--bg2); }
.modal-body   { padding: 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--ln); display: flex; justify-content: flex-end; gap: 8px; }

/* ── FILTER BAR ── */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-bar input[type="search"] { flex: 1; min-width: 200px; }

/* ── LOGIN PAGE ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.login-card { background: var(--wh); border: 1px solid var(--ln); border-radius: var(--r-lg); padding: clamp(28px, 5vw, 44px); width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { height: 34px; }
.login-tag { text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--bl); background: var(--bll); display: inline-block; padding: 3px 10px; border-radius: 3px; }
.login-btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; margin-top: 6px; }
.login-error { background: var(--rdl); color: var(--rd); border-left: 3px solid var(--rd); padding: 10px 14px; border-radius: 4px; font-size: 13px; margin-bottom: 14px; }

/* ── MISC ── */
.text-muted { color: var(--i3); }
.text-sm    { font-size: 12px; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.flex  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr) !important; }
  div[style*="grid-template-columns:2fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 768px) {
  .topnav-links { display: none; }
  .topnav-hamburger { display: flex; }
  .topnav-user-name { display: none; }
  .topnav-credits span { display: none; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr !important; }
  .tbl th:nth-child(n+5), .tbl td:nth-child(n+5) { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr !important; }
  .type-card-inner { padding: 10px 12px; }
}