/*
 * SecurityCenter — Pages Shared Stylesheet
 * Author / Credit: lautandigital.id
 * Version: 1.0.0
 */

/* =========================================================
   SHARED PAGE ELEMENTS
   ========================================================= */

/* Search Bar */
.pg-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pg-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  flex: 1;
  max-width: 380px;
  transition: var(--transition);
}
.pg-search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
.pg-search svg   { width: 15px; height: 15px; color: var(--color-text-muted); flex-shrink: 0; }
.pg-search input { flex: 1; background: none; border: none; outline: none; font-size: 0.85rem; color: var(--color-text); }
.pg-search input::placeholder { color: var(--color-text-muted); }

/* Filter Select */
.pg-filter-select {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 0.82rem;
  color: var(--color-text-subtle);
  cursor: pointer;
}
.pg-filter-select select {
  background: none;
  border: none;
  outline: none;
  font-size: 0.82rem;
  color: var(--color-text-subtle);
  cursor: pointer;
}
.pg-filter-select svg { width: 14px; height: 14px; color: var(--color-text-muted); }

/* Page Stats Row */
.pg-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.pg-stat-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}
.pg-stat-card:hover { border-color: var(--color-border-light); }

.pg-stat-card__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pg-stat-card__icon svg { width: 20px; height: 20px; }
.pg-stat-card__icon--danger  { background: rgba(239,68,68,0.12);  color: var(--color-danger); }
.pg-stat-card__icon--warning { background: rgba(245,158,11,0.12); color: var(--color-warning); }
.pg-stat-card__icon--success { background: rgba(16,185,129,0.12); color: var(--color-success); }
.pg-stat-card__icon--info    { background: rgba(59,130,246,0.12); color: var(--color-primary); }
.pg-stat-card__icon--purple  { background: rgba(139,92,246,0.12); color: #a78bfa; }

.pg-stat-card__body { flex: 1; min-width: 0; }
.pg-stat-card__value { font-size: 1.7rem; font-weight: 800; color: #fff; line-height: 1; font-variant-numeric: tabular-nums; }
.pg-stat-card__label { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 3px; }

.pg-stat-card__trend {
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.pg-stat-card__trend svg { width: 11px; height: 11px; }
.pg-stat-card__trend--up   { color: var(--color-danger); }
.pg-stat-card__trend--down { color: var(--color-success); }
.pg-stat-card__trend--ok   { color: var(--color-success); }

/* =========================================================
   STANDARD TABLE
   ========================================================= */
.pg-table-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pg-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.pg-table-header__title { font-size: 0.95rem; font-weight: 700; color: #fff; }
.pg-table-header__sub   { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 2px; }

/* Table Row Actions */
.row-actions { display: flex; gap: 6px; }
.row-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  transition: var(--transition);
  white-space: nowrap;
}
.row-btn:hover { color: var(--color-text); border-color: var(--color-border-light); }
.row-btn--danger  { background: rgba(239,68,68,0.08);  color: var(--color-danger);  border-color: rgba(239,68,68,0.2); }
.row-btn--success { background: rgba(16,185,129,0.08); color: var(--color-success); border-color: rgba(16,185,129,0.2); }
.row-btn--primary { background: rgba(59,130,246,0.08); color: var(--color-primary); border-color: rgba(59,130,246,0.2); }

/* =========================================================
   TWO-COLUMN LAYOUT
   ========================================================= */
.pg-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
}
.pg-row--3 { grid-template-columns: repeat(3, 1fr); }
.pg-row--full { grid-template-columns: 1fr; }

.pg-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pg-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  flex-wrap: wrap;
}
.pg-card__title { font-size: 0.95rem; font-weight: 700; color: #fff; }
.pg-card__sub   { font-size: 0.75rem; color: var(--color-text-muted); margin-top: 2px; }
.pg-card__body  { padding: 20px; }

/* =========================================================
   BADGE ROW
   ========================================================= */
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-tag {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--color-bg-elevated);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: var(--transition);
}
.badge-tag--active { background: rgba(59,130,246,0.12); color: var(--color-primary); border-color: rgba(59,130,246,0.3); }
.badge-tag:hover { color: var(--color-text); border-color: var(--color-border-light); }

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.empty-state__icon svg { width: 24px; height: 24px; color: var(--color-text-muted); }
.empty-state h4 { font-size: 0.95rem; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.empty-state p  { font-size: 0.83rem; color: var(--color-text-muted); }

/* =========================================================
   TIMELINE
   ========================================================= */
.timeline { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-left: 2px solid var(--color-border);
  padding-left: 20px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 20px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 2px solid var(--color-bg-card);
  background: var(--color-border);
}
.timeline-item--danger::before  { background: var(--color-danger); }
.timeline-item--warning::before { background: var(--color-warning); }
.timeline-item--success::before { background: var(--color-success); }
.timeline-item--info::before    { background: var(--color-primary); }

.timeline-item__time { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; padding-top: 2px; min-width: 70px; }
.timeline-item__body { flex: 1; }
.timeline-item__title { font-size: 0.85rem; font-weight: 600; color: var(--color-text); margin-bottom: 3px; }
.timeline-item__desc  { font-size: 0.78rem; color: var(--color-text-muted); line-height: 1.5; }

/* =========================================================
   KANBAN BOARD
   ========================================================= */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px; }
.kanban-col { background: var(--color-bg-elevated); border-radius: var(--radius-md); padding: 14px; }
.kanban-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kanban-col__title { font-size: 0.82rem; font-weight: 700; color: var(--color-text-subtle); }
.kanban-col__count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  color: var(--color-text-muted);
}
.kanban-col__cards { display: flex; flex-direction: column; gap: 8px; }

.kanban-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  border-left-width: 3px;
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.kanban-card--critical { border-left-color: var(--color-danger); }
.kanban-card--high     { border-left-color: var(--color-warning); }
.kanban-card--medium   { border-left-color: var(--color-primary); }

.kanban-card__id    { font-size: 0.68rem; font-family: var(--font-mono); color: var(--color-text-muted); margin-bottom: 6px; }
.kanban-card__title { font-size: 0.82rem; font-weight: 600; color: var(--color-text); margin-bottom: 8px; line-height: 1.4; }
.kanban-card__meta  { display: flex; align-items: center; justify-content: space-between; }
.kanban-card__time  { font-size: 0.7rem; color: var(--color-text-muted); }
.kanban-card__assign { width: 22px; height: 22px; border-radius: 50%; background: var(--gradient-primary); color: #fff; font-size: 0.58rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* =========================================================
   FORM ELEMENTS
   ========================================================= */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--color-text-subtle); margin-bottom: 6px; }
.form-label .required { color: var(--color-danger); margin-left: 3px; }
.form-input {
  width: 100%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--color-text);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.form-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-glow); }
textarea.form-input { resize: vertical; min-height: 90px; }
select.form-input { cursor: pointer; }
.form-hint { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 5px; }

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

.form-section { margin-bottom: 28px; }
.form-section__title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

/* Toggle Switch */
.form-toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(30,42,68,0.5); }
.form-toggle:last-child { border-bottom: none; }
.form-toggle__info { flex: 1; }
.form-toggle__label { font-size: 0.85rem; font-weight: 500; color: var(--color-text); margin-bottom: 2px; }
.form-toggle__desc  { font-size: 0.75rem; color: var(--color-text-muted); }
.form-toggle .toggle-switch { flex-shrink: 0; }

/* =========================================================
   PROGRESS / SCORE
   ========================================================= */
.score-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.score-ring__svg { transform: rotate(-90deg); }
.score-ring__track { fill: none; stroke: var(--color-border); stroke-width: 6; }
.score-ring__fill  { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1.2s ease; }
.score-ring__label { position: absolute; text-align: center; }
.score-ring__value { font-size: 1.5rem; font-weight: 800; color: #fff; display: block; line-height: 1; }
.score-ring__text  { font-size: 0.65rem; color: var(--color-text-muted); display: block; }

/* =========================================================
   USER / ROLE TABLE AVATAR
   ========================================================= */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff; font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-cell__name  { font-size: 0.85rem; font-weight: 600; color: var(--color-text); }
.user-cell__email { font-size: 0.72rem; color: var(--color-text-muted); }

/* Role badge */
.role-badge {
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.role-badge--admin   { background: rgba(239,68,68,0.12);  color: var(--color-danger); }
.role-badge--analyst { background: rgba(59,130,246,0.12); color: var(--color-primary); }
.role-badge--viewer  { background: rgba(100,116,139,0.12); color: var(--color-text-muted); }
.role-badge--editor  { background: rgba(16,185,129,0.12); color: var(--color-success); }

/* MFA status */
.mfa-on  { color: var(--color-success); font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.mfa-off { color: var(--color-danger);  font-size: 0.78rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.mfa-on svg, .mfa-off svg { width: 13px; height: 13px; }

/* =========================================================
   REPORT CARDS
   ========================================================= */
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 20px; }
.report-card {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: var(--transition);
  cursor: pointer;
}
.report-card:hover { border-color: var(--color-primary); transform: translateY(-2px); }

.report-card__icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.report-card__icon svg { width: 18px; height: 18px; color: var(--color-primary); }
.report-card__title { font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 5px; }
.report-card__desc  { font-size: 0.75rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 14px; }
.report-card__footer { display: flex; align-items: center; justify-content: space-between; }
.report-card__tag {
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-full); background: rgba(59,130,246,0.1); color: var(--color-primary);
}

/* =========================================================
   API KEY
   ========================================================= */
.api-key-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid rgba(30,42,68,0.5);
}
.api-key-row:last-child { border-bottom: none; }
.api-key-name  { font-size: 0.85rem; font-weight: 600; color: var(--color-text); flex: 1; }
.api-key-value {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-text-muted);
  background: var(--color-bg-elevated); border: 1px solid var(--color-border);
  border-radius: 6px; padding: 4px 10px; letter-spacing: 0.06em;
}
.api-key-date { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; }

/* =========================================================
   INTEGRATION CARD
   ========================================================= */
.integration-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px; }
.integration-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--color-bg-elevated);
  transition: var(--transition);
}
.integration-card:hover { border-color: var(--color-border-light); }
.integration-card__logo {
  width: 36px; height: 36px; border-radius: 8px; background: var(--color-bg-card);
  border: 1px solid var(--color-border); display: flex; align-items: center;
  justify-content: center; font-size: 0.62rem; font-weight: 800;
  color: var(--color-text-muted); flex-shrink: 0;
}
.integration-card__name  { font-size: 0.82rem; font-weight: 600; color: var(--color-text); }
.integration-card__status { font-size: 0.7rem; color: var(--color-text-muted); margin-top: 2px; }
.integration-card__status--on  { color: var(--color-success); }
.integration-card__status--off { color: var(--color-text-muted); }

/* =========================================================
   COMPLIANCE CONTROLS
   ========================================================= */
.control-list { display: flex; flex-direction: column; }
.control-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid rgba(30,42,68,0.5);
  transition: var(--transition);
}
.control-item:hover { background: rgba(255,255,255,0.02); }
.control-item:last-child { border-bottom: none; }

.control-status {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.control-status--pass { background: rgba(16,185,129,0.15); color: var(--color-success); }
.control-status--fail { background: rgba(239,68,68,0.15);  color: var(--color-danger); }
.control-status--warn { background: rgba(245,158,11,0.15); color: var(--color-warning); }
.control-status svg { width: 11px; height: 11px; }

.control-id { font-family: var(--font-mono); font-size: 0.72rem; color: var(--color-text-muted); width: 70px; flex-shrink: 0; }
.control-name { font-size: 0.82rem; color: var(--color-text-subtle); flex: 1; }
.control-score { font-size: 0.78rem; font-weight: 700; color: var(--color-text); width: 36px; text-align: right; }

/* =========================================================
   THREAT MAP
   ========================================================= */
.threat-map-wrap {
  background: var(--color-bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.threat-map-svg { width: 100%; height: auto; max-height: 280px; }
.threat-map-svg path { fill: #1e2a44; stroke: var(--color-border); stroke-width: 0.5; transition: fill 0.2s; }
.threat-map-svg path:hover { fill: rgba(59,130,246,0.25); }

.threat-dot {
  fill: var(--color-danger);
  opacity: 0.9;
  animation: threatPulse 2s ease-in-out infinite;
}
@keyframes threatPulse {
  0%,100% { r: 3; opacity: 0.9; }
  50%      { r: 5; opacity: 0.5; }
}

/* =========================================================
   LOG VIEWER
   ========================================================= */
.siem-log-viewer {
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.7;
  overflow: hidden;
}

.siem-log-toolbar {
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.siem-log-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 6px 12px;
  flex: 1;
  min-width: 200px;
}
.siem-log-search svg { width: 13px; height: 13px; color: var(--color-text-muted); flex-shrink: 0; }
.siem-log-search input { background: none; border: none; outline: none; font-family: var(--font-mono); font-size: 0.78rem; color: var(--color-text); flex: 1; }

.siem-log-body { max-height: 420px; overflow-y: auto; padding: 12px 16px; scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
.siem-log-line { display: flex; gap: 16px; padding: 3px 0; border-bottom: 1px solid rgba(30,42,68,0.3); }
.siem-log-line:last-child { border-bottom: none; }
.siem-log-line:hover { background: rgba(255,255,255,0.02); }

.log-ts  { color: #4ade80; white-space: nowrap; }
.log-lvl { padding: 0 6px; border-radius: 3px; font-weight: 700; white-space: nowrap; }
.log-lvl--CRIT { background: rgba(239,68,68,0.2);  color: #f87171; }
.log-lvl--HIGH { background: rgba(245,158,11,0.2); color: #fbbf24; }
.log-lvl--WARN { background: rgba(245,158,11,0.1); color: #fcd34d; }
.log-lvl--INFO { background: rgba(59,130,246,0.1); color: #93c5fd; }
.log-lvl--DEBUG{ background: rgba(100,116,139,0.1); color: #94a3b8; }

.log-src  { color: #818cf8; white-space: nowrap; }
.log-msg  { color: var(--color-text-subtle); flex: 1; }
.log-msg .highlight { color: #f87171; }

/* =========================================================
   RESPONSIVE PAGES
   ========================================================= */
@media (max-width: 1024px) {
  .pg-stats      { grid-template-columns: repeat(2, 1fr); }
  .pg-row        { grid-template-columns: 1fr; }
  .pg-row--3     { grid-template-columns: repeat(2, 1fr); }
  .report-grid   { grid-template-columns: repeat(2, 1fr); }
  .integration-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban        { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .pg-stats      { grid-template-columns: repeat(2, 1fr); }
  .form-row      { grid-template-columns: 1fr; }
  .pg-row--3     { grid-template-columns: 1fr; }
  .report-grid   { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .pg-stats { grid-template-columns: 1fr; }
}
