.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #C8102E 0%, #9A0C23 50%, #7A0A1C 100%);
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.login-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}

.login-wrapper::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
}

.login-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.6s ease;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 36px;
  box-shadow: var(--shadow-primary);
}

.login-logo-text {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.login-logo-tagline {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 4px;
}

.login-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}

.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.login-footer p {
  font-size: 12px;
  color: var(--text-muted);
}

.role-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.role-option {
  padding: 14px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: white;
}

.role-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}

.role-option.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
}

.role-option-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.role-option-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #263238 0%, #1A2227 100%);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-brand {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-primary);
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.sidebar-brand-text span {
  color: var(--primary-light);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.35);
  padding: 8px 14px 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.75);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2px;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.sidebar-link.active {
  background: rgba(200,16,46,0.15);
  color: white;
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 4px 4px 0;
}

.sidebar-link-icon {
  font-size: 17px;
  width: 20px;
  text-align: center;
  opacity: 0.9;
}

.sidebar-link-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.current-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.current-user:hover {
  background: rgba(255,255,255,0.05);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: white;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.page-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-breadcrumb a {
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
}

.search-box input {
  width: 260px;
  padding: 8px 14px 8px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  background: var(--bg-main);
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,16,46,0.08);
  width: 320px;
}

.search-box-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--bg-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.icon-btn .notification-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---- Sidebar Mobile Toggle Button (Hamburger) ---- */
.sidebar-toggle-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--bg-main);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-primary);
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
  user-select: none;
}
.sidebar-toggle-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
  transform: scale(1.05);
}
.sidebar-toggle-btn:active { transform: scale(0.95); }

/* ---- Sidebar Overlay / Backdrop (Mobile) ---- */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  z-index: 90;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ---- Prevent body scroll ketika sidebar mobile terbuka ---- */
body.sidebar-open { overflow: hidden; }

/* ---- Close button (X) di sidebar header (hanya tampil di mobile) ---- */
.sidebar-close-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin-left: auto;
  transition: all 0.2s;
}
.sidebar-close-btn:hover {
  background: rgba(200,16,46,0.3);
  color: #ffd4dc;
}

/* ============================================================
   CATATAN: @media mobile breakpoint SUDAH DIPINDAHKAN ke PALING
   BAWAH file (setelah line ~940) agar CSS cascade order benar
   (rule spesifik menang melawan default .sidebar { position:fixed })
   ============================================================ */

.page-content {
  padding: 24px 28px;
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
}

.filter-bar {
  background: white;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar .form-group {
  margin-bottom: 0;
  flex: 1;
  min-width: 160px;
}

.filter-bar .form-label {
  font-size: 10px;
  margin-bottom: 3px;
}

.filter-bar .form-control,
.filter-bar .form-select {
  padding: 7px 10px;
  font-size: 12px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.table-wrapper {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.table-wrapper table {
  margin: 0;
}

.table-pagination {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  background: var(--secondary-bg);
}

.table-pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
}

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

.pagination-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.pagination-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.quick-action-card {
  flex: 1;
  min-width: 180px;
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.quick-action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.quick-action-icon.add { background: var(--primary-bg); color: var(--primary); }
.quick-action-icon.ticket { background: var(--cs-bg); color: var(--cs-color); }
.quick-action-icon.activation { background: var(--noc-bg); color: var(--noc-color); }
.quick-action-icon.monitor { background: var(--field-bg); color: var(--field-color); }

.quick-action-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.quick-action-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.flow-container {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--border-light);
  overflow-x: auto;
}

.flow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.flow-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.flow-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.legend-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid;
}

.color-cs { background: var(--cs-bg); border-color: var(--cs-color); }
.color-noc { background: var(--noc-bg); border-color: var(--noc-color); }
.color-field { background: var(--field-bg); border-color: var(--field-color); }
.color-network { background: var(--network-bg); border-color: var(--network-color); }
.color-done { background: var(--noc-bg); border-color: var(--success); }

.info-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 20px;
}

.info-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.activity-log {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 180px;
  padding: 20px 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.5s;
}

.chart-bar-fill.noc { background: linear-gradient(180deg, #66BB6A, var(--noc-color)); }
.chart-bar-fill.field { background: linear-gradient(180deg, #FFA726, var(--field-color)); }
.chart-bar-fill.network { background: linear-gradient(180deg, #AB47BC, var(--network-color)); }

.chart-bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}

.chart-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.highlight-box {
  background: linear-gradient(135deg, var(--primary-bg), #FFFAFA);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.highlight-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.highlight-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 3px;
}

.highlight-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.mini-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 0;
  margin-bottom: 10px;
}

.mini-table-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sop-step-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 18px;
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border-light);
  position: relative;
}

.sop-step-number {
  position: absolute;
  top: -10px;
  left: 14px;
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.sop-step-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0 8px;
}

.sop-step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.raci-table td,
.raci-table th {
  text-align: center;
  padding: 10px 8px;
  font-size: 12px;
}

.raci-table th:first-child,
.raci-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.raci-r { background: #FFF3E0; color: #E65100; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.raci-a { background: #E3F2FD; color: #1565C0; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.raci-c { background: #F3E5F5; color: #6A1B9A; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.raci-i { background: #F5F5F5; color: #5A5A5A; font-weight: 800; padding: 3px 8px; border-radius: 4px; }
.raci-empty { color: var(--text-muted); opacity: 0.5; }

/* ============================================================
   RESPONSIVE BREAKPOINT — DITAROH PALING BAWAH AGAR Cascade WIN
   ============================================================ */

/* ---- Mobile + Tablet (max 992px): Sidebar jadi Drawer off-canvas ---- */
@media (max-width: 992px) {
  /* Specificity TINGGI pakai #id + !important agar override selector .sidebar global */
  #app-sidebar.sidebar {
    width: 280px !important;
    transform: translateX(-105%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 95 !important;
    box-shadow: 4px 0 20px rgba(0,0,0,0.25) !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
  }
  #app-sidebar.sidebar.show {
    transform: translateX(0) !important;
  }
  .sidebar-close-btn { display: inline-flex !important; }
  .sidebar-toggle-btn { display: inline-flex !important; }

  #sidebar-overlay.sidebar-overlay { display: block; }
  #sidebar-overlay.sidebar-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }

  .topbar { padding: 12px 16px !important; }
  .topbar-left { gap: 12px !important; }
  .main-content { margin-left: 0 !important; }

  .search-box input { width: 160px !important; }
  .search-box input:focus { width: 200px !important; }
}

/* ---- Small Phone (max 576px) ---- */
@media (max-width: 576px) {
  .page-content { padding: 16px !important; }
  .page-title { font-size: 15px; }
  .login-card { padding: 28px 22px; }
  .role-select { grid-template-columns: 1fr 1fr; }
  .flow-legend { display: none; }
  .page-breadcrumb { display: none; }
  .search-box { display: none; }
  .filter-bar { padding: 12px; gap: 8px; }
  .btn-lg { padding: 10px 14px; font-size: 13px; }
}
