/* Yakuza Advance Manager — portal styles
   Identity: the printed voucher — orange top rule, ink, warm paper. */
:root {
	--orange: #F07800;
	--orange-deep: #D96C00;
	--orange-dark: #8A4A00;
	--orange-soft: #FFF1E2;
	--ink: #15171C;
	--ink-2: #1F222A;
	--text: #22242A;
	--muted: #6E7379;
	--canvas: #F5F4F0;
	--panel: #FFFFFF;
	--line: #E7E4DE;
	--line-strong: #D4D0C8;
	--danger: #C02626;
	--danger-soft: #FBECEC;
	--ok: #0E7C4F;
	--ok-soft: #E8F5EE;
	--radius: 10px;
	--rule: 3px solid var(--orange);
	--shadow: 0 1px 2px rgba(18, 16, 12, .05), 0 6px 20px rgba(18, 16, 12, .06);
	--shadow-lift: 0 2px 4px rgba(18, 16, 12, .06), 0 14px 34px rgba(18, 16, 12, .12);
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
	font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
	background: var(--canvas); color: var(--text);
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
.error { color: var(--danger); font-size: 13px; margin: 4px 0 10px; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--orange-soft); color: var(--orange-dark); }
.ok { color: var(--ok); font-size: 12px; white-space: nowrap; }
.warn { color: var(--orange-dark); font-size: 12px; white-space: nowrap; }

/* ---------------- logo tile (login + sidebar) */
.logo-tile {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: 12px; background: #fff;
	border: 1px solid var(--line); box-shadow: inset 0 0 0 3px var(--orange-soft);
	overflow: hidden; flex-shrink: 0;
}
.logo-tile img { width: 34px; height: 34px; object-fit: contain; display: block; }

/* ---------------- inputs & buttons */
label { display: block; font-size: 12.5px; font-weight: 550; color: #4A4E55; margin: 0 0 13px; }
label .muted { font-weight: 400; }
input, select, textarea {
	display: block; width: 100%; margin-top: 6px; padding: 9px 11px;
	font: inherit; color: var(--text); background: #fff;
	border: 1px solid var(--line-strong); border-radius: 8px;
	transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #A9ADB3; }
input:focus, select:focus, textarea:focus {
	outline: none; border-color: var(--orange);
	box-shadow: 0 0 0 3px rgba(240, 120, 0, .16);
}
input[type="checkbox"] { display: inline-block; width: auto; margin: 0; accent-color: var(--orange); }
input[type="file"] { padding: 7px; }
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 7px;
	padding: 8px 15px; font: inherit; font-weight: 560;
	color: var(--text); background: #fff; border: 1px solid var(--line-strong);
	border-radius: 8px; cursor: pointer; text-decoration: none; text-align: center;
	transition: border-color .12s, background .12s, transform .06s, box-shadow .12s;
}
.btn:hover { border-color: #B9B4AA; background: #FCFBF9; }
.btn:active { transform: translateY(1px); }
.btn.primary {
	background: linear-gradient(180deg, #FF8A14, var(--orange-deep));
	border-color: var(--orange-deep); color: #fff;
	box-shadow: 0 1px 2px rgba(217, 108, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.primary:hover { background: linear-gradient(180deg, #FF9226, var(--orange)); }
.btn.block { display: flex; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg, #nav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; flex-shrink: 0; }
button.link { background: none; border: none; padding: 0; font: inherit; font-weight: 550; color: var(--orange-deep); cursor: pointer; }
button.link:hover { text-decoration: underline; }
button.link.danger, .danger { color: var(--danger); }

/* ---------------- login */
.login-wrap {
	min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
	background:
		radial-gradient(640px 420px at 50% -80px, rgba(240, 120, 0, .14), transparent 70%),
		radial-gradient(520px 380px at 88% 110%, rgba(240, 120, 0, .07), transparent 70%),
		var(--canvas);
}
.login-card {
	width: 380px; background: var(--panel); border: 1px solid var(--line);
	border-top: var(--rule); border-radius: 14px;
	box-shadow: var(--shadow-lift); padding: 34px 34px 26px;
	animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .logo-tile { width: 58px; height: 58px; border-radius: 15px; }
.login-brand .logo-tile img { width: 44px; height: 44px; }
.login-card h1 { font-size: 20px; margin-top: 12px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.login-card .btn.primary { margin-top: 4px; padding: 10px 15px; }
.login-card .legal {
	margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line);
	font-size: 11px; color: var(--muted); text-align: center; letter-spacing: .02em;
}

/* ---------------- app shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
	width: 236px; flex-shrink: 0; background: var(--ink); color: #C8CBD1;
	padding: 18px 14px 14px; display: flex; flex-direction: column;
	position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.brand .logo-tile { width: 40px; height: 40px; border-radius: 11px; border-color: rgba(255, 255, 255, .12); }
.brand .logo-tile img { width: 30px; height: 30px; }
.brand-name { display: flex; flex-direction: column; color: #fff; font-weight: 650; font-size: 14.5px; line-height: 1.2; }
.brand-name small { font-weight: 450; font-size: 11px; color: #8B9097; letter-spacing: .03em; }
#nav { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; }
#nav a {
	display: flex; align-items: center; gap: 11px; position: relative;
	padding: 9px 12px; border-radius: 8px; color: #B4B8BF;
	text-decoration: none; font-size: 13.5px; font-weight: 500;
	transition: background .12s, color .12s;
}
#nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
#nav a.active { background: var(--ink-2); color: #fff; }
#nav a.active::before {
	content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
	border-radius: 3px; background: var(--orange);
}
#nav a.active svg { stroke: var(--orange); }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar .btn.ghost {
	width: 100%; justify-content: flex-start; background: transparent; border: none;
	color: #9CA1A8; padding: 9px 12px; border-radius: 8px;
}
.sidebar .btn.ghost:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.view { flex: 1; min-width: 0; padding: 28px 34px 56px; max-width: 1120px; }

/* view header */
.vh { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.vh h2 { font-size: 22px; }
.vh .muted { margin-top: 3px; font-size: 13px; }
.actions { display: flex; gap: 8px; }
.chip {
	font-size: 12px; font-family: var(--mono); font-weight: 600;
	background: var(--orange-soft); color: var(--orange-dark);
	border: 1px solid #F5D9BC; padding: 5px 11px; border-radius: 999px;
}

/* ---------------- skeleton loading */
.skel { border-radius: 8px; background: linear-gradient(90deg, #ECEAE4 25%, #F5F3EE 45%, #ECEAE4 65%); background-size: 220% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -120% 0; } }
.skel-row { height: 15px; margin: 14px 0; }
.skel-card { height: 92px; }
@media (prefers-reduced-motion: reduce) { .skel, .login-card { animation: none; } }

/* ---------------- stat cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 26px; }
.card {
	position: relative; display: flex; gap: 13px; align-items: flex-start;
	background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
	padding: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--orange); }
.card .ic {
	width: 38px; height: 38px; border-radius: 10px; background: var(--orange-soft);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.card .ic svg { width: 19px; height: 19px; fill: none; stroke: var(--orange-deep); stroke-width: 1.8; }
.card .lbl { font-size: 12px; font-weight: 550; color: var(--muted); letter-spacing: .01em; }
.card .big { font-size: 24px; font-weight: 680; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------------- panels & forms */
.panel {
	background: var(--panel); border: 1px solid var(--line); border-top: var(--rule);
	border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.panel.narrow { max-width: 500px; }
.panel h3 { font-size: 15px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2.top { align-items: start; gap: 16px; }
.inline { display: flex; gap: 8px; margin-bottom: 12px; }
.inline input { margin-top: 0; }
.banner {
	display: flex; align-items: center; gap: 8px;
	background: var(--ok-soft); border: 1px solid #BFE5CF; color: #0B5C3B;
	border-radius: var(--radius); padding: 11px 15px; margin-bottom: 18px; font-size: 13px;
}
.banner a { color: inherit; font-weight: 650; }
.section-title { font-size: 15px; margin: 4px 0 12px; }

/* ---------------- employee card on record page */
.emp-card {
	display: flex; align-items: center; gap: 12px; background: #FAF9F6;
	border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; margin-bottom: 15px;
}
.avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: linear-gradient(180deg, #FFE3C4, var(--orange-soft));
	border: 1px solid #F2D4B4; color: var(--orange-dark);
	font-weight: 650; font-size: 13px;
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sig-preview { max-width: 150px; max-height: 52px; border: 1px solid var(--line); border-radius: 8px; padding: 5px; background: #fff; margin-bottom: 12px; }

/* ---------------- tables */
.tbl-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; font-size: 13px; }
.tbl thead th {
	color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase;
	letter-spacing: .06em; border-bottom: 1px solid var(--line);
	background: #FAF9F6; white-space: nowrap;
}
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: #FCF8F3; }
.tbl tbody tr + tr td { border-top: 1px solid var(--line); }
.tbl .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.row-actions { display: flex; gap: 14px; justify-content: flex-end; align-items: center; }
.row-actions a { color: var(--orange-deep); font-weight: 550; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }
.empty {
	background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius);
	padding: 34px 20px; text-align: center; color: var(--muted); font-size: 13.5px;
}
.empty strong { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 3px; }

/* ---------------- filters / reports */
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 15px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; margin-top: 0; }
.seg { display: flex; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button {
	font: inherit; font-size: 13px; font-weight: 550; padding: 8px 13px;
	background: transparent; border: none; border-left: 1px solid var(--line); cursor: pointer; color: var(--muted);
}
.seg button:first-child { border-left: none; }
.seg button.active { background: var(--orange-soft); color: var(--orange-dark); }
.dl-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	background: var(--ink); color: #D6D9DE; border-radius: var(--radius);
	padding: 13px 16px; margin-top: 16px; box-shadow: var(--shadow);
	position: sticky; bottom: 14px;
}

/* ---------------- settings */
.dp-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--text); padding: 4px 0 14px; }
.switch-row input { width: 18px; height: 18px; }

/* ---------------- modal & toast */
.overlay {
	position: fixed; inset: 0; background: rgba(17, 18, 22, .5); backdrop-filter: blur(2px);
	display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
	width: 480px; max-width: 100%; max-height: 90vh; overflow: auto;
	background: #fff; border-top: var(--rule); border-radius: 14px; padding: 24px;
	box-shadow: var(--shadow-lift); animation: rise .22s ease both;
}
.modal h3 { margin-bottom: 4px; font-size: 16px; }
.modal .muted.small { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast {
	position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
	background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
	font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lift); z-index: 60;
	border-left: 3px solid var(--orange);
}
.toast.bad { background: var(--danger); border-left-color: #7E1414; }

/* ---------------- responsive */
@media (max-width: 820px) {
	.app { flex-direction: column; }
	.sidebar { width: 100%; height: auto; position: static; padding: 12px 14px; }
	.brand { padding-bottom: 12px; }
	#nav { flex-direction: row; flex-wrap: wrap; }
	#nav a.active::before { top: auto; left: 10px; right: 10px; bottom: 3px; width: auto; height: 3px; }
	.side-foot { margin-top: 10px; }
	.view { padding: 18px 16px 48px; }
	.grid2 { grid-template-columns: 1fr; }
	.vh h2 { font-size: 19px; }
	.login-card { padding: 26px 22px 20px; }
}
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
