/* Leaver Management Plugin Styles */

/* Remove flash notice icons */
#flash_notice, #flash_error, #flash_warning {
  background-image: none !important;
}

/* Submit for Approval button */
.btn-submit {
  display: inline-block;
  padding: 8px 16px;
  background-color: #1565c0 !important;
  color: #ffffff !important;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.btn-submit:hover {
  background-color: #0d47a1 !important;
  color: #ffffff !important;
}

/* Mark Revoked button */
.btn-revoke {
  padding: 6px 12px !important;
  background-color: #ef6c00 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer;
  font-weight: 600;
}

.btn-revoke:hover {
  background-color: #e65100 !important;
  color: #ffffff !important;
}

/* Verify button */
.btn-verify {
  padding: 6px 12px !important;
  background-color: #2e7d32 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer;
  font-weight: 600;
}

.btn-verify:hover {
  background-color: #1b5e20 !important;
  color: #ffffff !important;
}

/* Status badges */
.leaver-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-open {
  background-color: #e3f2fd;
  color: #1565c0;
}

.status-in-progress {
  background-color: #fff3e0;
  color: #ef6c00;
}

.status-pending {
  background-color: #fce4ec;
  color: #c2185b;
}

.status-resolved {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.status-closed {
  background-color: #eceff1;
  color: #546e7a;
}

/* Filters and tabs */
.leaver-filters {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.leaver-status-tabs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 5px;
}

.leaver-status-tabs li {
  display: inline-block;
}

.leaver-status-tabs li a {
  display: block;
  padding: 8px 16px;
  background: #f5f5f5;
  border-radius: 4px;
  text-decoration: none;
  color: #333;
}

.leaver-status-tabs li.active a {
  background: #1976d2;
  color: white;
}

.leaver-status-tabs li.overdue a {
  background: #ffebee;
  color: #c62828;
}

/* Ticket list */
.leaver-tickets-list {
  width: 100%;
}

.leaver-tickets-list .ticket-number a {
  font-weight: 600;
  color: #1976d2;
}

.leaver-tickets-list tr.overdue {
  background-color: #ffebee;
}

.overdue-text {
  color: #c62828;
  font-weight: 600;
}

.warning-text {
  color: #ef6c00;
}

/* Progress bar */
.progress-bar-container {
  width: 100px;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.progress-bar-container.large {
  width: 200px;
  height: 12px;
}

.progress-bar-container.small {
  width: 100%;
  height: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-cell {
  white-space: nowrap;
}

/* Ticket detail page */
.leaver-ticket-detail {
  max-width: 900px;
}

div.leaver-ticket-header {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

div.leaver-ticket-header h2 {
  margin: 0 !important;
  padding: 0 !important;
  color: #1976d2;
  flex: 1;
  display: inline !important;
  float: none !important;
}

div.leaver-ticket-header span.leaver-status {
  flex-shrink: 0;
  margin-left: 20px;
  display: inline-block !important;
  float: none !important;
}

.ticket-info-row {
  display: flex;
  gap: 40px;
  margin-bottom: 20px;
  padding: 15px;
  background: #fafafa;
  border-radius: 4px;
}

.ticket-info-item label {
  display: block;
  font-size: 11px;
  color: #757575;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.ticket-info-item strong {
  font-size: 16px;
  color: #333;
}

/* Cards */
.leaver-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.leaver-card h3 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 16px;
  color: #333;
}

/* Employee details grid */
.employee-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.detail-item label {
  display: block;
  font-size: 12px;
  color: #757575;
  margin-bottom: 4px;
}

.detail-item strong {
  color: #333;
}

/* Activity timeline */
.activity-timeline {
  margin-bottom: 15px;
}

.timeline-item {
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-date {
  color: #1976d2;
  font-weight: 500;
  margin-right: 10px;
}

.timeline-actor {
  color: #757575;
}

.timeline-separator {
  color: #bdbdbd;
  margin: 0 5px;
}

.timeline-description {
  color: #333;
}

.timeline-extra {
  color: #9e9e9e;
  font-size: 12px;
  margin-left: 5px;
}

/* Add activity form */
.add-activity-form {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.inline-form {
  display: flex;
  gap: 10px;
}

.activity-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Systems access table */
.systems-access-table {
  width: 100%;
  border-collapse: collapse;
}

.systems-access-table th,
.systems-access-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.systems-access-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #757575;
}

.systems-access-table tr.completed {
  background: #f1f8e9;
}

.systems-access-table tr.pending {
  background: white;
}

.status-cell {
  text-align: center;
}

.status-check {
  color: #4caf50;
  font-size: 18px;
  font-weight: bold;
}

.mark-complete-link {
  color: #bdbdbd;
  font-size: 18px;
  text-decoration: none;
}

.mark-complete-link:hover {
  color: #4caf50;
}

.progress-summary {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Actions */
.leaver-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

/* Board view */
.leaver-board {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
}

.board-column {
  flex: 0 0 280px;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.column-header {
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-header h3 {
  margin: 0;
  font-size: 14px;
  color: white;
}

.column-header .ticket-count {
  background: rgba(255,255,255,0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  color: white;
}

.column-header.status-open {
  background: #1976d2;
}

.column-header.status-in-progress {
  background: #ef6c00;
}

.column-header.status-pending {
  background: #c2185b;
}

.column-header.status-resolved {
  background: #2e7d32;
}

.column-header.status-closed {
  background: #546e7a;
}

.column-tickets {
  padding: 10px;
  min-height: 200px;
}

.board-ticket {
  background: white;
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}

.board-ticket:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.board-ticket.overdue {
  border-left: 4px solid #c62828;
}

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

a.ticket-id {
  font-size: 11px;
  color: #1976d2;
  font-weight: 600;
  text-decoration: none;
}

a.ticket-id:hover {
  text-decoration: underline;
}

.ticket-id {
  font-size: 11px;
  color: #1976d2;
  font-weight: 600;
}

.overdue-badge {
  background: #c62828;
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.today-badge {
  background: #ef6c00;
  color: white;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.ticket-employee {
  margin-bottom: 4px;
}

.ticket-employee strong {
  display: block;
  font-size: 13px;
  color: #333;
  margin-bottom: 1px;
}

.ticket-employee small {
  color: #757575;
  font-size: 11px;
}

.ticket-meta {
  margin: 4px 0;
  font-size: 11px;
  color: #757575;
}

.ticket-meta .department::after {
  content: ' • ';
}

.ticket-date {
  margin: 4px 0;
  font-size: 11px;
}

.ticket-date .label {
  color: #757575;
}

.ticket-date .date {
  color: #333;
  font-weight: 500;
}

.ticket-progress {
  margin-top: 6px;
}

.ticket-progress .progress-text {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: #757575;
}

.no-tickets {
  text-align: center;
  padding: 30px;
  color: #9e9e9e;
  font-style: italic;
}

/* Board ticket actions */
.ticket-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.status-select {
  width: 100%;
  padding: 4px 6px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: white;
  cursor: pointer;
}

.status-select:hover {
  border-color: #1976d2;
}

.status-select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Detail page status select */
.status-change-form {
  margin-top: 4px;
}

.inline-status-form {
  display: inline;
}

.detail-status-select {
  padding: 8px 35px 8px 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  min-width: 160px;
  width: auto;
  height: auto;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.detail-status-select:hover {
  border-color: #1976d2;
}

.detail-status-select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Approval Workflow Styles */
.approval-workflow-card {
  border: 2px solid #1976d2;
}

.approval-status-banner {
  padding: 12px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.approval-status-draft {
  background: #f5f5f5;
  border-left: 4px solid #9e9e9e;
}

.approval-status-pending_approval {
  background: #fff3e0;
  border-left: 4px solid #ef6c00;
}

.approval-status-approved {
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
}

.approval-status-rejected {
  background: #ffebee;
  border-left: 4px solid #c62828;
}

.approval-status-label {
  flex: 1;
}

.submit-approval-btn {
  background: #1976d2 !important;
  color: white !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  font-weight: 600;
}

.submit-approval-btn:hover {
  background: #1565c0 !important;
}

.approval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.approval-table th,
.approval-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: top;
}

.approval-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  color: #757575;
}

.approval-row.approval-approved {
  background: #f1f8e9;
}

.approval-row.approval-rejected {
  background: #ffebee;
}

.approval-row.approval-pending {
  background: white;
}

.approval-order {
  width: 40px;
  text-align: center;
  font-weight: 600;
  color: #1976d2;
}

.approval-type small {
  color: #757575;
  font-size: 11px;
}

.approval-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.approval-badge.approval-approved {
  background: #c8e6c9;
  color: #2e7d32;
}

.approval-badge.approval-rejected {
  background: #ffcdd2;
  color: #c62828;
}

.approval-badge.approval-pending {
  background: #e0e0e0;
  color: #616161;
}

.approval-action-buttons {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.inline-approval-form {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.approval-comments-input {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid #ddd;
  border-radius: 3px;
  width: 120px;
}

.btn-approve {
  background: #4caf50 !important;
  color: white !important;
  border: none !important;
  padding: 4px 10px !important;
  border-radius: 3px !important;
  cursor: pointer;
  font-size: 11px !important;
}

.btn-approve:hover {
  background: #388e3c !important;
}

.btn-reject {
  background: #f44336 !important;
  color: white !important;
  border: none !important;
  padding: 4px 10px !important;
  border-radius: 3px !important;
  cursor: pointer;
  font-size: 11px !important;
}

.btn-reject:hover {
  background: #d32f2f !important;
}

.waiting-label {
  color: #9e9e9e;
  font-style: italic;
  font-size: 12px;
}

.approval-complete-notice {
  margin-top: 15px;
  padding: 12px 15px;
  background: #e8f5e9;
  border-radius: 4px;
  color: #2e7d32;
}

.approval-complete-notice small {
  color: #558b2f;
}

/* Flash messages */
.flash.warning {
  background: #fff3e0;
  border-left: 4px solid #ef6c00;
  padding: 12px 15px;
  margin-bottom: 15px;
}

.flash.notice {
  background: #e3f2fd;
  border-left: 4px solid #1976d2;
  padding: 12px 15px;
  margin-bottom: 15px;
}

/* Leaver Approvals Dashboard */
.leaver-approvals-dashboard {
  max-width: 1200px;
}

.approvals-section {
  margin-bottom: 30px;
}

.approvals-section h3 {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #1976d2;
  color: #333;
}

.approvals-table,
.my-tickets-table {
  width: 100%;
  border-collapse: collapse;
}

.approvals-table th,
.approvals-table td,
.my-tickets-table th,
.my-tickets-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.approvals-table th,
.my-tickets-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #757575;
}

.approval-step-badge {
  display: inline-block;
  padding: 4px 10px;
  background: #e3f2fd;
  color: #1565c0;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 500;
}

.approval-step-badge.pending {
  background: #fff3e0;
  color: #ef6c00;
}

.progress-text {
  font-size: 12px;
  color: #757575;
  margin-left: 8px;
}

/* Welcome Page Widget */
.leaver-approvals-box {
  background: white;
  border-radius: 8px;
}

.leaver-approvals-box h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #1976d2;
}

.leaver-approvals-box .approval-alert {
  margin: 8px 0;
  color: #333;
}

.leaver-approvals-box .approval-info {
  margin: 8px 0;
  color: #616161;
}

.leaver-approvals-box .widget-link {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-right: 4px;
}

.badge-warning {
  background: #ff9800;
  color: white;
}

.badge-info {
  background: #2196f3;
  color: white;
}

/* Widget Styles */
.leaver-approvals-widget {
  padding: 10px;
}

.leaver-approvals-widget .widget-section {
  margin-bottom: 20px;
}

.leaver-approvals-widget h4 {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #333;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 8px;
}

.leaver-approvals-widget .approvals-list,
.leaver-approvals-widget .my-tickets-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.leaver-approvals-widget .approvals-list th,
.leaver-approvals-widget .approvals-list td,
.leaver-approvals-widget .my-tickets-list th,
.leaver-approvals-widget .my-tickets-list td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.leaver-approvals-widget .approvals-list th,
.leaver-approvals-widget .my-tickets-list th {
  background: #fafafa;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  color: #9e9e9e;
}

.leaver-approvals-widget .btn-small {
  padding: 3px 8px !important;
  font-size: 11px !important;
}

.leaver-approvals-widget .btn-primary {
  background: #1976d2 !important;
  color: white !important;
  text-decoration: none !important;
  border-radius: 3px !important;
}

.leaver-approvals-widget .widget-footer {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.leaver-approvals-widget .widget-footer a {
  color: #1976d2;
  font-weight: 500;
  font-size: 12px;
}

/* Mini progress bar for widget */
.progress-bar-mini {
  width: 60px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 3px;
}

.approval-status-mini {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
}

.approval-status-mini.status-pending {
  background: #fff3e0;
  color: #ef6c00;
}

/* Icon for approval link */
.icon-approval:before {
  content: "";
}

/* Completion Sign-off Section */
.completion-signoff-card {
  border: 2px solid #2e7d32;
  background-color: #f1f8f4;
  margin-top: 30px;
}

.completion-signoff-card h3 {
  color: #1565c0;
  border-bottom: 2px solid #2e7d32;
  padding-bottom: 10px;
}

.signoff-status {
  margin: 15px 0;
  padding: 12px;
  background-color: #e8f5e9;
  border-left: 4px solid #2e7d32;
  font-weight: bold;
}

.signoff-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  margin-left: 10px;
}

.signoff-badge.signoff-complete {
  background-color: #2e7d32;
  color: white;
}

.signoff-details-table {
  width: 100%;
  margin: 15px 0;
  border-collapse: collapse;
}

.signoff-row {
  border-bottom: 1px solid #ddd;
}

.signoff-row:last-child {
  border-bottom: none;
}

.signoff-row td {
  padding: 12px;
  vertical-align: middle;
}

.signoff-label {
  font-weight: bold;
  width: 30%;
  background-color: #f5f5f5;
}

.signoff-user {
  width: 35%;
  font-family: monospace;
}

.signoff-date {
  width: 35%;
  color: #666;
  font-size: 12px;
}

.retention-note {
  margin-top: 15px;
  padding: 12px;
  background-color: #fff3e0;
  border-left: 4px solid #ef6c00;
  border-radius: 4px;
  font-size: 13px;
}

.retention-note p {
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .employee-details-grid {
    grid-template-columns: 1fr;
  }

  .leaver-board {
    flex-direction: column;
  }

  .board-column {
    flex: none;
    width: 100%;
  }
}
