/* ============================================
   INVENTARIS AGRINAS - Main Stylesheet
   ============================================ */

/* --- Reset & Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1B5E20;
  --primary-light: #2E7D32;
  --primary-dark: #0D3B11;
  --accent: #43A047;
  --accent-light: #66BB6A;
  --bg-body: #F1F5F1;
  --bg-card: #FFFFFF;
  --text-dark: #1A1A1A;
  --text-muted: #616161;
  --text-light: #FFFFFF;
  --border: #E0E0E0;
  --danger: #E53935;
  --warning: #FB8C00;
  --info: #1E88E5;
  --success: #43A047;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', 'Inter', -apple-system, sans-serif;
  background: var(--bg-body);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--text-light);
  padding: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 15px rgba(0,0,0,0.15);
}

.sidebar-brand {
  padding: 24px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.brand-logo-card {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  max-width: 220px;
}

.brand-logo-card .brand-logo {
  height: 34px;
  width: auto;
  object-fit: contain;
  display: block;
}

.brand-logo-card .brand-logo-danantara {
  max-width: 90px;
}

.brand-logo-card .brand-logo-agrinas {
  max-width: 55px;
}

.brand-logo-card .logo-divider {
  width: 1px;
  height: 26px;
  background: #E2E8F0;
  flex-shrink: 0;
}

.sidebar-brand h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  line-height: 1.3;
  color: #FFFFFF;
}

.sidebar-brand small {
  font-size: 0.72rem;
  opacity: 0.75;
  display: block;
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-nav .nav-section {
  padding: 10px 24px 6px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.5;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #FFF;
  border-left-color: var(--accent-light);
}

.sidebar-nav a .nav-icon {
  font-size: 1.15rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.75rem;
  opacity: 0.5;
  text-align: center;
}

/* --- Main Content --- */
.main-content {
  margin-left: 260px;
  padding: 0;
  min-height: 100vh;
}

/* --- Top Header Bar --- */
.top-bar {
  background: var(--bg-card);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar .page-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
}

.top-bar .page-title span {
  color: var(--text-muted);
  font-weight: 400;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Modern Rounded Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid #2E7D32;
  border-radius: 999px;
  padding: 4px 5px 4px 16px;
  gap: 10px;
  width: 380px;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.search-box:focus-within {
  border-color: #1B5E20;
  box-shadow: 0 0 0 3px rgba(27,94,32,0.15);
}

.search-icon-svg {
  flex-shrink: 0;
  stroke: #718096;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.85rem;
  flex: 1;
  color: var(--text-dark);
}

.search-box input::placeholder {
  color: #8C9BAE;
}

.search-btn {
  background: #0D5B36;
  color: #FFFFFF;
  border: none;
  border-radius: 999px;
  padding: 6px 22px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-btn:hover {
  background: #1B5E20;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* --- Page Body --- */
.page-body {
  padding: 28px 32px;
}

/* --- Summary Cards --- */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-icon.green  { background: #E8F5E9; color: var(--success); }
.card-icon.blue   { background: #E3F2FD; color: var(--info); }
.card-icon.orange { background: #FFF3E0; color: var(--warning); }
.card-icon.red    { background: #FFEBEE; color: var(--danger); }

.card-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Section --- */
.section {
  margin-bottom: 36px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 .section-icon {
  font-size: 1.3rem;
}

.section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 2px 8px rgba(27,94,32,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

/* --- Filter Tabs --- */
.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-body);
  border-radius: var(--radius-sm);
  padding: 4px;
  border: 1px solid var(--border);
}

.filter-tab {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  color: var(--text-muted);
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--primary);
  color: white;
}

/* --- Tables --- */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

thead {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

thead th {
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: white;
  text-align: left;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.1);
}

thead th:last-child {
  border-right: none;
}

tbody tr {
  transition: var(--transition);
  border-bottom: 1px solid #F5F5F5;
}

tbody tr:hover {
  background: #F1F8E9;
}

tbody td {
  padding: 12px 16px;
  font-size: 0.84rem;
  color: var(--text-dark);
  vertical-align: middle;
}

tbody td.muted {
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success {
  background: #E8F5E9;
  color: #2E7D32;
}

.badge-warning {
  background: #FFF3E0;
  color: #E65100;
}

.badge-danger {
  background: #FFEBEE;
  color: #C62828;
}

.badge-info {
  background: #E3F2FD;
  color: #1565C0;
}

.badge-gender {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-gender.male {
  background: #E3F2FD;
  color: #1565C0;
}

.badge-gender.female {
  background: #FCE4EC;
  color: #C2185B;
}

/* --- Row Number --- */
.row-num {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Asset Tag --- */
.asset-tag {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  background: #E8F5E9;
  padding: 3px 8px;
  border-radius: 4px;
}

.serial-num {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ip-address {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--info);
}

.mac-address {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* --- Table Footer / Pagination --- */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
}

.table-footer .showing {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  gap: 4px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination button.active,
.pagination button:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { width: 72px; }
  .sidebar-brand h2,
  .sidebar-brand small,
  .sidebar-nav .nav-section,
  .sidebar-nav a span,
  .sidebar-footer { display: none; }
  .sidebar-nav a { justify-content: center; padding: 14px 0; }
  .main-content { margin-left: 72px; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .top-bar { padding: 12px 16px; }
  .page-body { padding: 16px; }
  .search-box { width: 100%; max-width: 300px; }
  .summary-cards { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; }
}

/* --- Scroll Bar Custom --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F5F5F5; }
::-webkit-scrollbar-thumb { background: #BDBDBD; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #9E9E9E; }

/* ========================================================
   TAMBAHAN STYLING: SISTEM SPA, LOGIN, MODAL & LAPORAN AUDIT
   ======================================================== */

/* --- SPA View Navigation --- */
.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Action Buttons & Icon Buttons --- */
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #C62828;
}

.btn-secondary {
  background: #546E7A;
  color: #fff;
}
.btn-secondary:hover {
  background: #37474F;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: #F1F5F1;
  transform: scale(1.05);
}

.btn-icon.edit:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon.delete:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.action-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* --- Status Badges Lengkap --- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.badge-status.active,
.badge-status.online {
  background: #E8F5E9;
  color: #2E7D32;
}
.badge-status.active::before,
.badge-status.online::before {
  background: #2E7D32;
}

.badge-status.service,
.badge-status.maintenance {
  background: #FFF3E0;
  color: #E65100;
}
.badge-status.service::before,
.badge-status.maintenance::before {
  background: #E65100;
}

.badge-status.broken,
.badge-status.offline {
  background: #FFEBEE;
  color: #C62828;
}
.badge-status.broken::before,
.badge-status.offline::before {
  background: #C62828;
}

/* --- Search Box Dropdown Quick Results --- */
.search-results-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  min-width: 460px;
  max-width: 620px;
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
  display: none;
  max-height: 480px;
  overflow-y: auto;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

@media (max-width: 768px) {
  .search-results-popup {
    min-width: 100%;
    left: 0;
  }
}

.search-results-popup.show {
  display: block;
}

.search-result-group {
  padding: 10px 16px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  background: #F4F8F4;
  border-bottom: 1px solid #E8EFE8;
  display: flex;
  justify-content: space-between;
}

.search-result-item {
  padding: 10px 16px;
  border-bottom: 1px solid #F0F0F0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.search-result-item:hover {
  background: #F1F8E9;
}

.search-result-item .item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-result-item .item-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-dark);
}

.search-result-item .item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-result-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.user-profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 24px;
  transition: var(--transition);
}

.user-profile-trigger:hover {
  background: #F1F5F1;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.user-dropdown.show {
  display: flex;
}

.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: #F9FBF9;
}

.dropdown-header .name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.dropdown-header .role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 0.85rem;
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: #F1F8E9;
  color: var(--primary);
}

.dropdown-item.logout {
  border-top: 1px solid var(--border);
  color: var(--danger);
}

.dropdown-item.logout:hover {
  background: #FFEBEE;
  color: var(--danger);
}

/* --- Modal Dialogs --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 59, 17, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-container.modal-lg {
  max-width: 760px;
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: var(--transition);
}

.modal-close:hover {
  opacity: 1;
  transform: scale(1.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background: #F9FBF9;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Form Styles --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.col-span-2 {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--text-dark);
  background: #FFFFFF;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* --- Login Overlay --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(10, 32, 18, 0.45), rgba(7, 24, 14, 0.70)),
    url('../img/bg-sawit.jpg'),
    url('img/bg-sawit.jpg'),
    url('../bg-sawit.jpg'),
    url('bg-sawit.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
  padding: 38px 34px;
  margin: 16px;
  animation: fadeIn 0.3s ease;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand .brand-logo-card {
  margin: 0 auto 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  border: 1px solid #E2E8F0;
  background: #FFFFFF;
}

.login-brand h2 {
  font-size: 1.18rem;
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: 0.6px;
}

.login-brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-alert {
  background: #FFEBEE;
  color: #C62828;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid #FFCDD2;
  display: none;
}

.login-alert.success {
  background: #E8F5E9;
  color: #2E7D32;
  border-color: #A5D6A7;
  display: block;
}

/* --- Auth Toggle Tabs & Switch Link --- */
.auth-tabs {
  display: flex;
  background: #F1F5F1;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  border: 1px solid var(--border);
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.auth-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(27, 94, 32, 0.25);
}

.auth-form-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.auth-form-panel.active {
  display: block;
}

.auth-switch-prompt {
  margin-top: 18px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-switch-prompt a {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.auth-switch-prompt a:hover {
  color: var(--primary-light);
}

.login-credentials-hint {
  margin-top: 18px;
  padding: 10px 14px;
  background: #F1F8E9;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--primary-dark);
  border: 1px dashed #A5D6A7;
  text-align: center;
}

/* --- Card Grids for Settings & Audit --- */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.settings-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 24px;
}

.settings-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* --- Recent Activity Table in Dashboard --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #FAFAFA;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  font-size: 0.85rem;
}

.activity-item .item-title {
  font-weight: 600;
  color: var(--text-dark);
}

.activity-item .item-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --- Audit Print Kop & Signature (Hanya terlihat saat print) --- */
.print-only {
  display: none;
}

@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 11pt !important;
  }

  .sidebar,
  .top-bar,
  .section-actions,
  .pagination,
  .table-footer,
  .btn,
  .filter-tabs,
  .search-box,
  .user-info,
  .modal-overlay,
  .login-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }

  .page-body {
    padding: 0 !important;
  }

  .view-section {
    display: none !important;
  }

  #view-audit {
    display: block !important;
  }

  .print-only {
    display: block !important;
  }

  .table-wrapper {
    box-shadow: none !important;
    border: 1px solid #333 !important;
  }

  table {
    min-width: 100% !important;
    width: 100% !important;
    border: 1px solid #333 !important;
  }

  thead {
    background: #E0E0E0 !important;
    color: black !important;
  }

  thead th {
    color: black !important;
    border: 1px solid #333 !important;
  }

  tbody td {
    border: 1px solid #999 !important;
    color: black !important;
  }

  .print-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 12px;
    margin-bottom: 20px;
    position: relative;
  }

  .print-header h1 {
    font-size: 16pt;
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
  }

  .print-header h2 {
    font-size: 13pt;
    margin: 4px 0;
    font-weight: 600;
  }

  .print-header p {
    font-size: 9pt;
    margin: 2px 0;
  }

  .print-signature {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
  }

  .signature-box {
    text-align: center;
    width: 200px;
  }

  .signature-space {
    height: 70px;
  }

  .signature-name {
    font-weight: bold;
    text-decoration: underline;
  }
}

.tenure-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 150px;
}

.tenure-cell small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.tenure-cell .badge,
.table-wrapper .badge {
  white-space: nowrap;
}

.attendance-date-filter {
  min-width: 150px;
}

.attendance-date-filter label {
  margin-bottom: 0;
}

.attendance-date-filter input {
  padding: 7px 10px;
}

@media (max-width: 768px) {
  .section-actions .attendance-date-filter {
    width: 100%;
  }
}