/* ============================================================
   custom.css – Tema Tani Merdeka Indonesia
   Sistem Pendataan Anggota – Sumatera Utara
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Nunito:wght@400;600;700;800&display=swap');

/* ---- Variabel Warna ---- */
:root {
  --tani-dark:     #1b5e20;
  --tani-primary:  #2e7d32;
  --tani-medium:   #388e3c;
  --tani-light:    #4caf50;
  --tani-pale:     #e8f5e9;
  --tani-gold:     #f9a825;
  --tani-gold-lt:  #ffe082;
  --tani-red:      #c62828;
  --tani-text:     #ffffff;
  --gray-50:       #fafbfc;
  --gray-100:      #f0f2f5;
  --gray-200:      #e4e8ee;
  --gray-500:      #8892a4;
  --gray-800:      #3d4450;
  --shadow-sm:     0 2px 8px rgba(0,0,0,.08);
  --shadow-md:     0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:     0 8px 40px rgba(0,0,0,.18);
  --radius:        0.6rem;
  --radius-lg:     1rem;
}

/* ---- Global ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  font-size: 15px;
  background-color: var(--gray-100);
  color: var(--gray-800);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  min-height: 100vh;
  width: 15rem;
  background: linear-gradient(175deg, #0d3b10 0%, #1b5e20 40%, #2e7d32 100%) !important;
  box-shadow: 4px 0 20px rgba(0,0,0,.25);
  position: relative;
  flex-shrink: 0;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(249,168,37,.07) 0%, transparent 55%),
    radial-gradient(circle at 80% 75%, rgba(165,214,167,.06) 0%, transparent 55%);
  pointer-events: none;
}

/* --- Sidebar Brand --- */
.sidebar-brand {
  display: flex !important;
  align-items: center;
  padding: .85rem .85rem;
  background: rgba(0,0,0,.28) !important;
  border-bottom: 1px solid rgba(249,168,37,.3);
  text-decoration: none !important;
  min-height: 5.5rem;
  gap: .7rem;
  transition: background .2s;
}
.sidebar-brand:hover { background: rgba(0,0,0,.4) !important; }

.sidebar-brand-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));
}

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand-text .brand-main {
  font-family: 'Merriweather', serif;
  font-weight: 900;
  font-size: .84rem;
  color: var(--tani-gold);
  letter-spacing: .04rem;
  text-transform: uppercase;
}
.sidebar-brand-text .brand-sub {
  font-size: .66rem;
  font-weight: 700;
  color: rgba(255,255,255,.62);
  letter-spacing: .07rem;
  margin-top: 3px;
}

.sidebar.toggled .sidebar-brand-text { display: none; }
.sidebar.toggled .sidebar-brand-logo { margin: 0 auto; }
.sidebar.toggled .sidebar-brand { justify-content: center; }

/* --- Nav Links --- */
.sidebar .nav-item .nav-link {
  color: rgba(255,255,255,.82);
  padding: .72rem 1.1rem;
  font-size: .875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .55rem;
  border-radius: .4rem;
  margin: .1rem .5rem;
  transition: background .16s, color .16s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidebar .nav-item .nav-link i {
  width: 1.2rem;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  transition: color .16s;
}
.sidebar .nav-item .nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.sidebar .nav-item .nav-link:hover i { color: var(--tani-gold); }
.sidebar .nav-item.active .nav-link {
  color: #fff;
  background: rgba(249,168,37,.16);
  border-left-color: var(--tani-gold);
  padding-left: calc(1.1rem - 3px);
}
.sidebar .nav-item.active .nav-link i { color: var(--tani-gold); }

.sidebar-heading {
  color: rgba(255,255,255,.4);
  font-size: .58rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .15rem;
  padding: .8rem 1.1rem .25rem;
}
.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,.1);
  margin: .35rem .75rem;
}

#sidebarToggle {
  width: 2.2rem; height: 2.2rem;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
  margin: 1rem auto; display: block;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.2);
  transition: background .18s;
}
#sidebarToggle:hover { background: rgba(255,255,255,.24); }
#sidebarToggle::after {
  font-family: 'Font Awesome 5 Free'; font-weight: 900;
  content: '\f104'; color: rgba(255,255,255,.75); font-size: .85rem;
}
body.sidebar-toggled #sidebarToggle::after { content: '\f105'; }

/* ============================================================
   TOPBAR
   ============================================================ */
.bg-tani-primary {
  background: linear-gradient(90deg, var(--tani-primary), var(--tani-medium)) !important;
  border-bottom: 2px solid var(--tani-gold) !important;
}
.topbar { min-height: 4.25rem; box-shadow: 0 2px 12px rgba(0,0,0,.18) !important; }
.topbar-divider {
  width: 0; border-right: 1px solid rgba(255,255,255,.3);
  height: 2rem; margin: auto 1rem;
}

/* ============================================================
   LAYOUT
   ============================================================ */
#wrapper { display: flex; min-height: 100vh; }
#content-wrapper { background: var(--gray-100); width: 100%; overflow-x: hidden; display: flex; flex-direction: column; }
#content { flex: 1; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  background: #fff;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .card-header {
  background: linear-gradient(90deg, var(--tani-pale), #f8fcf8);
  border-bottom: 2px solid #d4edda;
  padding: .85rem 1.25rem;
  font-weight: 800;
  font-size: .9rem;
  color: var(--tani-dark);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

/* Stat Cards */
.card-stat { border-left: 4px solid var(--tani-light) !important; }
.card-stat.border-primary { border-left-color: #4e73df !important; }
.card-stat.border-success  { border-left-color: var(--tani-light) !important; }
.card-stat.border-info     { border-left-color: #17a2b8 !important; }
.card-stat.border-warning  { border-left-color: var(--tani-gold) !important; }
.card-stat.border-danger   { border-left-color: var(--tani-red)  !important; }
.card-stat .card-body { padding: 1.35rem 1.5rem; }
.card-stat .stat-label {
  font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07rem; color: var(--gray-500); margin-bottom: .35rem;
}
.card-stat .stat-number {
  font-family: 'Merriweather', serif;
  font-size: 1.9rem; font-weight: 900; color: var(--gray-800); line-height: 1;
}
.card-stat .stat-icon { color: var(--gray-200); font-size: 2rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { border-radius: .45rem; font-weight: 700; letter-spacing: .02rem; transition: all .18s; }
.btn-tani, .btn-primary {
  background: linear-gradient(135deg, var(--tani-medium), var(--tani-dark)) !important;
  border-color: var(--tani-dark) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(46,125,50,.3);
}
.btn-tani:hover, .btn-primary:hover {
  background: linear-gradient(135deg, var(--tani-dark), #0d3b10) !important;
  box-shadow: 0 4px 14px rgba(46,125,50,.4);
  transform: translateY(-1px);
}
.btn-warning { background-color: var(--tani-gold) !important; border-color: #e69500 !important; color: #fff !important; }
.btn-danger  { background-color: var(--tani-red)  !important; border-color: #a31515 !important; color: #fff !important; }
.btn-sm { font-size: .78rem; padding: .28rem .7rem; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control {
  font-size: .95rem; padding: .55rem .9rem;
  border-radius: .45rem; border: 1.5px solid var(--gray-200);
  height: auto; min-height: calc(2.5rem + 2px);
  transition: border-color .18s, box-shadow .18s;
  background: #fafffe;
}
.form-control:focus {
  border-color: var(--tani-light);
  box-shadow: 0 0 0 3px rgba(76,175,80,.15);
  background: #fff; outline: none;
}
label { font-weight: 700; font-size: .88rem; color: var(--gray-800); margin-bottom: .3rem; }
textarea.form-control { height: auto; min-height: 90px; }
.input-group-text { background: var(--tani-pale); border-color: var(--gray-200); color: var(--tani-medium); }

/* ============================================================
   TABLES
   ============================================================ */
.table { font-size: .875rem; }
.table thead th {
  background: linear-gradient(135deg, var(--tani-dark), var(--tani-primary));
  color: #fff; font-weight: 800; border: none;
  font-size: .76rem; text-transform: uppercase; letter-spacing: .06rem;
  padding: .85rem 1rem;
}
.table thead th:first-child { border-radius: .45rem 0 0 0; }
.table thead th:last-child  { border-radius: 0 .45rem 0 0; }
.table td, .table th { vertical-align: middle; padding: .65rem 1rem; }
.table-hover tbody tr:hover { background-color: var(--tani-pale); }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(232,245,233,.35); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: .72rem; font-weight: 700; padding: .32em .68em; border-radius: .38rem; }
.badge-tani { background: var(--tani-medium); color: #fff; }
.badge-success { background-color: var(--tani-light) !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { font-size: .88rem; border-radius: .55rem; border-left-width: 4px; font-weight: 600; }
.alert-success { border-left-color: var(--tani-light); background: var(--tani-pale); color: var(--tani-dark); }
.alert-danger  { border-left-color: var(--tani-red); }
.alert-warning { border-left-color: var(--tani-gold); }

/* ============================================================
   PAGE HEADING
   ============================================================ */
.h3, h1.h3 {
  font-family: 'Merriweather', serif;
  font-size: 1.3rem; font-weight: 900; color: var(--tani-dark);
}
.text-tani { color: var(--tani-medium) !important; }

.d-sm-flex.align-items-center.justify-content-between.mb-4 {
  background: #fff; padding: .9rem 1.4rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--tani-gold);
}

/* ============================================================
   FOOTER
   ============================================================ */
.sticky-footer {
  padding: 1.25rem; border-top: 1px solid var(--gray-200);
  background: #fff; font-size: .8rem; color: var(--gray-500);
}

/* ============================================================
   IMAGES
   ============================================================ */
.foto-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 50%; border: 2.5px solid var(--tani-light);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.foto-preview {
  max-width: 180px; max-height: 180px;
  border-radius: .6rem; border: 2px solid var(--tani-light);
  margin-top: 8px; box-shadow: var(--shadow-sm);
}

/* ============================================================
   SCROLL TO TOP
   ============================================================ */
.scroll-to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  width: 2.5rem; height: 2.5rem;
  background: var(--tani-medium); color: #fff;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; border-radius: 50%;
  opacity: .7; transition: opacity .2s, transform .2s;
  z-index: 999; box-shadow: var(--shadow-md);
}
.scroll-to-top:hover { opacity: 1; color: #fff; transform: translateY(-3px); }

/* ============================================================
   DATATABLES
   ============================================================ */
div.dataTables_wrapper div.dataTables_filter input {
  border: 1.5px solid var(--gray-200); border-radius: .45rem;
  font-size: .88rem; padding: .35rem .7rem;
}
div.dataTables_wrapper div.dataTables_length select {
  font-size: .88rem; border-radius: .35rem; border: 1.5px solid var(--gray-200);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--tani-medium) !important;
  border-color: var(--tani-medium) !important;
  color: #fff !important; border-radius: .35rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--tani-pale) !important;
  color: var(--tani-dark) !important;
  border-color: var(--tani-light) !important;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb { background: transparent; padding: 0; margin-bottom: .5rem; font-size: .8rem; }
.breadcrumb-item a { color: var(--tani-medium); font-weight: 600; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0d3b10 0%, #1b5e20 35%, #2e7d32 65%, #1b5e20 100%);
}
.login-page::before {
  content: '';
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(249,168,37,.1) 0%, transparent 65%);
  top: -250px; right: -250px; pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(76,175,80,.12) 0%, transparent 65%);
  bottom: -200px; left: -200px; pointer-events: none;
}

.login-container {
  width: 100%; max-width: 460px;
  padding: 1.5rem; position: relative; z-index: 2;
}

/* Logo wrapper */
.login-logo-wrap { text-align: center; margin-bottom: 1.5rem; }
.login-logo-wrap .login-logo {
  width: 115px; height: 115px;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.45));
  animation: floatLogo 3.5s ease-in-out infinite;
}
@keyframes floatLogo {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.login-logo-wrap .login-title {
  font-family: 'Merriweather', serif;
  font-weight: 900; font-size: 1.45rem; color: #fff;
  margin-top: .7rem; letter-spacing: .04rem;
  text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.login-logo-wrap .gold-line {
  width: 65px; height: 3px;
  background: linear-gradient(90deg, transparent, var(--tani-gold), transparent);
  margin: .55rem auto; border-radius: 2px;
}
.login-logo-wrap .login-subtitle {
  color: rgba(255,255,255,.62);
  font-size: .82rem; font-weight: 700; letter-spacing: .1rem;
}

/* Login card */
.login-card {
  background: #fff; border-radius: 1.25rem;
  box-shadow: 0 22px 65px rgba(0,0,0,.38);
  border: none; overflow: hidden;
}
.login-card .card-header {
  background: linear-gradient(135deg, var(--tani-dark), var(--tani-medium));
  border-bottom: 3px solid var(--tani-gold);
  padding: 1.2rem 1.5rem; text-align: center;
  border-radius: 0 !important;
}
.login-card .card-header h4 {
  color: #fff; font-family: 'Merriweather', serif;
  font-weight: 700; margin: 0; font-size: 1.05rem;
}
.login-card .card-header h4 i { color: var(--tani-gold); margin-right: .4rem; }
.login-card .card-body { padding: 1.75rem 2rem; }
.login-card .form-control {
  font-size: .98rem; height: calc(3rem + 2px);
  border-radius: .55rem; padding: .65rem 1rem;
}
.login-card .btn-primary { font-size: 1.05rem; padding: .72rem; border-radius: .6rem; letter-spacing: .05rem; }
.login-card .card-footer {
  background: var(--tani-pale); border-top: 1px solid #d4edda;
  padding: .85rem; text-align: center;
  color: var(--tani-primary); font-size: .78rem; font-weight: 700;
}

/* ============================================================
   ANIMATED TRANSITIONS
   ============================================================ */
.animated--grow-in { animation: growIn .2s ease-in-out; }
@keyframes growIn {
  from { transform: scale(.95); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  body { font-size: 14px; }
  .sidebar { display: none; }
  body.sidebar-toggled .sidebar { display: flex; position: fixed; z-index: 1000; height: 100vh; }
  #content-wrapper { margin-left: 0 !important; }
  .login-logo-wrap .login-title { font-size: 1.2rem; }
  .login-logo-wrap .login-logo { width: 90px; height: 90px; }
  .login-card .card-body { padding: 1.25rem; }
}
