@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Poppins:wght@700;800;900&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --blue-900: #0D47A1;
  --blue-700: #1565C0;
  --blue-500: #1E88E5;
  --blue-300: #64B5F6;
  --blue-100: #E3F2FD;
  --grad: linear-gradient(135deg, #0D47A1 0%, #1565C0 50%, #1E88E5 100%);

  --bg:     #EFF2F7;
  --surface: #ffffff;
  --border:  #DEE4EE;
  --shadow:  0 4px 16px rgba(0,0,0,.08);

  --text: #14213D;
  --muted: #6B7280;
  --label: #374151;

  --green:   #2E7D32;
  --green-l: #E8F5E9;
  --orange:  #E65100;
  --orange-l:#FFF3E0;
  --blue-b:  #1565C0;
  --blue-bl: #E3F2FD;
  --yellow:  #F57F17;
  --yellow-l:#FFFDE7;
  --red:     #C62828;
  --red-l:   #FFEBEE;
  --gray:    #546E7A;
  --gray-l:  #ECEFF1;

  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --font-h: 'Poppins', 'Inter', sans-serif;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
img { display: block; }

/* ============================================================
   HEADER (Public & Admin shared)
   ============================================================ */
.g-header {
  background: var(--grad);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.g-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.g-header-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  object-fit: contain;
}
.g-header-name {
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .02em;
}
.g-header-name span {
  color: var(--blue-300);
}
.g-header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.g-header-nav a {
  color: rgba(255,255,255,.85);
  font-size: .875rem;
  font-weight: 500;
  padding: .4rem .9rem;
  border-radius: 20px;
  transition: background .2s, color .2s;
}
.g-header-nav a:hover,
.g-header-nav a.active {
  background: rgba(255,255,255,.2);
  color: #fff;
}
.g-header-nav a.nav-logout {
  color: rgba(255,200,200,.9);
}
.g-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 2px solid rgba(255,255,255,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  margin-left: .5rem;
}

/* ============================================================
   PAGE HERO (Colored sub-header stripe)
   ============================================================ */
.g-hero {
  background: var(--grad);
  padding: 2.5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.g-hero::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: 0;
  width: 100%;
  height: 60px;
  background: var(--bg);
  border-radius: 100% 100% 0 0;
}
.g-hero-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  background: #fff;
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.g-hero-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.g-hero h1 {
  font-family: var(--font-h);
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  position: relative;
  z-index: 1;
  line-height: 1.2;
}
.g-hero p {
  color: rgba(255,255,255,.8);
  font-size: .9rem;
  margin-top: .4rem;
  position: relative;
  z-index: 1;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.g-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}
.g-container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}
.g-page-top {
  margin-top: -30px;
  position: relative;
  z-index: 2;
}

/* ============================================================
   CARD
   ============================================================ */
.g-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.g-card-header {
  background: var(--blue-100);
  border-bottom: 1px solid var(--border);
  padding: .875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.g-card-header h2 {
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-700);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.g-card-body {
  padding: 1.75rem;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.g-form-group { margin-bottom: 1.25rem; }
.g-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.g-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--label);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.g-input,
.g-select,
.g-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .65rem .9rem;
  font-family: var(--font);
  font-size: .9rem;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.g-input:focus,
.g-select:focus,
.g-textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30,136,229,.12);
}
.g-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.g-select { cursor: pointer; }

/* Upload Zone */
.g-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.g-upload-zone:hover,
.g-upload-zone.dragover {
  border-color: var(--blue-500);
  background: var(--blue-100);
}
.g-upload-zone input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.g-upload-icon { font-size: 2rem; margin-bottom: .5rem; }
.g-upload-zone p { font-size: .875rem; color: var(--muted); }
.g-upload-zone span { font-size: .78rem; color: var(--blue-500); font-weight: 600; }
.g-file-previews { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.g-preview-item { position: relative; width: 80px; height: 80px; }
.g-upload-error { min-height: 1.2rem; margin-top: .45rem; color: var(--red); font-size: .78rem; }
.g-preview-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--border);
}
.g-preview-file {
  width: 80px;
  height: 80px;
  background: var(--blue-100);
  border-radius: 8px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: var(--blue-700);
  text-align: center;
  padding: .25rem;
  word-break: break-all;
}
.g-preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* Radio / Checkbox */
.g-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: .25rem;
}
.g-radio-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  cursor: pointer;
  padding: .4rem .8rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  transition: all .2s;
}
.g-radio-label input { accent-color: var(--blue-700); }
.g-radio-label:has(input:checked) {
  background: var(--blue-100);
  border-color: var(--blue-500);
  color: var(--blue-700);
  font-weight: 600;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.g-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: .875rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: .65rem 1.25rem;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .2s;
  text-decoration: none;
}
.g-btn:active { transform: scale(.97); }
.g-btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 12px rgba(21,101,192,.3);
}
.g-btn-primary:hover { opacity: .9; box-shadow: 0 6px 20px rgba(21,101,192,.4); }
.g-btn-secondary {
  background: var(--blue-100);
  color: var(--blue-700);
  border: 1.5px solid var(--blue-300);
}
.g-btn-secondary:hover { background: var(--blue-300); color: #fff; }
.g-btn-danger {
  background: var(--red-l);
  color: var(--red);
  border: 1.5px solid #ef9a9a;
}
.g-btn-danger:hover { background: var(--red); color: #fff; }
.g-btn-success {
  background: var(--green-l);
  color: var(--green);
  border: 1.5px solid #a5d6a7;
}
.g-btn-success:hover { background: var(--green); color: #fff; }
.g-btn-sm { padding: .35rem .75rem; font-size: .78rem; }
.g-btn-full { width: 100%; justify-content: center; font-size: 1rem; padding: .8rem; }

/* ============================================================
   STATUS BADGES
   ============================================================ */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-baru        { background: var(--blue-bl); color: var(--blue-b); }
.badge-diproses    { background: var(--orange-l); color: var(--orange); }
.badge-inprogress  { background: var(--yellow-l); color: var(--yellow); }
.badge-resolved    { background: var(--green-l); color: var(--green); }
.badge-selesai     { background: #1B5E20; color: #fff; }
.badge-pending     { background: var(--gray-l); color: var(--gray); }
.badge-pushed      { background: #E8EAF6; color: #3949AB; }

/* Severity badges */
.sev-rendah   { background: #E8F5E9; color: #2E7D32; }
.sev-sedang   { background: #FFF8E1; color: #F57F17; }
.sev-tinggi   { background: #FFF3E0; color: #E65100; }
.sev-critical { background: #FFEBEE; color: #C62828; }

/* ============================================================
   TABLE (Tracker & Admin)
   ============================================================ */
.g-table-wrap {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
.g-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.g-table thead tr {
  background: var(--blue-100);
}
.g-table thead th {
  padding: .85rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  color: var(--blue-700);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 2px solid var(--blue-300);
}
.g-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.g-table tbody tr:hover { background: #FAFBFF; }
.g-table tbody tr:last-child { border-bottom: none; }
.g-table td {
  padding: .85rem 1rem;
  vertical-align: middle;
  color: var(--text);
}
.g-table td.muted { color: var(--muted); font-size: .8rem; }
.g-table .td-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.g-table .row-num {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

/* ============================================================
   FILTER BAR (Tracker)
   ============================================================ */
.g-filterbar {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.g-filterbar .g-input { max-width: 280px; }
.g-filterbar .g-select { max-width: 180px; }
.g-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}
.g-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--blue-100);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.g-page-btn:hover,
.g-page-btn.active { background: var(--blue-700); color: #fff; }
.g-page-btn:disabled { opacity: .4; cursor: default; }

/* ============================================================
   ALERTS
   ============================================================ */
.g-alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.g-alert-success { background: var(--green-l); color: var(--green); border: 1px solid #a5d6a7; }
.g-alert-error   { background: var(--red-l); color: var(--red); border: 1px solid #ef9a9a; }
.g-alert-info    { background: var(--blue-bl); color: var(--blue-b); border: 1px solid var(--blue-300); }
.g-alert-warning { background: var(--yellow-l); color: var(--yellow); border: 1px solid #f9d775; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
}
.login-logo-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--blue-100);
  padding: 12px;
  margin: 0 auto 1.25rem;
  border: 3px solid var(--blue-300);
}
.login-logo-wrap img { width: 100%; height: 100%; object-fit: contain; }
.login-card h1 {
  font-family: var(--font-h);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--blue-700);
  margin-bottom: .25rem;
}
.login-card p { color: var(--muted); font-size: .875rem; margin-bottom: 1.75rem; }

/* ============================================================
   ADMIN DASHBOARD LAYOUT
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}
.admin-section-title {
  font-family: var(--font-h);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--blue-100);
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* Member Cards (Admin sidebar) */
.member-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.member-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  transition: border-color .2s;
}
.member-item:hover { border-color: var(--blue-500); }
.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-100);
  flex-shrink: 0;
}
.member-info p { font-size: .875rem; font-weight: 600; color: var(--text); }
.member-info span { font-size: .75rem; color: var(--muted); }

/* Trello status dots */
.trello-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: .4rem;
}

/* ============================================================
   MODAL (Admin verify/update overlay)
   ============================================================ */
.g-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.g-modal-overlay.open { display: flex; }
.g-modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.g-modal-header {
  background: var(--grad);
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.g-modal-header h3 {
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}
.g-modal-close {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.g-modal-close:hover { background: rgba(255,255,255,.35); }
.g-modal-body { padding: 1.5rem 1.5rem 8rem 1.5rem; }
.g-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
}
.admin-attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: .75rem;
}
.admin-attachment-item {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem;
  background: #fff;
}
.admin-attachment-item img,
.admin-attachment-item video {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  margin-bottom: .4rem;
  background: #f5f7fa;
}
.admin-attachment-item a {
  display: block;
  overflow: hidden;
  color: var(--blue-700);
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   TABS (Admin)
   ============================================================ */
.g-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
}
.g-tab {
  padding: .65rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .2s, border-color .2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
}
.g-tab:hover { color: var(--blue-700); }
.g-tab.active { color: var(--blue-700); border-bottom-color: var(--blue-700); }
.g-tab-content { display: none; }
.g-tab-content.active { display: block; }

/* ============================================================
   MISC
   ============================================================ */
.g-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.text-muted { color: var(--muted); font-size: .8rem; }
.text-center { text-align: center; }

.g-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}
.g-empty-state .g-empty-icon { font-size: 3rem; margin-bottom: .75rem; }
.g-empty-state p { font-size: .9rem; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Trello link */
.trello-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--blue-500);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
}
.trello-link:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
  .g-form-row { grid-template-columns: 1fr; }
  .g-header { padding: 0 .75rem; }
  .g-header-brand { flex: 0 0 auto; }
  .g-header-name { display: none; }
  .g-header-nav {
    min-width: 0;
    gap: 0;
  }
  .g-header-nav a {
    padding: .4rem .45rem;
    font-size: .75rem;
  }
  .g-header-avatar {
    width: 30px;
    height: 30px;
    margin-left: .25rem;
  }
  .g-filterbar .g-input { max-width: 100%; }
  .g-hero { padding: 2rem 1.25rem 3.5rem; }
  .g-table thead th { padding: .65rem .75rem; }
  .g-table td { padding: .65rem .75rem; }
}
@media (max-width: 480px) {
  .g-header-avatar { display: none; }
  .g-hero h1 { font-size: 1.4rem; }
  .g-card-body { padding: 1.25rem; }
  .g-modal { border-radius: 0; }
}
