/* TGISL Memo System - design (navy + amber, same family as the Inventory & Asset Control System) */
:root {
  --navy-900: #0A2238; --navy-800: #0E2D4A; --navy-700: #123A5E; --navy-600: #1A4A73;
  --amber: #F59E0B; --amber-600: #D97706; --amber-soft: #FEF3C7;
  --bg: #F3F5F9; --card: #FFFFFF; --text: #0F172A; --muted: #5B6676; --border: #E3E8EF;
  --ok: #15803D; --ok-soft: #DCFCE7; --bad: #B91C1C; --bad-soft: #FEE2E2; --wait: #B45309; --wait-soft: #FEF3C7;
  --info: #1D4ED8; --info-soft: #DBEAFE;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14.5px; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-600); }
.ic { flex-shrink: 0; }
h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.2px; }
h2 { font-size: 16px; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- login ---------- */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; color: #fff; padding: 56px 64px; display: flex; flex-direction: column;
  background: radial-gradient(600px 400px at 85% 95%, rgba(245,158,11,.28), transparent 70%), linear-gradient(160deg, #13426B 0%, #0B2A45 55%, #081E33 100%); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(145deg, #FBBF24, #F59E0B); display: grid; place-items: center; color: #fff; box-shadow: 0 10px 24px -8px rgba(245,158,11,.7); }
.brand-name { font-weight: 800; font-size: 18px; }
.brand-sub { color: rgba(255,255,255,.72); font-size: 13.5px; }
.auth-hero h1 { font-size: 46px; line-height: 1.08; margin: auto 0 18px; letter-spacing: -1px; max-width: 640px; }
.auth-hero p.lead { color: rgba(255,255,255,.85); font-size: 17px; max-width: 560px; margin: 0 0 30px; }
.feat { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; font-size: 15.5px; }
.feat span.fi { width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,.08); display: grid; place-items: center; color: var(--amber); }
.auth-foot { margin-top: auto; padding-top: 40px; color: rgba(255,255,255,.55); font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 40px; background: #F4F6FA; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 30px; display: block; margin: 0 0 6px; }
.auth-card .muted { margin: 0 0 26px; font-size: 15px; }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 16px 0 6px; color: #1E293B; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus, .rte:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(26,74,115,.14); }
textarea { min-height: 90px; resize: vertical; }
.pw { position: relative; } .pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 16px 0; } .check input { width: 18px; height: 18px; accent-color: var(--navy-700); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--navy-700); color: #fff; transition: background .15s, transform .05s; }
.btn:hover { background: var(--navy-800); } .btn:active { transform: translateY(1px); }
.btn.block { width: 100%; padding: 15px; font-size: 16px; }
.btn.secondary { background: #fff; color: var(--navy-700); border: 1.5px solid var(--border); } .btn.secondary:hover { background: #F1F5F9; }
.btn.amber { background: var(--amber); color: #1F1300; } .btn.amber:hover { background: var(--amber-600); color: #fff; }
.btn.danger { background: var(--bad); } .btn.danger:hover { background: #991B1B; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.row { display: flex; gap: 14px; flex-wrap: wrap; } .row > * { flex: 1; min-width: 220px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, #0E2D4A, #0A2238); color: #CBD5E1; padding: 22px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 0 8px 22px; } .side .brand-mark { width: 42px; height: 42px; border-radius: 11px; } .side .brand-name { color: #fff; font-size: 16px; } .side .brand-sub { font-size: 12px; }
.nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #7C8DA3; margin: 18px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; color: #D5DEE9; text-decoration: none; padding: 10px 12px; border-radius: 10px; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: rgba(245,158,11,.16); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.nav a .soon { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: 6px; color: #9FB0C4; }
.main { min-width: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.top .who { display: flex; align-items: center; gap: 10px; font-size: 13.5px; } .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-700); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.top .who a { color: var(--muted); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; } .top .who a:hover { color: var(--navy-700); }
.burger { display: none; border: 0; background: none; cursor: pointer; color: var(--navy-700); }
.content { padding: 26px 28px 60px; max-width: 1200px; }

/* ---------- cards, stats, lists ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat .si { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; }
.stat .n { font-size: 26px; font-weight: 800; line-height: 1; } .stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.si.navy { background: #E6EEF6; color: var(--navy-700); } .si.amber { background: var(--amber-soft); color: var(--amber-600); } .si.green { background: var(--ok-soft); color: var(--ok); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin: 0 0 16px; flex-wrap: wrap; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--navy-700); border-bottom-color: var(--amber); }
.tab .cnt { background: #EEF2F7; color: var(--navy-700); border-radius: 999px; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; text-decoration: none; color: inherit; border: 1px solid transparent; }
.list .item:hover { background: #F7F9FC; border-color: var(--border); }
.list .item .ti { width: 38px; height: 38px; border-radius: 10px; background: #EEF2F7; color: var(--navy-700); display: grid; place-items: center; }
.list .item .mn { flex: 1; min-width: 0; } .list .item .tt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .list .item .mt { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.wait { background: var(--wait-soft); color: var(--wait); }
.badge.info { background: var(--info-soft); color: var(--info); }
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.alert.ok { background: var(--ok-soft); color: #14532D; } .alert.error { background: var(--bad-soft); color: #7F1D1D; } .alert.info { background: var(--info-soft); color: #1E3A8A; } .alert.warn { background: #FFF4D6; color: #5C4300; border: 1px solid #F0D58A; }

/* ---------- memo ---------- */
.meta { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; margin: 14px 0; } .meta dt { color: var(--muted); font-weight: 600; } .meta dd { margin: 0; }
.body-html { line-height: 1.65; } .body-html p, .body-html div { margin: 0 0 8px; } .body-html ul, .body-html ol { margin: 6px 0 8px 22px; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 34px; } .timeline li:before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--border); } .timeline li:last-child:before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.timeline .dot.wait { background: #EEF2F7; color: var(--muted); } .timeline .dot.bad { background: var(--bad-soft); color: var(--bad); }
.timeline .nm { font-weight: 600; } .timeline .mt { color: var(--muted); font-size: 12.5px; }
.note { background: #F4F6F9; border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-size: 13.5px; } .note.amend { background: #FFF4D6; color: #5C4300; }
.files a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; margin: 0 8px 8px 0; color: var(--navy-700); font-weight: 600; background: #fff; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 17px; font-weight: 700; letter-spacing: 1px; background: #F4F6F9; border: 1.5px dashed #CBD5E1; padding: 12px; border-radius: 12px; text-align: center; }

/* rich text editor */
.rte-bar { display: flex; gap: 4px; padding: 6px; border: 1.5px solid var(--border); border-bottom: 0; border-radius: 12px 12px 0 0; background: #F8FAFC; flex-wrap: wrap; }
.rte-bar button { border: 1px solid transparent; background: none; padding: 6px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.rte-bar button:hover { background: #fff; border-color: var(--border); }
.rte { min-height: 220px; border: 1.5px solid var(--border); border-radius: 0 0 12px 12px; padding: 12px 14px; background: #fff; line-height: 1.6; }
.rte:empty:before { content: attr(data-placeholder); color: #94A3B8; }

/* chips (CC) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .chip { display: inline-flex; align-items: center; gap: 4px; background: #E6EEF6; color: var(--navy-700); border-radius: 999px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 16px; color: inherit; padding: 0 6px; }

/* table */
table.tbl { width: 100%; border-collapse: collapse; } .tbl th, .tbl td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: top; }
.tbl th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }

/* modal + busy */
.overlay { position: fixed; inset: 0; background: rgba(8,30,51,.55); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.overlay.show { display: flex; } .modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 420px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid #E6EEF6; border-top-color: var(--amber); animation: spin .8s linear infinite; margin: 0 auto 12px; } @keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .auth { grid-template-columns: 1fr; } .auth-hero { padding: 32px 24px; } .auth-hero h1 { font-size: 32px; margin-top: 30px; } .auth-hero .feats, .auth-foot { display: none; }
  .shell { grid-template-columns: 1fr; } .side { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; } .side.open { transform: none; }
  .burger { display: inline-flex; } .top > .muted { display: none; } .top .who b { display: none; } .content { padding: 18px 14px 50px; } .top { padding: 12px 14px; } .stats { grid-template-columns: 1fr; } .meta { grid-template-columns: 1fr; }
}
