:root {
  --ink: #0f1720;
  --ink-soft: #4b5a6b;
  --muted: #8592a3;
  --line: #e2e6ea;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #3b6ef6;
  --accent-ink: #1d3fa0;
  --ok: #1a9c6e;
  --ok-bg: #e6f7f0;
  --warn: #b5820c;
  --warn-bg: #fbf1dc;
  --danger: #c0392b;
  --radius: 8px;
  --mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 600; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 440px; }
main.wrap { padding-top: 28px; padding-bottom: 60px; }

/* ---- top nav ---- */
.topnav { background: var(--ink); color: #fff; }
.topnav-inner { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; letter-spacing: 0.2px; }
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-mark {
  width: 28px; height: 28px; object-fit: contain;
}
.topnav-links a { color: #cfd8e3; margin-left: 20px; font-size: 13px; }
.topnav-links a:hover { color: #fff; }

/* ---- panels ---- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head-actions { display: flex; gap: 10px; align-items: center; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--ink-soft); text-decoration: none; }
.btn-danger { background: #fdecea; color: var(--danger); border-color: #f5c6c0; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ---- badges ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-role-admin { background: #e8edff; color: var(--accent-ink); }
.badge-role-employee { background: #f1f0f4; color: #6b6478; }
.badge-status-pending { background: var(--warn-bg); color: var(--warn); }
.badge-status-approved { background: var(--ok-bg); color: var(--ok); }
.badge-status-rejected { background: #fdecea; color: var(--danger); }

/* ---- table ---- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); border-bottom: 1px solid var(--line); padding: 8px 10px; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row-actions a, .row-actions button { margin-right: 10px; font-size: 12px; }

/* ---- forms ---- */
.form-row { margin-bottom: 16px; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 14px; color: var(--ink); background: #fff; font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 110, 246, 0.15);
}
.hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.icon-fetch-row { display: flex; gap: 8px; align-items: flex-start; }
.icon-fetch-row input { flex: 1; }
.icon-preview { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px; object-fit: contain; padding: 4px; background: #fff; flex-shrink: 0; }

/* ---- empty state ---- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .btn { margin-top: 10px; }

/* ---- alerts ---- */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.alert-success { background: var(--ok-bg); color: var(--ok); border: 1px solid #b7e4d1; }
.alert-info { background: #eaf1ff; color: var(--accent-ink); border: 1px solid #c9dbff; }

/* ---- login/register ---- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #0f1720 0%, #1c2a3a 100%); }
.login-card { background: #fff; width: 360px; padding: 32px 30px; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.35); }
.login-mark { width: 48px; height: 48px; object-fit: contain; margin-bottom: 14px; }
.login-card h1 { font-size: 19px; margin: 0 0 4px; }
.login-card p { margin: 0 0 18px; }

/* ---- link grid (the shared directory) ---- */
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.link-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  position: relative;
}
.link-card:hover { border-color: var(--accent); }
.link-card-icon { width: 36px; height: 36px; border-radius: 6px; object-fit: contain; flex-shrink: 0; background: #fff; }
.link-card-body { min-width: 0; flex: 1; }
.link-card-title { font-weight: 600; color: var(--ink); }
.link-card-title:hover { text-decoration: none; }
.link-card-desc { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-card-admin-actions { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; }
.link-card:hover .link-card-admin-actions { display: flex; }
.link-card-admin-actions a { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; font-size: 11px; color: var(--ink-soft); }

@media (max-width: 720px) {
  .link-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .link-grid { grid-template-columns: 1fr; }
}
