/* Global typographic scale and spacing tweaks */
html, body { font-size: 14px; }
body { line-height: 1.5; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
h5 { font-size: 1.0rem; }
p { margin: .4rem 0 .8rem; }

main.container { max-width: 1100px; }

/* Components */
.grid { gap: .8rem; }
.card, .stat, .hero { padding: .8rem; }
.stat strong { font-size: 1.25rem; }
.tag { font-size: .8rem; }

/* Datasets index */
.datasets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  align-items: stretch; /* make cards equal height per row */
}
.dataset-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  padding: .9rem;
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex;               /* vertical layout */
  flex-direction: column;
  height: 100%;                /* stretch to match grid row height */
}
.dataset-card:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 16px rgba(0,0,0,0.06); 
}
.dataset-title { margin: 0 0 .35rem; font-size: 1.05rem; line-height: 1.3; overflow:hidden; word-break: break-word; }
.dataset-title a { color: inherit; text-decoration: none; }
.dataset-title a:hover { text-decoration: underline; }
.dataset-abstract { margin: .2rem 0 .7rem; color: #475569; font-size: .95rem; overflow:hidden; word-break: break-word; }
.dataset-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .8rem; color: #64748b; margin-top: auto; }
.dataset-meta .dot { color: #cbd5e1; }
.badge { padding: .18rem .5rem; border-radius: 999px; border: 1px solid transparent; background: #f1f5f9; color: #475569; }
.badge.public { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge.private { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.badge.success { background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }
.badge.info { background:#eff6ff; border-color:#bfdbfe; color:#1e40af; }
.badge.warning { background:#fffbeb; border-color:#fde68a; color:#92400e; }
.badge.danger { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.chip { padding: .15rem .45rem; border-radius: 999px; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Controls */
input, select, textarea { font-size: .9rem; padding: .45rem .6rem; }
button, [role="button"], a[role="button"] { font-size: .9rem; padding: .45rem .7rem; }

/* Navigation */
header.topbar { padding: .4rem 0; }
header.topbar strong { font-size: 1rem; }
header.topbar nav ul, main.container > nav ul { display:flex; align-items:center; gap:.6rem; justify-content:flex-start; flex-wrap:wrap; }
main.container > nav { display:flex; align-items:center; justify-content:space-between; gap:.5rem 1rem; flex-wrap:wrap; padding:.35rem 0; }
main.container > nav > ul:first-child { flex: 1 1 320px; }
main.container > nav > ul:last-child { flex: 999 1 auto; margin-left:auto; justify-content:flex-end; }
main.container > nav .brand-identity { padding:.4rem .65rem; }
main.container > nav .brand-identity .brand-logo { height: 48px; }
main.container > nav .brand-identity .brand-title strong { font-size: 1.15rem; }
main.container > nav .brand-identity .brand-title span { font-size: .95rem; }
/* Navbar: hide sublines under main brand to keep it compact */
/* show sublines in navbar brand */
header.topbar nav a:not(.brand-link):not([role="button"]),
main.container > nav a:not(.brand-link):not([role="button"]) {
  padding:.42rem .7rem; border-radius:12px; text-decoration:none;
  color: var(--brand-700); border:1px solid transparent;
}
header.topbar nav a:not(.brand-link):not([role="button"]):hover,
main.container > nav a:not(.brand-link):not([role="button"]):hover {
  background: var(--brand-50); border-color: var(--brand-200);
}
.greeting { color:#64748b; }

/* Compact brand on small screens */
@media (max-width: 720px) {
  main.container > nav .brand-identity .brand-logo { height: 40px; }
  main.container > nav .brand-identity .brand-title strong { font-size: 1rem; }
  main.container > nav .brand-identity .brand-title span { font-size: .9rem; }
}

/* Helpers */
.muted { color: #64748b; }
.btn-yellow { background: #f59e0b; border-color: #f59e0b; }

/* Hide Google Translate top banner globally, keep dropdown working */
iframe.goog-te-banner-frame, .goog-te-banner-frame { display: none !important; visibility: hidden !important; height: 0 !important; }
#goog-gt-tt, .goog-te-balloon-frame { display: none !important; }
html, html.translated-ltr, html.translated-rtl { margin-top: 0 !important; }
body { top: 0 !important; position: static !important; }
iframe.goog-te-menu-frame { display: block !important; visibility: visible !important; z-index: 2147483647 !important; }

/* Charts */
canvas { max-height: 220px; }

/* --- Modern form layout --- */
.section-card { border:1px solid #e5e7eb; border-radius:14px; background:#ffffff; padding:1rem; box-shadow:0 1px 2px rgba(0,0,0,.03); }
.section-card + .section-card { margin-top: .9rem; }
.section-title { display:flex; align-items:center; gap:.5rem; margin:0 0 .6rem; font-weight:700; color:#0f172a; }
.section-title .k { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:999px; background:var(--brand-100); color:var(--brand-700); font-size:.9rem; }
.help { color:#64748b; font-size:.85rem; margin-top:.15rem; display:block; }
.req::after { content:'*'; color:#ef4444; margin-left:.2rem; }

/* Radio as cards */
.radio-cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:.6rem; }
.radio-card { display:flex; align-items:center; gap:.5rem; border:1px solid #e5e7eb; border-radius:12px; padding:.55rem .7rem; background:#f8fafc; cursor:pointer; }
.radio-card input { margin:0; }
.radio-card:has(input:checked) { border-color: var(--brand-200); background: var(--brand-50); box-shadow:0 0 0 3px rgba(37,99,235,.08); }

/* Tag input */
.tag-input { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; border:1px solid #e5e7eb; border-radius:10px; padding:.35rem .45rem; background:#ffffff; }
.tag-input input { border:none; outline:none; padding:.35rem; min-width: 120px; }
.pill { display:inline-flex; align-items:center; gap:.3rem; padding:.18rem .45rem; border-radius:999px; background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; font-size:.85rem; }
.pill button { border:none; background:transparent; color:#6366f1; cursor:pointer; padding:0 .1rem; }

/* File inputs */
.file-row { display:grid; grid-template-columns: 1fr 1fr; gap:.6rem; }
@media (max-width: 720px) { .file-row { grid-template-columns: 1fr; } }

/* Auth box: compact center card */
.auth-card { max-width: 460px; margin: 1.2rem auto; padding: 1rem; border: 1px solid #e5e7eb; border-radius: 10px; background: #ffffff; }
.auth-card h2, .auth-card h3 { font-size: 1.2rem; margin: 0 0 .6rem; }
.auth-card form label { margin: .3rem 0; }
.auth-card button { width: 100%; }
.auth-note { text-align: center; color:#475569; font-size:.95rem; margin-top:.6rem; }

/* Centered brand on auth pages */
.auth-brand { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.35rem; margin:1.2rem 0 .6rem; padding:.6rem 1rem; border:1px solid #e5e7eb; border-radius:12px; background: linear-gradient(180deg,#f8fafc,#ffffff); }
.auth-brand .brand-logo { height: 96px; }
.auth-brand-title { display:flex; flex-direction:column; align-items:center; line-height:1.2; text-align:center; }
.auth-brand-title strong { font-size:1.25rem; }
.auth-brand-title span { font-size:1rem; color:#334155; }

/* Branding */
.brand { display: inline-flex; align-items: center; gap: .8rem; }
.brand.brand-wide { align-items: flex-start; }
.brand-logo { height: 72px; width: auto; display: inline-block; }
.brand-title { display: inline-flex; flex-direction: column; line-height: 1.25; margin-top:.05rem; }
.brand-title strong { font-size: 1.25rem; }
.brand-title span { font-size: 1.05rem; color:#334155; }
.brand-link { text-decoration: none; color: inherit; }

/* Modern brand identity (nav) */
.brand-identity { align-items: center; padding: .5rem .75rem; border: 1px solid #e5e7eb; border-radius: 12px; background: linear-gradient(180deg,#f8fafc,#ffffff); box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.brand-identity .brand-logo { height: 54px; }
.brand-identity .brand-title strong { color: var(--brand-700); letter-spacing: .2px; }
.brand-identity .brand-title span { color:#475569; }

/* Brand theme */
:root {
  --brand-50:#eff6ff; --brand-100:#dbeafe; --brand-200:#bfdbfe;
  --brand-500:#2563eb; --brand-600:#1d4ed8; --brand-700:#1e40af;
}
a { color: var(--brand-600); }
button,
input[type=submit],
button.primary,
[role="button"].primary { background: var(--brand-600); border-color: var(--brand-600); }
button:hover,[role="button"].primary:hover { background: var(--brand-700); border-color: var(--brand-700); }

/* Outline button (for Logout, cancel, etc.) */
.btn-outline { 
  display:inline-flex; align-items:center; justify-content:center; gap:.35rem;
  padding:.48rem .85rem; border-radius:12px; 
  background:#ffffff; color: var(--brand-700); border:1px solid var(--brand-200);
  transition: all .15s ease;
}
.btn-outline:hover { background: var(--brand-50); border-color: var(--brand-300, #bfdbfe); color: var(--brand-700); }

/* Ensure primary buttons (button + anchor role=button) match size */
button.primary, [role="button"].primary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .35rem;
  padding: .55rem 1rem; /* equal padding */
  border-radius: 12px;
  border: 1px solid var(--brand-600);
  line-height: 1; min-height: 40px; /* consistent height */
}

/* Form actions alignment + equal min width */
.form-actions { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; }
.form-actions .primary { min-width: 140px; }

/* Compact buttons for tables */
.btn-sm { padding: .38rem .7rem; min-height: 34px; font-size: .85rem; }
button.btn-sm, a.btn-sm, [role="button"].btn-sm, summary.btn-sm {
  display:inline-flex; align-items:center; justify-content:center; gap:.35rem;
  padding:.38rem .7rem; min-height:34px; line-height:1; border-radius:12px;
}

/* Ensure small overrides primary min-height */
button.primary.btn-sm, [role="button"].primary.btn-sm { min-height:34px; padding:.38rem .7rem; }
button.danger.btn-sm, [role="button"].danger.btn-sm { min-height:34px; padding:.38rem .7rem; }
.btn-outline.btn-sm { padding:.38rem .7rem; min-height:34px; line-height:1; }

/* Danger button variant */
button.danger, [role="button"].danger {
  background: #ef4444; border-color: #ef4444; color: #ffffff;
}
button.danger:hover, [role="button"].danger:hover { background: #dc2626; border-color: #dc2626; }
/* Success button variant */
button.success, a.success, [role="button"].success, summary.success {
  background: #22c55e; border-color: #22c55e; color: #ffffff;
}
button.success:hover, a.success:hover, [role="button"].success:hover, summary.success:hover {
  background: #16a34a; border-color: #16a34a;
}

/* Actions inside table cells */
.table-actions { display:flex; align-items:center; gap:.45rem; flex-wrap: wrap; }
.table-actions form { margin: 0; }
.table-actions button { white-space: nowrap; }

/* Inline upload toggle in table actions */
details.inline-upload { position: relative; display: inline-block; }
details.inline-upload > summary { list-style: none; cursor: pointer; }
details.inline-upload > summary::-webkit-details-marker { display: none; }
details.inline-upload[open] > summary { background: var(--brand-50); border-color: var(--brand-300, #bfdbfe); }
details.inline-upload form { margin-top: .35rem; display: inline-flex; align-items:center; gap:.45rem; }
details.inline-upload input[type="file"] { max-width: 260px; }

/* Pretty cancel button */
.btn-cancel {
  display:inline-flex; align-items:center; gap:.45rem;
  padding:.48rem .85rem; border-radius:12px;
  border:1px solid #e5e7eb; color:#0f172a; background:linear-gradient(180deg,#ffffff,#f8fafc);
  text-decoration:none; transition:all .15s ease; box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.btn-cancel:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); transform: translateY(-1px); box-shadow:0 4px 14px rgba(30,64,175,.08); }
.btn-cancel:focus-visible { outline:3px solid rgba(37,99,235,.25); outline-offset:2px; }
.btn-cancel svg { width:18px; height:18px; color:#64748b; }

/* Filters */
.filters { margin: .6rem 0 1rem; display: grid; gap: .35rem; }
.filter-group { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.filter-label { color: #64748b; font-size: .85rem; margin-right: .2rem; }
.chip.is-active { background: var(--brand-100); color: var(--brand-700); border-color: var(--brand-200); }

/* Notification link badge */
.nav-notif-link { position: relative; display:inline-flex; align-items:center; gap:.4rem; }
.nav-badge {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:20px; height:20px; padding:0 .35rem;
  border-radius:999px; background:#ef4444; color:#fff; font-size:.75rem; font-weight:600;
}

/* Bell button + popover */
.icon-btn { position:relative; display:inline-flex; align-items:center; justify-content:center; gap:.35rem; padding:.42rem .6rem; border-radius:12px; border:1px solid transparent; background:#ffffff; color:#1e40af; cursor:pointer; }
.icon-btn:hover { background: var(--brand-50); border-color: var(--brand-200); }
.icon-btn:focus-visible { outline:3px solid rgba(37,99,235,.25); outline-offset:2px; }
.notif-bell { position:relative; }
.notif-bell .nav-badge { position:absolute; top:2px; right:4px; min-width:18px; height:18px; font-size:.7rem; padding:0 .3rem; }
.notif-popover { position:absolute; right:0; left:auto; top:calc(100% + 8px); min-width:320px; z-index:50; }
.notif-popover-inner { border:1px solid #e5e7eb; border-radius:12px; background:#ffffff; box-shadow:0 8px 30px rgba(0,0,0,.1); overflow:hidden; }
.notif-popover-head { display:flex; align-items:center; justify-content:space-between; gap:.6rem; padding:.55rem .75rem; border-bottom:1px solid #e5e7eb; background:#f8fafc; }
.notif-mini-list { list-style:none; margin:0; padding:.4rem; display:flex; flex-direction:column; gap:.35rem; max-height:320px; overflow-y:auto; overflow-x:hidden; }
.notif-mini-list > li { display:block; }
.notif-mini-list .mini { width:100%; }
.mini { border:1px solid #e5e7eb; border-radius:10px; padding:.45rem .6rem; background:#ffffff; }
.mini.unread { border-color:#bfdbfe; background:#f8fbff; }
.mini .mini-title { font-weight:600; color:#0f172a; margin-bottom:.1rem; }

/* --- Elegant data table panel --- */
.table-wrap { border:1px solid #e5e7eb; border-radius:14px; overflow:auto; background:#ffffff; box-shadow:0 2px 8px rgba(15,23,42,.05); }
.data-table { width:100%; border-collapse: separate; border-spacing: 0; min-width: 760px; }
.data-table thead th { position: sticky; top: 0; background: linear-gradient(180deg,#f8fafc,#eef2f7); color:#0f172a; font-weight:700; text-align:left; padding:.75rem .9rem; border-bottom:1px solid #e5e7eb; }
.data-table tbody td { padding:.75rem .9rem; border-bottom:1px solid #eef2f2; vertical-align: top; }
.data-table tbody tr:hover { background:#f9fbff; }
.data-table tbody tr:last-child td { border-bottom:none; }

/* Column tweaks */
.data-table .col-name { min-width: 220px; }
.data-table .col-nim { width: 110px; }
.data-table .col-supervisor { width: 160px; }
.data-table .col-program { min-width: 160px; max-width: 220px; }
.data-table .col-term { width: 160px; white-space: nowrap; }
.data-table .col-status { width: 140px; }
.data-table .col-actions { width: 320px; }

/* Name + subtitle inside first column */
.data-table .col-name strong a { color:#1d4ed8; text-decoration:none; }
.data-table .col-name strong a:hover { text-decoration:underline; }
.data-table .col-name .muted { display:block; margin-top:.25rem; font-size:.85rem; color:#6b7280; }

/* Compact badges inside cells */
.data-table .badge { font-size:.8rem; padding:.2rem .55rem; }

/* Button group in actions */
.table-actions .primary.btn-sm, .table-actions .secondary.btn-sm, .table-actions .btn-outline.btn-sm, .table-actions .danger.btn-sm { border-radius:10px; }

/* Mobile fallbacks */
@media (max-width: 900px) {
  .data-table { min-width: 680px; }
}
@media (max-width: 720px) {
  .data-table { min-width: 560px; }
}

/* Ensure dropdown opens downward on small screens */
@media (max-width: 640px) {
  .notif-popover { position: fixed; top: 56px; right: 12px; left: 12px; min-width: auto; }
}
.mini .mini-text { color:#334155; font-size:.92rem; }
.mini .mini-meta { color:#64748b; font-size:.8rem; margin-top:.15rem; }
.mini.empty { text-align:center; color:#64748b; background:#f8fafc; }
.small-link { font-size:.9rem; color: var(--brand-700); text-decoration:none; }
.small-link:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .notif-popover { min-width: 260px; width: calc(100vw - 24px); right: -4px; }
}

/* Toast popup */
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 1000; }
.toast-body { display:flex; align-items:center; gap:.55rem; padding:.6rem .8rem; border:1px solid #dbeafe; border-radius:12px; background:#f0f7ff; box-shadow:0 8px 24px rgba(0,0,0,.12); color:#0f172a; }
.toast-icon { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:999px; background:#22c55e; color:#ffffff; font-weight:700; }
.toast-close { border:none; background:transparent; color:#64748b; font-size:18px; line-height:1; cursor:pointer; padding:.1rem .25rem; }

/* Navbar dropdown (Akun) */
.nav-dd { position: relative; display: inline-block; }
.nav-dd > summary { list-style: none; cursor: pointer; display:inline-flex; align-items:center; gap:.4rem; padding:.42rem .7rem; border-radius:12px; border:1px solid transparent; color: var(--brand-700); white-space: nowrap; }
.nav-dd > summary::after { content:'▾'; font-size:.8rem; line-height:1; margin-left:.25rem; color:#64748b; }
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd[open] > summary, nav .nav-dd > summary:hover { background: var(--brand-50); border-color: var(--brand-200); }
.nav-dd .menu { position:absolute; right:0; top:calc(100% + 8px); min-width: 180px; max-width: 260px; z-index: 90; border:1px solid #e5e7eb; border-radius:12px; background:#ffffff; box-shadow:0 8px 30px rgba(0,0,0,.1); padding:.4rem; }
.nav-dd .menu a, .nav-dd .menu button { display:block; width:100%; text-align:left; padding:.5rem .6rem; border-radius:10px; border:1px solid transparent; background:#ffffff; color: #1e40af; text-decoration:none; }
.nav-dd .menu a:hover, .nav-dd .menu button:hover { background: var(--brand-50); border-color: var(--brand-200); }
.nav-dd .menu button.danger { color:#b91c1c; }
.nav-dd[data-active="1"] > summary { background: var(--brand-50); border-color: var(--brand-200); }

/* Prevent overlap on small screens: make dropdowns full-width popover */
@media (max-width: 640px) {
  nav .nav-dd .menu { position: fixed; top: 56px; right: 12px; left: 12px; min-width: auto; max-width: none; }
}

/* Hide any Laravel pagination navigation (icons/numbers) just in case */
nav[role="navigation"][aria-label*="Pagination"],
.pagination,
.paginator { display: none !important; }

/* Numeric pager (no arrows) */
.pager { display:flex; align-items:center; justify-content:center; gap:.35rem; margin:1rem 0; }
.pager a, .pager span.active { 
  display:inline-flex; align-items:center; justify-content:center; 
  height:32px; min-width:32px; padding:0 .55rem; border:1px solid #e5e7eb; 
  border-radius:10px; text-decoration:none; font-size:.95rem; color:#334155; 
  background:#ffffff; transition:all .12s ease; 
}
.pager a:hover { background:#f8fafc; border-color:#dbeafe; color:#1d4ed8; }
.pager span.active { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-700); font-weight:600; }
.pager .sep { color:#94a3b8; padding:0 .25rem; }

/* Data table: modern, compact, responsive */
.table-wrap { width:100%; overflow:auto; border:1px solid #e5e7eb; border-radius:12px; background:#ffffff; }
table.data-table { width:100%; border-collapse:separate; border-spacing:0; font-size:.95rem; }
table.data-table thead th {
  position: sticky; top: 0; z-index: 1;
  background:#f8fafc; color:#0f172a; text-align:left; font-weight:600;
  border-bottom:1px solid #e5e7eb; padding:.6rem .7rem;
}
table.data-table tbody td { padding:.55rem .7rem; border-bottom:1px solid #f1f5f9; vertical-align: top; }
table.data-table tbody tr:nth-child(even) { background:#fcfdff; }
table.data-table tbody tr:hover { background:#f8fbff; }
table.data-table code { background:#f1f5f9; color:#111827; padding:.05rem .35rem; border-radius:6px; font-size:.85rem; }

/* Column sizing for staff submissions */
table.data-table .col-name { min-width: 260px; }
table.data-table .col-nim { width: 120px; white-space: nowrap; }
table.data-table .col-supervisor { min-width: 180px; }
table.data-table .col-program { width: 160px; }
table.data-table .col-term { width: 150px; white-space: nowrap; }
table.data-table .col-status { width: 110px; }
table.data-table .col-actions { min-width: 380px; }

@media (max-width: 900px) {
  table.data-table .col-program { display:none; }
}
@media (max-width: 720px) {
  table.data-table .col-supervisor { display:none; }
  .table-actions { gap:.35rem; }
  details.inline-upload input[type="file"] { max-width: 180px; }
}
@media (max-width: 520px) {
  table.data-table .col-status { display:none; }
  table.data-table .col-actions { min-width: 280px; }
}
