/* ══════════════════════════════════════════════════════════════════════════
   GAPLOW — Security & Access Management Stylesheet
   Super Admin Role: Users, Roles, Permissions Matrix & Audit Log
   Theme: High Contrast Executive Light Theme with #748636 Green Actions
   ══════════════════════════════════════════════════════════════════════════ */

.sec-view-container {
  width: 100%;
  box-sizing: border-box;
  padding: 0 4px 40px 4px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  color: #0F172A;
}

/* Header Banner */
.sec-header-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 4px;
}

.sec-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.sec-shield-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #E8F5EE;
  border: 1.5px solid #748636;
  color: #748636;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(116, 134, 54, 0.15);
  flex-shrink: 0;
}

.sec-shield-icon-badge .material-symbols-outlined {
  font-size: 26px;
}

.sec-header-title-box h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-header-title-box p {
  margin: 3px 0 0 0;
  font-size: 13.5px;
  color: #64748B;
  font-weight: 500;
}

/* Navigation Tabs */
.sec-nav-tabs-bar {
  display: flex;
  align-items: center;
  gap: 32px;
  border-bottom: 1px solid #E2E8F0;
  margin-bottom: 24px;
  background: transparent;
}

.sec-nav-tab-btn {
  background: transparent;
  border: none;
  padding: 12px 2px 14px 2px;
  font-size: 14.5px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-nav-tab-btn:hover {
  color: #0F172A;
}

.sec-nav-tab-btn.active {
  color: #0F172A;
  font-weight: 700;
}

.sec-nav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: #748636;
  border-radius: 3px 3px 0 0;
}

/* Tab Panels */
.sec-tab-panel {
  display: none;
  width: 100%;
}

.sec-tab-panel.active {
  display: block;
}

/* Section Header (Within Panels) */
.sec-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.sec-panel-title-area h2 {
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
  margin: 0;
}

.sec-panel-title-area p {
  font-size: 13px;
  color: #64748B;
  margin: 3px 0 0 0;
}

.sec-panel-actions-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Search Box */
.sec-search-wrapper {
  position: relative;
  width: 290px;
}

.sec-search-wrapper .material-symbols-outlined {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: #94A3B8;
  font-size: 19px;
  pointer-events: none;
}

.sec-search-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  font-size: 13px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 4px !important;
  color: #0F172A;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.sec-search-input:focus {
  border-color: #748636;
  box-shadow: 0 0 0 2px rgba(116, 134, 54, 0.18);
}

/* Dropdown Filters */
.sec-select-filter {
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid #CBD5E1;
  border-radius: 4px !important;
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sec-select-filter:focus {
  border-color: #748636;
}

/* Action Buttons */
.sec-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: #748636 !important;
  border: 1px solid #748636 !important;
  color: #FFFFFF !important;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 4px !important;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(116, 134, 54, 0.25);
}

.sec-btn-primary:hover {
  background: #63732D !important;
  border-color: #63732D !important;
}

.sec-btn-primary .material-symbols-outlined {
  font-size: 18px;
}

.sec-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sec-btn-secondary:hover {
  background: #F8FAFC;
  border-color: #94A3B8;
}

/* Main Table Container */
.sec-table-container {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  width: 100%;
}

.sec-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.sec-table th {
  background: #F8FAFC;
  padding: 13px 16px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid #E2E8F0;
}

.sec-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: #1E293B;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.sec-table tbody tr:hover {
  background: #F8FAF9;
}

.sec-table tbody tr:last-child td {
  border-bottom: none;
}

/* User Row & Avatar */
.sec-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sec-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

.sec-avatar-ia { background: linear-gradient(135deg, #7C3AED, #9333EA); }
.sec-avatar-sa { background: linear-gradient(135deg, #0284C7, #0EA5E9); }
.sec-avatar-am { background: linear-gradient(135deg, #059669, #10B981); }
.sec-avatar-fa { background: linear-gradient(135deg, #DB2777, #EC4899); }
.sec-avatar-ka { background: linear-gradient(135deg, #4F46E5, #6366F1); }

.sec-user-name {
  font-weight: 700;
  color: #0F172A;
  line-height: 1.2;
}

/* Badges: Roles */
.sec-role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px !important;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
}

.sec-role-super-admin {
  background: #F3E8FF;
  color: #6B21A8;
  border: 1px solid #E9D5FF;
}

.sec-role-admin {
  background: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.sec-role-manager {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.sec-role-employee {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

.sec-role-assessment-admin {
  background: #E0F2FE;
  color: #0369A1;
  border: 1px solid #BAE6FD;
}

/* Badges: Status */
.sec-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 4px !important;
  font-size: 11.5px;
  font-weight: 700;
}

.sec-status-active {
  background: #DEF7EC;
  color: #03543F;
}

.sec-status-inactive {
  background: #FEE2E2;
  color: #991B1B;
}

/* Table Row Action Icons */
.sec-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sec-icon-btn {
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 4px !important;
  cursor: pointer;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.sec-icon-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
}

.sec-icon-btn .material-symbols-outlined {
  font-size: 18px;
}

/* Table Footer / Pagination */
.sec-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  font-size: 12.5px;
  color: #64748B;
}

.sec-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.sec-page-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px !important;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sec-page-btn.active {
  background: #748636;
  border-color: #748636;
  color: #FFFFFF;
}

.sec-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════════════════
   ROLE PERMISSIONS TAB (FULL MATRIX & ROLE CUSTOMIZER)
   ══════════════════════════════════════════════════════════════════════════ */

.sec-perm-top-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.sec-role-select-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px !important;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.sec-role-select-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 230px;
}

.sec-role-select-control label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
}

.sec-role-dropdown {
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid #CBD5E1;
  border-radius: 4px !important;
  background: #F8FAFC;
  color: #0F172A;
  outline: none;
  cursor: pointer;
}

.sec-role-info-card {
  flex: 1;
  border-left: 1px solid #E2E8F0;
  padding-left: 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sec-role-info-card .material-symbols-outlined {
  color: #3B82F6;
  font-size: 22px;
  margin-top: 1px;
  flex-shrink: 0;
}

.sec-role-info-name {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.sec-role-info-desc {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
}

/* Permission Key Legend */
.sec-perm-legend-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px !important;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 270px;
}

.sec-legend-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  margin-bottom: 2px;
}

.sec-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.sec-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #1E293B;
  font-weight: 600;
}

/* Circular Permission Badges (F, E, V, S, -) */
.sec-perm-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.sec-perm-badge:hover {
  transform: scale(1.18);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sec-perm-f { background: #22C55E; color: #FFFFFF; } /* Full Management */
.sec-perm-e { background: #3B82F6; color: #FFFFFF; } /* Edit / Manage */
.sec-perm-v { background: #06B6D4; color: #FFFFFF; } /* View */
.sec-perm-s { background: #A855F7; color: #FFFFFF; } /* Own Records Only */
.sec-perm-none { background: #E2E8F0; color: #94A3B8; } /* No Access (-) */

/* Full Matrix Table */
.sec-matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.sec-matrix-table th {
  background: #F8FAFC;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1.5px solid #CBD5E1;
  text-align: center;
}

.sec-matrix-table th:first-child {
  text-align: left;
  width: 28%;
}

.sec-matrix-col-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px !important;
  font-size: 11px;
  font-weight: 800;
}

.sec-col-super-admin { background: #DEF7EC; color: #03543F; }
.sec-col-hr-admin { background: #DBEAFE; color: #1D4ED8; }
.sec-col-manager { background: #FEF3C7; color: #B45309; }
.sec-col-employee { background: #F3E8FF; color: #6B21A8; }
.sec-col-assessment { background: #CCFBF1; color: #0F766E; }

.sec-matrix-category-header td {
  background: #F1F5F9;
  font-size: 12.5px;
  font-weight: 800;
  color: #0F172A;
  padding: 9px 14px;
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
}

.sec-matrix-cat-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-matrix-row td {
  padding: 10px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid #F1F5F9;
  text-align: center;
}

.sec-matrix-row td:first-child {
  text-align: left;
  font-weight: 500;
  color: #1E293B;
  padding-left: 28px;
}

.sec-matrix-row:hover td {
  background: #F9FBFA;
}

.sec-matrix-note {
  padding: 12px 16px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  font-size: 11.5px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Single Role Detail Customizer (Attachment 1 - Bottom Right) */
.sec-customizer-box {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px !important;
  padding: 20px;
}

.sec-customizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sec-perm-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  transition: background 0.15s ease;
}

.sec-perm-list-row:hover {
  background: #F8FAF9;
}

.sec-perm-list-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sec-perm-list-left .material-symbols-outlined {
  font-size: 18px;
  color: #64748B;
}

.sec-perm-area-title {
  font-size: 13px;
  font-weight: 600;
  color: #0F172A;
}

/* Access Level Pill Selectors */
.sec-access-pill {
  padding: 5px 12px;
  border-radius: 4px !important;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sec-access-no-access { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }
.sec-access-view { background: #E0F2FE; color: #0369A1; border-color: #BAE6FD; }
.sec-access-edit { background: #DEF7EC; color: #03543F; border-color: #BCF0DA; }
.sec-access-team { background: #F0FDF4; color: #15803D; border-color: #DCFCE7; }

/* Modal Styles for Security & Access (Standard Draggable Data Windows) */
.sec-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.sec-modal-card {
  background: #FFFFFF;
  border-radius: 4px !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #CBD5E1;
}

.sec-modal-header {
  padding: 16px 20px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab !important;
  user-select: none !important;
}

.sec-modal-header:active {
  cursor: grabbing !important;
}

.sec-modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
}

.sec-modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748B;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px !important;
}

.sec-modal-close:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.sec-modal-body {
  padding: 20px;
  max-height: calc(85vh - 130px);
  overflow-y: auto;
}

.sec-modal-footer {
  padding: 14px 20px;
  background: #F8FAFC;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.sec-form-group {
  margin-bottom: 16px;
}

.sec-form-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.sec-form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  border: 1px solid #CBD5E1;
  border-radius: 4px !important;
  box-sizing: border-box;
  background: #FFFFFF;
  color: #0F172A;
  outline: none;
}

.sec-form-control:focus {
  border-color: #748636;
  box-shadow: 0 0 0 2px rgba(116, 134, 54, 0.18);
}
