* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: #f3f5f4; color: #1c2420; }
a { color: #065f46; }
button { cursor: pointer; border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; font-weight: 600; }
.btn-primary { background: #065f46; color: #fff; }
.btn-primary:hover { background: #047857; }
.btn-ghost { background: #e7ecea; color: #1c2420; }
.btn-danger { background: #991b1b; color: #fff; }
.btn-small { padding: 5px 10px; font-size: 13px; }
input, select { padding: 9px 10px; border: 1px solid #c8d2cd; border-radius: 8px; font-size: 14px; width: 100%; background: #fff; }
textarea { padding: 9px 10px; border: 1px solid #c8d2cd; border-radius: 8px; font-size: 14px; width: 100%; background: #fff; font-family: inherit; }
label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; color: #44514b; }
.card { background: #fff; border: 1px solid #e0e6e3; border-radius: 12px; padding: 18px; }
.hidden { display: none !important; }
.error { color: #991b1b; font-size: 13px; min-height: 18px; margin-top: 8px; }
.ok { color: #065f46; font-size: 13px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; border: 1px solid #e0e6e3; padding: 28px 26px; box-shadow: 0 6px 24px rgba(0,0,0,.05); }
.brand { font-size: 34px; font-weight: 800; letter-spacing: 3px; color: #065f46; text-align: center; }
.brand-sub { text-align: center; color: #6b7a72; font-size: 13px; margin: 4px 0 14px; }
.lang-switch { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.lang-switch button { background: #eef2f0; color: #33413a; padding: 6px 12px; font-size: 13px; }
.lang-switch button.active { background: #065f46; color: #fff; }
.login-card .btn-primary { width: 100%; margin-top: 16px; padding: 12px; font-size: 15px; }

/* app shell */
header.topbar { background: #065f46; color: #fff; padding: 10px 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
header.topbar .logo { font-weight: 800; letter-spacing: 2px; font-size: 20px; }
header.topbar nav { display: flex; gap: 8px; flex-wrap: wrap; }
header.topbar nav button { background: rgba(255,255,255,.14); color: #fff; }
header.topbar nav button:hover { background: rgba(255,255,255,.28); }
header.topbar .spacer { flex: 1; }
header.topbar .who { font-size: 13px; opacity: .92; }
header.topbar select { width: auto; padding: 5px 8px; }
main { max-width: 1080px; margin: 0 auto; padding: 18px 14px 40px; }
h2 { margin: 6px 0 14px; font-size: 20px; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.board-card { text-align: left; background: #fff; border: 1px solid #e0e6e3; border-radius: 12px; padding: 20px; }
.board-card:hover { border-color: #065f46; }
.board-card .bname { font-size: 17px; font-weight: 700; color: #065f46; }
.board-card .bmeta { font-size: 13px; color: #6b7a72; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid #e7ecea; font-size: 13.5px; vertical-align: top; }
th { background: #f0f4f2; color: #44514b; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #e7f4ee; color: #065f46; }
.badge.off { background: #fdecec; color: #991b1b; }
.role-card { margin-bottom: 14px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; margin: 10px 0; }
.perm-grid label { display: flex; gap: 7px; align-items: center; font-weight: 500; margin: 0; color: #1c2420; }
.perm-grid input { width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.proj-assign { border: 1px solid #e0e6e3; border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.proj-assign .pa-head { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.proj-assign .pa-head input { width: auto; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { background: #e7ecea; color: #1c2420; }
.tabs button.active { background: #065f46; color: #fff; }

/* M2 tickets */
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.done { background: #dbeafe; color: #1e40af; }
.ticket-card { margin-bottom: 10px; cursor: pointer; padding: 14px 16px; }
.ticket-card:hover { border-color: #065f46; }
.tk-title { font-size: 16px; font-weight: 700; margin-top: 6px; }
.tk-meta { font-size: 13px; color: #6b7a72; margin-top: 4px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.chk { display: flex; gap: 7px; align-items: center; font-weight: 500; margin: 4px 0; color: #1c2420; }
.chk input { width: auto; }
.thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 8px; border: 1px solid #e0e6e3; }
.filechip { display: inline-block; padding: 8px 10px; background: #eef2f0; border-radius: 8px; font-size: 13px; }
.flow-item { padding: 9px 0; border-bottom: 1px solid #eef2f0; font-size: 14px; }
.flow-item:last-child { border-bottom: none; }
.fi-time { color: #6b7a72; font-size: 12px; margin-right: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); display: flex; align-items: center; justify-content: center; z-index: 50; }
.lightbox img { max-width: 86vw; max-height: 84vh; border-radius: 8px; }
.lb-close { position: absolute; top: 14px; right: 20px; color: #fff; font-size: 26px; cursor: pointer; }
.lb-nav { background: rgba(255,255,255,.15); color: #fff; font-size: 26px; padding: 8px 14px; margin: 0 8px; }
.lb-cap { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; }
