/*!
Theme Name: 531 Digital KPI Dashboard
Theme URI: https://531digital.com
Author: 531 Digital
Author URI: https://531digital.com
Description: Professional KPI tracking and business intelligence dashboard for healthcare data infrastructure companies. Features real-time metrics, team management, revenue tracking, and comprehensive reporting.
Version: 9.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: 531-digital-kpi
Domain Path: /languages
Requires at least: 5.9
Requires PHP: 7.4
*/

/* ============================================
   531 Digital KPI Dashboard Theme
   Version 8.0
   ============================================ */

:root {
  --primary: #667eea;
  --primary-dark: #764ba2;
  --secondary: #f093fb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1f2937;
  --light: #f9fafb;
  --border: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: #ffffff;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ============================================
   Layout & Container
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.col {
  display: flex;
  flex-direction: column;
}

/* ============================================
   Header & Navigation
   ============================================ */

.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.site-header a {
  color: white;
}

.site-header a:hover {
  color: var(--secondary);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.site-logo {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.site-title {
  font-size: 1.8rem;
  margin: 0;
}

.site-description {
  font-size: 0.95rem;
  opacity: 0.9;
  margin: 0;
}

.main-navigation {
  background: rgba(0, 0, 0, 0.1);
  padding: 0;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.main-navigation li {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.main-navigation li:last-child {
  border-right: none;
}

.main-navigation a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: white;
  transition: background 0.3s ease;
}

.main-navigation a:hover {
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

/* ============================================
   Content Area
   ============================================ */

.site-content {
  padding: 3rem 0;
  min-height: 60vh;
}

.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
  border-radius: 8px;
}

.page-header h1 {
  color: white;
  margin-bottom: 0.5rem;
}

.page-header p {
  opacity: 0.95;
  margin-bottom: 0;
}

.post, .page {
  margin-bottom: 3rem;
  padding: 2rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-title, .page-title {
  margin-bottom: 1rem;
  color: var(--primary);
}

.post-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-content, .page-content {
  line-height: 1.8;
}

.post-content p, .page-content p {
  margin-bottom: 1.5rem;
}

.post-content h2, .page-content h2,
.post-content h3, .page-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content ul, .page-content ul,
.post-content ol, .page-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.post-content li, .page-content li {
  margin-bottom: 0.5rem;
}

.post-content table, .page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.post-content table th, .page-content table th {
  background: var(--light);
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 600;
}

.post-content table td, .page-content table td {
  padding: 1rem;
  border: 1px solid var(--border);
}

.post-content blockquote, .page-content blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

.post-content code, .page-content code {
  background: var(--light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre, .page-content pre {
  background: var(--dark);
  color: #e5e7eb;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.post-content pre code, .page-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ============================================
   Sidebar & Widgets
   ============================================ */

.sidebar {
  padding: 2rem;
  background: var(--light);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.widget {
  margin-bottom: 2rem;
}

.widget:last-child {
  margin-bottom: 0;
}

.widget-title {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
}

.widget ul {
  list-style: none;
}

.widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.widget li:last-child {
  border-bottom: none;
}

.widget a {
  display: block;
  padding: 0.5rem 0;
}

/* ============================================
   Buttons & Forms
   ============================================ */

button, .button, input[type="button"], input[type="submit"] {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

button:hover, .button:hover, input[type="button"]:hover, input[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

button:active, .button:active {
  transform: translateY(0);
}

button.secondary, .button.secondary {
  background: var(--text-secondary);
}

button.secondary:hover, .button.secondary:hover {
  background: var(--text-primary);
}

button.success, .button.success {
  background: var(--success);
}

button.success:hover, .button.success:hover {
  background: #059669;
}

button.danger, .button.danger {
  background: var(--danger);
}

button.danger:hover, .button.danger:hover {
  background: #dc2626;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

/* ============================================
   Cards & Boxes
   ============================================ */

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.1);
  transform: translateY(-4px);
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.card-title {
  color: var(--primary);
  font-size: 1.2rem;
  margin: 0;
}

.card-body {
  padding: 0;
}

.card-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 1rem;
}

.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-info {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0c4a6e;
}

.alert-success {
  background: #dcfce7;
  border-color: #16a34a;
  color: #15803d;
}

.alert-warning {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.alert-danger {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
  background: var(--dark);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}

.site-footer a {
  color: var(--secondary);
}

.site-footer a:hover {
  color: white;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  .main-navigation ul {
    flex-direction: column;
  }

  .main-navigation li {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  }

  .main-navigation li:last-child {
    border-bottom: none;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .site-content {
    padding: 1.5rem 0;
  }

  .page-header {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
  }

  .post, .page {
    padding: 1.5rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Utility Classes
   ============================================ */

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

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

.text-muted {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--primary);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   KPI Portal (v8.0+)
   ============================================ */

.kpi-portal-header {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.kpi-portal-sub {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto;
}

/* Notices */
.kpi-notice {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-weight: 500;
}

.kpi-notice-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.kpi-notice-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.kpi-notice-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Tabs */
.kpi-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.kpi-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.kpi-tab:hover {
  color: var(--primary);
}

.kpi-tab.is-active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.kpi-tab-icon {
  margin-right: 0.4rem;
}

/* Panels */
.kpi-panel {
  display: none;
}

.kpi-panel.is-active {
  display: block;
}

.kpi-panel-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* KPI tracker cards */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.25);
}

.kpi-card-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.kpi-card-value {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-card-target {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 0.4rem;
}

.kpi-progress {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  height: 7px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.kpi-progress-bar {
  background: #fff;
  height: 100%;
  border-radius: 99px;
  transition: width 0.4s ease;
}

.kpi-progress-bar.is-complete {
  background: var(--success);
}

/* Forms */
.kpi-forms-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-bottom: 2rem;
}

.kpi-form-card,
.kpi-list-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.kpi-form-title {
  font-size: 1.15rem;
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kpi-count {
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 99px;
  font-size: 0.8rem;
  padding: 0.1rem 0.65rem;
  font-weight: 600;
}

.kpi-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kpi-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.kpi-field .req {
  color: var(--danger);
}

.kpi-field input,
.kpi-field select,
.kpi-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
}

.kpi-field input:focus,
.kpi-field select:focus,
.kpi-field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.kpi-field-wide {
  grid-column: 1 / -1;
}

.kpi-targets-card .kpi-field {
  margin-bottom: 1rem;
}

/* Buttons */
.kpi-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--light);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.4rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.kpi-btn:hover {
  background: #f1f5f9;
}

.kpi-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.kpi-btn-primary:hover {
  filter: brightness(1.05);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

/* Running list table */
.kpi-list-card {
  margin-bottom: 2.5rem;
}

.kpi-table-wrap {
  overflow-x: auto;
}

.kpi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.kpi-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.kpi-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.kpi-table tbody tr:hover {
  background: var(--light);
}

.kpi-row-actions {
  text-align: right;
  white-space: nowrap;
}

.kpi-delete {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.kpi-delete:hover {
  text-decoration: underline;
}

.kpi-empty {
  color: var(--text-secondary);
  padding: 1rem 0;
}

/* Responsive */
@media (max-width: 900px) {
  .kpi-forms-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kpi-tabs {
    gap: 0;
  }

  .kpi-tab {
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
  }

  .kpi-card-value {
    font-size: 1.7rem;
  }
}

/* ============================================
   KPI Portal v9.0 — Records & Overview
   ============================================ */

.kpi-overview-heading {
  font-size: 1.2rem;
  margin: 1.75rem 0 1rem;
}

/* Revenue cards: white with colored value, to separate from business metrics */
.kpi-card-revenue {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.kpi-card-revenue .kpi-card-label {
  color: var(--text-secondary);
  opacity: 1;
}

.kpi-card-revenue .kpi-card-value {
  color: var(--primary);
}

.kpi-overview-note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--light);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Record form */
.kpi-record-form {
  margin-bottom: 1.5rem;
}

/* Status badges */
.kpi-status {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.65rem;
  border-radius: 99px;
  background: var(--light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.kpi-status-live,
.kpi-status-active,
.kpi-status-completed {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.kpi-status-onboarding,
.kpi-status-development,
.kpi-status-qa,
.kpi-status-uat,
.kpi-status-discovery {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.kpi-status-prospect,
.kpi-status-planning {
  background: #fefce8;
  border-color: #fde68a;
  color: #92400e;
}

.kpi-status-on-hold,
.kpi-status-paused {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.kpi-status-maintenance,
.kpi-status-expansion,
.kpi-status-contract-signed {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

/* Checkbox groups */
.kpi-field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.kpi-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.4rem 1rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--light);
}

.kpi-checkbox {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 400;
  cursor: pointer;
}

.kpi-checkbox input {
  width: auto;
  accent-color: var(--primary);
}

/* Edit link + field hint */
.kpi-edit {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.kpi-edit:hover {
  text-decoration: underline;
}

.kpi-field-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

.kpi-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5rem 0 1.5rem;
}
