/* Pallet Review — shared styles */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
             background: #f7f8fa; color: #1f2937; font-size: 14px; }

/* Top nav */
#topnav { display: flex; align-items: center; padding: 12px 24px; gap: 24px;
          background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
#topnav .brand { font-weight: 700; font-size: 16px; color: #111827; text-decoration: none; }
#topnav .nav-links { display: flex; gap: 16px; flex: 1; }
#topnav .nav-links a { color: #4b5563; text-decoration: none; padding: 4px 8px; border-radius: 4px; }
#topnav .nav-links a:hover { background: #f3f4f6; color: #111827; }
#topnav .nav-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #6b7280; }
#topnav .user-name { font-weight: 600; color: #111827; }
#topnav .user-role { background: #e5e7eb; padding: 2px 6px; border-radius: 3px; font-size: 11px; text-transform: uppercase; }
.link-btn { background: none; border: none; color: #3b82f6; cursor: pointer; padding: 0; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }

/* Page */
#page { max-width: 1280px; margin: 0 auto; padding: 24px; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 12px; color: #374151; }
h3 { font-size: 14px; margin: 16px 0 8px; color: #6b7280; }
section { margin-bottom: 24px; }
.muted { color: #6b7280; }

/* Login */
.login-box { max-width: 380px; margin: 80px auto; background: #fff; padding: 36px 32px;
             border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
             text-align: center; }
.login-box .login-logo { display: block; max-width: 220px; height: auto; margin: 0 auto 20px; }
.login-box h1 { text-align: center; margin: 0 0 20px; font-size: 20px; color: #1f2937; }
.login-box .sso-btn { display: inline-flex; align-items: center; justify-content: center;
                      width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 600;
                      background: #2f6df5; color: #fff; border: none; border-radius: 6px;
                      text-decoration: none; cursor: pointer; transition: background 120ms; }
.login-box .sso-btn:hover { background: #1d4fc4; }
.login-box .muted { margin-top: 16px; }
.error { background: #fee2e2; color: #991b1b; padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; }
.success { background: #d1fae5; color: #065f46; padding: 8px 12px; border-radius: 4px; margin-bottom: 16px; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; background: #fff; border-radius: 6px; overflow: hidden;
             box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
table.data.narrow { max-width: 720px; }
table.data th { background: #f9fafb; text-align: left; padding: 10px 12px; font-size: 12px;
                color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e5e7eb; }
table.data td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; }
table.data tr:hover { background: #fafbfc; }
table.data tr.deleted td { color: #9ca3af; text-decoration: line-through; }
.type-L { color: #16a34a; font-weight: 700; }
.type-U { color: #dc2626; font-weight: 700; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600;
         text-transform: uppercase; letter-spacing: 0.3px; }
.badge.new { background: #e5e7eb; color: #6b7280; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.done { background: #d1fae5; color: #065f46; }

/* Buttons */
.btn { display: inline-block; padding: 6px 12px; background: #fff; color: #374151;
       border: 1px solid #d1d5db; border-radius: 4px; cursor: pointer; font-size: 13px;
       text-decoration: none; transition: background 100ms; }
.btn:hover { background: #f9fafb; }
.btn.primary { background: #3b82f6; color: #fff; border-color: #3b82f6; }
.btn.primary:hover { background: #2563eb; }
.btn.small { padding: 4px 8px; font-size: 12px; }
button, button.primary { font-family: inherit; }

/* Forms */
.filter-bar { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 20px;
              background: #fff; padding: 12px 16px; border-radius: 6px; }
.filter-bar label { display: flex; flex-direction: column; font-size: 12px; color: #6b7280; gap: 4px; }
.filter-bar input, .filter-bar select { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: #fff; padding: 12px; border-radius: 6px; }
.inline-form input, .inline-form select { padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; }
.inline-form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #6b7280; }
.row-actions { display: flex; gap: 6px; align-items: center; }

/* Summary tiles (history-review page) */
.summary-tiles { display: flex; gap: 12px; margin: 16px 0; }
.tile { background: #fff; border-radius: 6px; padding: 16px 24px; min-width: 120px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.tile .label { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.tile .num { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile.loaded .num { color: #16a34a; }
.tile.unloaded .num { color: #dc2626; }

/* Misc */
code.path { font-size: 11px; color: #6b7280; word-break: break-all; }
