 /* =============================================================
   mainkk.css — Main stylesheet for SecureApp
   ============================================================= */

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

/* ── Design tokens ── */
:root {
    --bg:        #0c232d;
    --surface:   #264858;
    --nav:		 #93bcc7;
    --border:    #214655;
    --accent:    #f59e0b;
    --accent-hv: #818cf8;
    --danger:    #ef4444;
    --success:   #22c55e;
    --warning:   #f59e0b;
    --text:      #f1f5f9;
    --muted:     #94a3b8;
    --radius:    0.3rem;
}

/* ── Base ── */
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.3;
    min-height: 100vh;
}

/* ── Nav ── */
nav {
/* --   background: var(--nav);
    border-top: 2px solid #9c9c9c; --*/
    padding: 0.5rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    clear: both;
    font-size:0.7em;
    float: right;
    width:100%;
}
nav .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-decoration: none;
    margin-right: auto;
}
nav a {
    color: #e6e6e6;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .15s;
	border:2px solid;
	border-color: color(display-p3 0.9686 0.8157 0.2745);
	padding: 0.3rem 1rem 0.2rem;
	background-color: #264858;
	font-weight: bold;
	text-transform: uppercase;
	margin:0.33rem 0 0;
}
nav a:hover { 
	background-color: color(display-p3 0.9686 0.8157 0.2745);
	 }

nav .nav-btn, div.nav a.nav-btn {
    background: rgba(245,158,11,0.7);
    color: #fff !important;
    padding: .2rem .70rem 0;
    border-radius: var(--radius);
    font-size: 0.65rem;
    color: var(--border);
}
nav .nav-btn:hover, div.nav a.nav-btn:hover { background: var(--accent-hv); }
nav .nav-badge {
    background: var(--warning);
    color: #1e293b;
    font-size: 0.72rem;
    font-weight: 700;
    padding: .15rem .4rem;
    border-radius: 999px;
    margin-left: .3rem;
    vertical-align: middle;
}

ul.nav-links {display: inline-block; list-style: none;padding:0;width:80%}
ul.nav-links li {margin:0 5px}

.menu-toggle {
  display: none;
}

@media screen and (max-width: 600px) {
  .menu-toggle {
    display: initial;
  }
  button[aria-expanded="false"] + ul {
  display: none;
  }
  .menu {
    flex-direction: column;
    flex-wrap: nowrap;
    position: absolute;
    inset: 130px 0 0;
    text-align: center;
  }
  .menu a {
    color: inherit;
  }
}

/* ── Layout ── */
.container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.card-sm  { max-width: 440px; margin: 3rem auto; }
h1 { font-size: 1.6rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.25rem; margin-bottom: 1rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: .35rem; }
input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=date],
select,
textarea {
    width: 100%;
    background: var(--text);
    border: 1px solid var(--border);
    color: var(--bg);
    border-radius: var(--radius);
    padding: .35rem .8rem;
    font-size: .95rem;
    outline: none;
    transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: .55rem 1.25rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn-primary       { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hv); }
.btn-danger        { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #dc2626; }
.btn-ghost         { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover   { border-color: var(--accent); color: var(--text); }
.btn-full { width: 100%; text-align: center; }

/* ── Alerts ── */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: .9rem;
}
.alert-danger  { background: rgba(239,68,68,.15);  border: 1px solid rgba(239,68,68,.4);  color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.15);  border: 1px solid rgba(34,197,94,.4);  color: #86efac; }
.alert-info    { background: rgba(99,102,241,.15); border: 1px solid rgba(99,102,241,.4); color: #a5b4fc; }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .65rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
}
.badge-green   { background: rgba(34,197,94,.2);   color: #86efac; }
.badge-red     { background: rgba(239,68,68,.2);   color: #fca5a5; }
.badge-purple  { background: rgba(99,102,241,.2);  color: #a5b4fc; }
.badge-gray    { background: rgba(148,163,184,.2); color: var(--muted); }
.badge-blue    { background: rgba(59,130,246,.2);  color: #93c5fd; }
.badge-warning { background: rgba(245,158,11,.2);  color: #fcd34d; }

/* ── Utilities ── */
.text-muted      { color: var(--muted); }
.text-center     { text-align: center; }
.mt-1            { margin-top: .5rem; }
.mt-2            { margin-top: 1rem; }
.mt-3            { margin-top: 1.5rem; }
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2           { gap: .75rem; }

/* ── Invoice — items table (legacy) ── */
.items-table th, .items-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); font-size: .85rem; }
.items-table input, .items-table select {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    border-radius: .35rem; padding: .3rem .5rem; font-size: .85rem; width: 100%;
}
.items-table input:focus { border-color: var(--accent); outline: none; }

/* ── Invoice — totals box ── */
.totals-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; min-width: 260px; }
.totals-box div { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .9rem; }
.totals-box .grand { font-size: 1.1rem; font-weight: 700; border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .75rem; }

/* ── Invoice — view table ── */
.inv-table th, .inv-table td { padding: .55rem .9rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.inv-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.inv-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Invoice — status bar ── */
.status-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.status-bar a { font-size: .8rem; }

/* ── Page header row ── */
.page-header { margin-bottom: 1.5rem; }

/* ── Search bar ── */
.search-form  { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.search-input { flex: 1; }

/* ── Card variants ── */
.card-table { padding: 0; overflow: hidden; }
.card-form  { max-width: 680px; margin: 0 auto; }

/* ── Table column alignment ── */
.col-center     { text-align: center; }
.justify-center { justify-content: center; }

/* ── Status dot (red/green) ── */
.status-dot     { display:inline-block; width:12px; height:12px; border-radius:50%; }
.status-dot-on  { background:#22c55e; box-shadow:0 0 6px #16a34a; }
.status-dot-off { background:#ef4444; box-shadow:0 0 6px #dc2626; }

/* ── nst status dot ── */
.nst-dot    { display:inline-block; width:12px; height:12px; border-radius:50%; }
.nst-red    { background:#ef4444; box-shadow:0 0 6px #dc2626; }
.nst-green  { background:#22c55e; box-shadow:0 0 6px #16a34a; }
.nst-yellow { background:#f59e0b; box-shadow:0 0 6px #d97706; }
.nst-grey   { background:#64748b; box-shadow:0 0 4px #475569; }

/* ── Small action buttons ── */
.btn-icon { padding: .3rem .6rem; font-size: 1rem; line-height: 1; }
.btn-sm   { padding: .3rem .6rem; font-size: .8rem; }

/* ── Table empty state ── */
.empty-row { padding: 2rem; }

/* ── Pagination ── */
.pagination { margin-top: 1rem; flex-wrap: wrap; }
.btn-page   { padding: .35rem .75rem; font-size: .85rem; }

/* ── Misc utilities ── */
.ml-auto    { margin-left: auto; }
.label-hint { font-size: .8rem; }
.count-text { font-size: .8rem; }

/* ── Form grids ── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3   { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4   { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1rem; }
.grid-121 { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 1rem; }

/* ── Popup search (ntxt2 / ntxt3 lookup) ── */
.popup-wrap   { position: relative; }
.popup-search {
    width: 100%; background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: var(--radius); padding: .35rem .7rem;
    font-size: .85rem; outline: none; transition: border-color .15s; margin-bottom: .35rem;
}
.popup-search:focus { border-color: var(--accent); }
.popup-list {
    display: none; position: absolute; z-index: 200; left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); max-height: 180px; overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.popup-list.open { display: block; }
.popup-list li {
    list-style: none; padding: .45rem .8rem; font-size: .88rem; cursor: pointer;
    border-bottom: 1px solid var(--border); white-space: pre-wrap; word-break: break-word;
}
.popup-list li:last-child { border-bottom: none; }
.popup-list li:hover { background: rgba(99,102,241,.15); color: var(--text); }

/* ── Items table (order form) ── */
.items-section      { margin-top: 2rem; }
.items-section h2   { margin-bottom: .75rem; }
.items-tbl          { width: 100%; border-collapse: collapse; font-size: .85rem; }
.items-tbl th       {
    color: var(--muted); font-size: .75rem; text-transform: uppercase;
    letter-spacing: .04em; padding: .4rem .5rem; border-bottom: 1px solid var(--border);
    text-align: left; white-space: nowrap;
}
.items-tbl td       { padding: .35rem .4rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.items-tbl input    {
    width: 100%; background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: .35rem; padding: .3rem .45rem; font-size: .84rem; outline: none;
}
.items-tbl input:focus { border-color: var(--accent); }
.items-tbl .col-no    { width: 80px; }
.items-tbl .col-name  { min-width: 160px; }
.items-tbl .col-num   { width: 80px; }
.items-tbl .col-total { width: 90px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); padding-right: .6rem; }
.items-tbl .col-del   { width: 36px; text-align: center; }
.items-tbl .btn-del   {
    background: none; border: none; color: var(--muted);
    font-size: 1.1rem; cursor: pointer; padding: .1rem .3rem;
    border-radius: .25rem; line-height: 1;
}
.items-tbl .btn-del:hover { color: var(--danger); }
.line-total   { text-align: right; font-variant-numeric: tabular-nums; }
.items-totals { display: flex; justify-content: flex-end; margin-top: .75rem; }
.items-totals table { font-size: .88rem; }
.items-totals td    { padding: .25rem .6rem; }
.items-totals .lbl  { color: var(--muted); text-align: right; }
.items-totals .val  { text-align: right; font-variant-numeric: tabular-nums; min-width: 90px; }
.items-totals .grand { font-size: 1rem; font-weight: 700; border-top: 1px solid var(--border); }

.form-divider { border: none; border-top: 2px dashed var(--text); margin: 1.5rem 0; }
.items-tbl .col-pre { width: 90px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); padding-right: .6rem; }
