/* ============================================================
   LSP Keamanan Indonesia - Admin Dashboard Stylesheet
   ============================================================ */

:root {
  --primary:     #0a2342;
  --primary-light:#1a3a6b;
  --accent:      #e8a020;
  --sidebar-w:   260px;
  --header-h:    60px;
  --text:        #1f2937;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --light:       #f8fafc;
  --white:       #ffffff;
  --danger:      #dc2626;
  --success:     #16a34a;
  --warning:     #d97706;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #f1f5f9; color: var(--text); }
a { text-decoration: none; color: inherit; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--primary);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-logo .logo-box {
  width: 36px; height: 36px;
  background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; color: var(--primary);
  flex-shrink: 0;
}
.sidebar-logo .logo-text { font-size: 0.82rem; font-weight: 700; color: #fff; line-height: 1.3; }
.sidebar-logo .logo-sub { font-size: 0.67rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; }

.sidebar-section {
  padding: 1rem 1rem 0.5rem;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
}

.sidebar nav { flex: 1; padding: 0.5rem 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.85rem;
  padding: 0.7rem 1.5rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.88rem; font-weight: 500;
  transition: all 0.2s; position: relative;
}
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.sidebar-link.active {
  color: var(--accent);
  background: rgba(232,160,32,0.1);
}
.sidebar-link.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--accent); border-radius: 0 3px 3px 0;
}
.sidebar-link i { width: 18px; text-align: center; font-size: 0.95rem; }
.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--accent); color: var(--primary);
  font-size: 0.7rem; font-weight: 800;
  padding: 0.15rem 0.5rem; border-radius: 50px;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem; color: rgba(255,255,255,0.4);
}

/* ---- HEADER ---- */
.admin-header {
  position: fixed; top: 0;
  left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 99;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.header-title { font-size: 1rem; font-weight: 700; color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-avatar {
  width: 36px; height: 36px;
  background: var(--primary); color: var(--accent);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 0.85rem;
  cursor: pointer;
}
.header-user { font-size: 0.85rem; }
.header-user small { color: var(--text-muted); display: block; font-size: 0.75rem; }

/* ---- MAIN CONTENT ---- */
.admin-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 1.5rem;
  min-height: calc(100vh - var(--header-h));
}

/* ---- PAGE TITLE ---- */
.page-title-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-title-bar h1 { font-size: 1.3rem; color: var(--primary); }
.breadcrumb-admin { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.breadcrumb-admin a { color: var(--primary); }

/* ---- STAT CARDS ---- */
.stat-card {
  background: var(--white); border-radius: 12px;
  padding: 1.5rem; border: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.stat-card-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-card-icon.blue  { background: #dbeafe; }
.stat-card-icon.green { background: #d1fae5; }
.stat-card-icon.yellow { background: #fef3c7; }
.stat-card-icon.red   { background: #fee2e2; }
.stat-card-icon.purple { background: #ede9fe; }
.stat-card .num { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-card .lbl { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ---- CARD ---- */
.admin-card {
  background: var(--white); border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}
.admin-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
}
.admin-card-header h5 { font-size: 0.95rem; color: var(--primary); margin: 0; font-weight: 700; }
.admin-card-body { padding: 1.5rem; }

/* ---- TABLE ---- */
.table-admin { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.table-admin thead th {
  background: var(--light); padding: 0.75rem 1rem;
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-admin tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-admin tbody tr:last-child td { border-bottom: none; }
.table-admin tbody tr:hover { background: #fafbfc; }
.table-admin .no-sert { font-family: monospace; font-size: 0.82rem; color: var(--primary-light); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; display: block; }
.form-label .required { color: var(--danger); }
.form-control, .form-select {
  width: 100%; padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; transition: border-color 0.2s;
  background: var(--white); color: var(--text);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,35,66,0.08);
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ---- BUTTONS ---- */
.btn-admin {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.2rem; border-radius: 7px;
  font-size: 0.87rem; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
  white-space: nowrap;
}
.btn-admin-primary { background: var(--primary); color: #fff; }
.btn-admin-primary:hover { background: var(--primary-light); }
.btn-admin-success { background: #16a34a; color: #fff; }
.btn-admin-success:hover { background: #15803d; }
.btn-admin-warning { background: #d97706; color: #fff; }
.btn-admin-warning:hover { background: #b45309; }
.btn-admin-danger { background: #dc2626; color: #fff; }
.btn-admin-danger:hover { background: #b91c1c; }
.btn-admin-outline {
  background: transparent; border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-admin-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-admin-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* ---- BADGE ---- */
.badge { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.badge.bg-success   { background: #d1fae5; color: #065f46; }
.badge.bg-secondary { background: #f3f4f6; color: #374151; }
.badge.bg-danger    { background: #fee2e2; color: #991b1b; }
.badge.bg-warning   { background: #fef3c7; color: #92400e; }
.badge.bg-dark      { background: #374151; color: #fff; }
.badge.bg-primary   { background: #dbeafe; color: #1e40af; }
.badge.bg-info      { background: #cffafe; color: #0e7490; }

/* ---- ALERT ---- */
.alert-admin {
  padding: 0.9rem 1.2rem; border-radius: 8px;
  margin-bottom: 1.25rem; font-size: 0.88rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.alert-admin.success { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; }
.alert-admin.error   { background: #fef2f2; border: 1px solid #fca5a5; color: #dc2626; }
.alert-admin.info    { background: #eff6ff; border: 1px solid #93c5fd; color: #1e40af; }
.alert-admin.warning { background: #fefce8; border: 1px solid #fde047; color: #92400e; }

/* ---- SEARCH BAR ---- */
.search-bar {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  align-items: center; margin-bottom: 1rem;
}
.search-input {
  flex: 1; min-width: 200px; max-width: 320px;
  padding: 0.55rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: 7px;
  font-size: 0.88rem;
}
.search-input:focus { outline: none; border-color: var(--primary); }

/* ---- PAGINATION ---- */
.pagination-admin { display: flex; gap: 0.25rem; margin-top: 1rem; justify-content: flex-end; }
.pagination-admin a, .pagination-admin span {
  padding: 0.4rem 0.75rem; border-radius: 6px;
  font-size: 0.85rem; border: 1px solid var(--border);
  color: var(--text);
}
.pagination-admin a:hover { border-color: var(--primary); color: var(--primary); }
.pagination-admin .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- STATUS TIMELINE ---- */
.timeline { list-style: none; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 18px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { display: flex; gap: 1rem; padding-bottom: 1.5rem; position: relative; }
.timeline-dot {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 0.85rem; z-index: 1;
}
.timeline-content { padding-top: 0.25rem; }
.timeline-content .ts { font-size: 0.75rem; color: var(--text-muted); }

/* ---- LOGIN ---- */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-card {
  background: var(--white); border-radius: 20px;
  padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo .shield { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.login-logo h2 { font-size: 1.2rem; color: var(--primary); }
.login-logo small { font-size: 0.8rem; color: var(--text-muted); }

/* ---- PRINT ---- */
@media print {
  .sidebar, .admin-header, .btn-admin, .no-print { display: none !important; }
  .admin-main { margin: 0; padding: 0; }
  .admin-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-header { left: 0; }
  .admin-main { margin-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 576px) {
  .form-row.cols-3 { grid-template-columns: 1fr; }
  .admin-main { padding: 1rem; }
}
