/* =========================================================================
   APEX-style mockup stylesheet — Service Desk Ticketing System
   Tuned to the Oracle APEX 26.1 DEFAULT Universal Theme (Vita / light):
   light header, light side navigation, APEX blue accents, small radii.
   These are STATIC mockups for layout review, not real APEX pages.
   ========================================================================= */

:root {
  --c-bg:        #f4f5f7;   /* app body */
  --c-surface:   #ffffff;
  --c-border:    #d8dce0;
  --c-border-lt: #e6e9ec;
  --c-text:      #2f3237;
  --c-muted:     #707880;
  --c-primary:   #0572ce;   /* APEX hot/link blue */
  --c-primary-d: #045aa3;
  --c-accent:    #0572ce;   /* APEX default keeps a single blue accent */
  --c-header:    #ffffff;   /* light top bar */
  --c-header-bd: #c9ced4;
  --c-nav:       #fbfbfc;   /* light side nav */
  --c-nav-hover: #eef1f4;
  --c-nav-active:#e8f1fb;
  --shadow:      0 1px 2px rgba(0,0,0,.06), 0 1px 1px rgba(0,0,0,.04);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.22);
  --radius:      4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App shell -------------------------------------------------- */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 50px 1fr;
  grid-template-areas:
    "header header"
    "sidebar main";
  min-height: 100vh;
}

.top-header {
  grid-area: header;
  background: var(--c-header);
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--c-header-bd);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  z-index: 20;
}
.top-header .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: .2px; color: var(--c-text);
}
.top-header .brand .logo {
  width: 28px; height: 28px; border-radius: 5px;
  background: var(--c-primary);
  display: grid; place-items: center; color: #fff; font-size: 15px;
}
.top-header .spacer { flex: 1; }
.top-header .hdr-item {
  color: var(--c-muted); display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 4px; cursor: default; font-size: 13px;
}
.top-header .hdr-item:hover { background: var(--c-nav-hover); }
.top-header .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}

/* ---------- Sidebar nav (t-TreeNav) ----------------------------------- */
.sidebar {
  grid-area: sidebar;
  background: var(--c-nav);
  color: var(--c-text);
  padding: 8px 0;
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
}
.nav-section {
  text-transform: uppercase; font-size: 10.5px; letter-spacing: .7px;
  color: #97a0a8; padding: 14px 16px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 16px; color: var(--c-text); cursor: default; font-size: 13.5px;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: var(--c-nav-hover); text-decoration: none; }
.nav-item.active {
  background: var(--c-nav-active); color: var(--c-primary-d);
  border-left-color: var(--c-primary); font-weight: 600;
}
.nav-item .ic { width: 18px; text-align: center; opacity: .85; }

/* ---------- Main content ---------------------------------------------- */
.main { grid-area: main; padding: 0; overflow-y: auto; }

.tenant-banner {
  background: #fff7ed; border-bottom: 1px solid #fed7aa;
  color: #9a3412; padding: 7px 24px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
}
.tenant-banner b { color: #7c2d12; }

.page-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 24px 4px;
}
.page-bar .titles h1 { margin: 0; font-size: 22px; font-weight: 500; color:#33373c; }
.page-bar .titles .crumb { color: var(--c-muted); font-size: 12.5px; }
.page-bar .actions { margin-left: auto; display: flex; gap: 8px; }

.content { padding: 12px 24px 40px; }

/* ---------- Cards (Regions) ------------------------------------------- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card .card-hd {
  padding: 12px 16px; border-bottom: 1px solid var(--c-border-lt);
  font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px;
}
.card .card-hd .sub { font-weight: 400; color: var(--c-muted); font-size: 12px; }
.card .card-bd { padding: 16px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px){ .cols-3,.cols-4{grid-template-columns:repeat(2,1fr);} }

/* ---------- Stat tiles (Badge List / Cards) --------------------------- */
.stat {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat .label { color: var(--c-muted); font-size: 12px; text-transform: uppercase; letter-spacing:.4px; }
.stat .value { font-size: 30px; font-weight: 600; line-height: 1.1; color:#33373c; }
.stat .delta { font-size: 12px; color: var(--c-muted); }
.stat .bar { height: 4px; border-radius: 4px; margin-top: 6px; }

/* ---------- Tables (Interactive Report / Grid) ------------------------ */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--c-border-lt);
  background: #f7f8f9; border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .search {
  flex: 1; min-width: 200px; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--c-border); border-radius: 4px;
  padding: 6px 10px; background: #fff; color: var(--c-muted);
}
.toolbar .search input { border: 0; outline: 0; flex: 1; font-size: 13px; }
.chip {
  border: 1px solid var(--c-border); background:#fff; border-radius: 14px;
  padding: 4px 11px; font-size: 12px; color: var(--c-text);
  display: inline-flex; gap: 6px; align-items: center;
}
.chip.on { background: var(--c-nav-active); border-color:#b9d8f5; color: var(--c-primary-d); }

table.t {
  width: 100%; border-collapse: collapse; background: var(--c-surface);
  font-size: 13px;
}
table.t th {
  text-align: left; padding: 10px 14px; color: var(--c-muted);
  font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing:.4px;
  border-bottom: 1px solid var(--c-border); background:#f7f8f9;
}
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--c-border-lt); }
table.t tr:hover td { background: #f5f9fd; }
table.t .ref { font-weight: 600; color: var(--c-primary); }
table.t .muted { color: var(--c-muted); }

/* ---------- Badges ---------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 12px; font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-new        { background:#eef2ff; color:#4338ca; }
.st-assigned   { background:#e0f2fe; color:#0369a1; }
.st-progress   { background:#fef9c3; color:#92740a; }
.st-hold       { background:#f3f4f6; color:#4b5563; }
.st-resolved   { background:#dcfce7; color:#15803d; }
.st-closed     { background:#e5e7eb; color:#374151; }

.pr-low      { background:#f1f5f9; color:#475569; }
.pr-medium   { background:#e0f2fe; color:#0369a1; }
.pr-high     { background:#ffedd5; color:#c2410c; }
.pr-critical { background:#fee2e2; color:#b91c1c; }

.role-pill {
  background:#eef2ff; color:#4338ca; border-radius: 4px;
  padding: 2px 8px; font-size: 11.5px; font-weight: 600;
}
.tag-active   { color:#15803d; font-weight:600; }
.tag-inactive { color:#b91c1c; font-weight:600; }

/* ---------- Buttons (t-Button) ---------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid #aeb4bd;
  background: linear-gradient(#ffffff, #f6f7f8); color: #33373c;
  padding: 7px 14px; border-radius: 4px; font-size: 13px; font-weight: 400;
  cursor: pointer;
}
.btn:hover { background: #eef1f4; text-decoration: none; }
.btn-primary, .btn-hot {
  background: var(--c-primary); border-color: var(--c-primary); color:#fff; font-weight:600;
}
.btn-primary:hover, .btn-hot:hover { background: var(--c-primary-d); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ---------- Forms ----------------------------------------------------- */
.form-grid { display: grid; gap: 16px 20px; }
.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 600; color: #44484d; }
.field label .req { color: #b91c1c; }
.field input, .field select, .field textarea {
  border: 1px solid #b4bac1; border-radius: 4px; padding: 8px 11px;
  font-size: 13.5px; font-family: inherit; background:#fff; color: var(--c-text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid #bcdcff; border-color: var(--c-primary);
}
.field textarea { resize: vertical; min-height: 96px; }
.field .hint { font-size: 11.5px; color: var(--c-muted); }
.switch { display:inline-flex; align-items:center; gap:8px; font-size:13px; }
.switch .track {
  width: 38px; height: 21px; background:#c2c8cf; border-radius: 12px; position: relative;
}
.switch .track::after{
  content:""; position:absolute; top:2px; left:2px; width:17px; height:17px;
  background:#fff; border-radius:50%; box-shadow: var(--shadow);
}
.switch.on .track { background: var(--c-primary); }
.switch.on .track::after { left: 19px; }

/* ---------- Timeline (history / comments) ----------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before {
  content:""; position: absolute; left: 6px; top: 4px; bottom: -4px;
  width: 2px; background: var(--c-border);
}
.timeline li:last-child::before { display:none; }
.timeline li .pt {
  position:absolute; left:0; top:3px; width: 14px; height: 14px;
  border-radius: 50%; background:#fff; border: 3px solid var(--c-primary);
}
.timeline li .meta { font-size: 12px; color: var(--c-muted); }
.timeline li .who { font-weight: 600; color: var(--c-text); }

.comment {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--c-border-lt);
}
.comment .av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--c-primary); color:#fff; display:grid; place-items:center;
  font-weight: 600; font-size: 13px;
}
.comment.internal .body { background:#fffbeb; border:1px solid #fde68a; border-radius:4px; padding:10px 12px; }
.comment .head { font-size:12.5px; color:var(--c-muted); margin-bottom:2px; }
.comment .head b { color: var(--c-text); }

/* ---------- Charts (faked) -------------------------------------------- */
.barchart { display:flex; align-items:flex-end; gap:18px; height:160px; padding-top:8px; }
.barchart .col { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; justify-content:flex-end; }
.barchart .col .bar { width:60%; border-radius:3px 3px 0 0; }
.barchart .col .n { font-weight:700; }
.barchart .col .lbl { font-size:11.5px; color:var(--c-muted); }

.legend { display:flex; flex-wrap:wrap; gap:10px 18px; margin-top:12px; }
.legend .li { display:flex; align-items:center; gap:7px; font-size:12.5px; color:#44484d; }
.legend .sw { width:11px; height:11px; border-radius:3px; }

/* ---------- Modal (Dialog) -------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,24,28,.5);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal {
  background:#fff; width: 100%; max-width: 560px; border-radius: 6px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal.lg { max-width: 680px; }
.modal .m-hd {
  padding: 14px 20px; border-bottom: 1px solid var(--c-border);
  display:flex; align-items:center; gap:10px;
}
.modal .m-hd h2 { margin:0; font-size:17px; font-weight:500; }
.modal .m-hd .x { margin-left:auto; color:var(--c-muted); cursor:pointer; font-size:18px; }
.modal .m-bd { padding: 20px; max-height: 70vh; overflow-y:auto; }
.modal .m-ft {
  padding: 14px 20px; border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: 10px; background:#f7f8f9;
}

/* Page behind a modal (dimmed preview) */
.behind { filter: blur(1.5px); pointer-events:none; user-select:none; }

/* ---------- Login ----------------------------------------------------- */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: #e9edf1;
  background-image: radial-gradient(900px 500px at 80% -10%, #dbe7f5, #e9edf1);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px; background:#fff; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 32px 30px;
  border-top: 4px solid var(--c-primary);
}
.login-card .brand { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.login-card .brand .logo {
  width: 38px; height:38px; border-radius:6px;
  background: var(--c-primary);
  display:grid; place-items:center; color:#fff; font-size:20px;
}
.login-card h1 { font-size: 19px; margin: 14px 0 2px; font-weight:500; }
.login-card p.sub { color: var(--c-muted); margin: 0 0 22px; font-size:13px; }

/* ---------- Misc ------------------------------------------------------ */
.muted { color: var(--c-muted); }
.right { text-align: right; }
.mt-0{margin-top:0;} .mb-0{margin-bottom:0;}
hr.sep { border:0; border-top:1px solid var(--c-border-lt); margin:18px 0; }
.kpi-dot{ width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:6px; }

/* ---------- Interactive demo additions ------------------------------- */
.btn-block { justify-content:center; width:100%; }
.login-error {
  background:#fee2e2; border:1px solid #fca5a5; color:#b91c1c;
  padding:9px 12px; border-radius:4px; font-size:12.5px; margin-bottom:12px;
}
.persona-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.persona {
  display:flex; flex-direction:column; align-items:flex-start; gap:1px;
  border:1px solid var(--c-border); background:#fff; border-radius:6px;
  padding:9px 11px; cursor:pointer; text-align:left;
}
.persona:hover { background:var(--c-nav-active); border-color:#b9d8f5; }
.persona .avatar { width:24px; height:24px; font-size:10px; margin-bottom:3px; }
.persona .p-name { font-weight:600; font-size:12.5px; color:var(--c-text); }
.persona .p-role { font-size:10.5px; color:var(--c-muted); }

.demo-foot {
  position:fixed; left:0; right:0; bottom:0; z-index:40;
  background:#1b2330; color:#cdd3dd; font-size:11.5px;
  padding:6px 18px; text-align:center;
}
.demo-foot a { color:#7db8f0; }
.demo-foot b { color:#fff; }
.main { padding-bottom:34px; } /* clear the fixed demo footer */

.toast {
  position:fixed; bottom:46px; left:50%; transform:translateX(-50%) translateY(12px);
  background:#1b2330; color:#fff; padding:10px 16px; border-radius:6px;
  font-size:13px; box-shadow:var(--shadow-lg); opacity:0; transition:.25s; z-index:60;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---------- Gallery index -------------------------------------------- */
.gallery-body { padding: 0; }
.gallery-hd {
  background: #fff; color: var(--c-text); padding: 26px 36px;
  border-bottom: 1px solid var(--c-border); border-top: 4px solid var(--c-primary);
}
.gallery-hd h1 { margin: 0 0 4px; font-size: 24px; font-weight:500; }
.gallery-hd p { margin: 0; color: var(--c-muted); }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 18px; padding: 28px 36px;
}
.g-card {
  background:#fff; border:1px solid var(--c-border); border-radius: 6px;
  box-shadow: var(--shadow); overflow:hidden; display:block; color:inherit;
}
.g-card:hover { box-shadow: var(--shadow-lg); text-decoration:none; transform: translateY(-2px); transition:.15s; }
.g-card .thumb {
  height: 120px; background: #f1f5fa;
  display:grid; place-items:center; font-size: 40px; color: var(--c-primary);
  border-bottom: 1px solid var(--c-border-lt);
}
.g-card .meta { padding: 12px 14px; }
.g-card .meta .num { font-size: 11.5px; color: var(--c-muted); }
.g-card .meta .nm { font-weight: 600; font-size: 14.5px; margin: 2px 0; }
.g-card .meta .pri { font-size: 11px; font-weight: 700; }
.pri-must   { color: #15803d; }
.pri-should { color: var(--c-primary); }
