@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Exact colors from the Garnett Patterson logo */
  --gp-gold: #B8A14A;
  --gp-gold-light: #C9B668;
  --gp-gold-dark: #9A8838;
  --gp-teal: #2D5F55;
  --gp-teal-light: #3A7268;
  --gp-teal-dark: #1F4239;
  --gp-teal-darker: #152B26;
  
  /* Neutral palette */
  --gp-white: #FFFFFF;
  --gp-off-white: #F8F9FA;
  --gp-light-gray: #E9ECEF;
  --gp-gray: #6C757D;
  --gp-dark-gray: #343A40;
  --gp-black: #0A0A0A;
  
  /* Status colors */
  --status-success: #28A745;
  --status-warning: #FFC107;
  --status-error: #DC3545;
  --status-info: #17A2B8;
  
  /* Shadows & effects */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, var(--gp-teal-darker) 0%, var(--gp-teal-dark) 50%, var(--gp-teal-darker) 100%);
  color: var(--gp-dark-gray);
  line-height: 1.6;
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
}

/* Container Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 30px;
}

/* Header Section */
.header {
  background: var(--gp-white);
  border-radius: 16px;
  padding: 32px 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
}

.brand-logo {
  height: 80px;
  width: auto;
  object-fit: contain;
}

.brand-lockup h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gp-teal);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.brand-lockup p {
  font-size: 0.95rem;
  color: var(--gp-gray);
  margin: 0;
  max-width: 600px;
}

.brand-lockup__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.automation-hero {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(45, 95, 85, 0.12);
  color: var(--gp-teal);
  font-size: 1.8rem;
}

.brand-lockup__title h1 {
  margin: 0;
}

/* Status Indicator */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--gp-off-white);
  border: 2px solid var(--gp-light-gray);
  transition: all var(--transition-base);
}

.status-indicator.online {
  background: #E8F5E9;
  border-color: var(--status-success);
  color: #1B5E20;
}

.status-indicator.offline {
  background: #FFEBEE;
  border-color: var(--status-error);
  color: #B71C1C;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.connected {
  background: var(--status-success);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
  animation: pulse-green 2s infinite;
}

.status-dot.disconnected {
  background: var(--status-error);
}

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(40, 167, 69, 0.1); }
}

/* Automation Status Panel */
.automation-status-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 24px 32px;
  margin-bottom: 32px;
  backdrop-filter: blur(10px);
}

.status-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.status-panel-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gp-white);
  margin: 0;
  letter-spacing: -0.01em;
}

.server-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.server-status.online {
  background: rgba(40, 167, 69, 0.15);
  border-color: rgba(40, 167, 69, 0.4);
  color: #7FE08A;
}

.server-status.offline {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.4);
  color: #FF8A8A;
}

.automation-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.automation-status-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 16px 20px;
  border-left: 4px solid var(--gp-gray);
  transition: all var(--transition-base);
}

.automation-status-card.status-ok {
  border-left-color: var(--status-success);
}

.automation-status-card.status-warning {
  border-left-color: var(--status-warning);
}

.automation-status-card.status-error {
  border-left-color: var(--status-error);
}

.status-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.status-card-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.status-card-name {
  font-weight: 600;
  color: var(--gp-teal);
  font-size: 0.95rem;
  flex: 1;
}

.status-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-card-deps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dep-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--gp-gray);
  padding: 4px 10px;
  background: var(--gp-off-white);
  border-radius: 4px;
}

.dep-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gp-gray);
}

.dep-item.dep-ok .dep-dot {
  background: var(--status-success);
}

.dep-item.dep-missing .dep-dot {
  background: var(--status-warning);
}

.dep-item.dep-ok {
  color: var(--gp-dark-gray);
}

.dep-item.dep-missing {
  color: #B45309;
  background: #FEF3C7;
}

/* Automation Grid */
.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.automation-card {
  background: var(--gp-white);
  border-radius: 16px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.automation-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.automation-card__identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.automation-icon {
  font-size: 2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 95, 85, 0.1);
  color: var(--gp-teal);
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.automation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gp-gold), var(--gp-gold-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.automation-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.automation-card:hover::before {
  transform: scaleX(1);
}

.automation-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gp-teal);
  margin: 0;
  letter-spacing: -0.02em;
}

.automation-card p {
  color: var(--gp-gray);
  line-height: 1.7;
  margin: 0;
  flex: 1;
}

.automation-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.automation-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-card__footer .btn {
  margin-left: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gp-teal), var(--gp-teal-light));
  color: var(--gp-white);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gp-teal-light), var(--gp-teal));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, var(--gp-gold), var(--gp-gold-light));
  color: var(--gp-teal-darker);
  box-shadow: var(--shadow-md);
}

.btn-warning:hover {
  background: linear-gradient(135deg, var(--gp-gold-light), var(--gp-gold));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, var(--status-success), #34C759);
  color: var(--gp-white);
  box-shadow: var(--shadow-md);
}

.btn-success:hover {
  background: linear-gradient(135deg, #34C759, var(--status-success));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--status-error), #E53935);
  color: var(--gp-white);
  box-shadow: var(--shadow-md);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #E53935, var(--status-error));
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-admin {
  background: rgba(45, 95, 85, 0.1);
  color: var(--gp-teal);
  border: 2px solid var(--gp-teal);
}

.btn-admin:hover {
  background: var(--gp-teal);
  color: var(--gp-white);
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--gp-white);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--gp-gold);
  color: var(--gp-gold-light);
  transform: translateX(-4px);
}

/* Cards */
.card {
  background: var(--gp-white);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gp-teal);
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gp-light-gray);
}

.card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gp-teal);
  margin: 20px 0 12px 0;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--gp-teal);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gp-light-gray);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  background: var(--gp-white);
  color: var(--gp-dark-gray);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gp-teal);
  box-shadow: 0 0 0 3px rgba(45, 95, 85, 0.1);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.95rem;
}

.alert-info {
  background: #E3F2FD;
  border: 1px solid #90CAF9;
  color: #0D47A1;
}

.alert-success {
  background: #E8F5E9;
  border: 1px solid #81C784;
  color: #1B5E20;
}

.alert-warning {
  background: #FFF3E0;
  border: 1px solid #FFB74D;
  color: #E65100;
}

.alert-danger {
  background: #FFEBEE;
  border: 1px solid #E57373;
  color: #B71C1C;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead {
  background: var(--gp-teal);
  color: var(--gp-white);
}

thead th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

tbody tr {
  border-bottom: 1px solid var(--gp-light-gray);
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: var(--gp-off-white);
}

tbody td {
  padding: 14px 16px;
  color: var(--gp-dark-gray);
}

/* Tabs */
.tab-navigation {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--gp-white);
  padding: 8px;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.tab-button {
  flex: 1;
  padding: 14px 24px;
  border: none;
  background: transparent;
  color: var(--gp-gray);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-base);
  font-family: inherit;
}

.tab-button:hover {
  background: var(--gp-off-white);
  color: var(--gp-teal);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--gp-teal), var(--gp-teal-light));
  color: var(--gp-white);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: #E8F5E9;
  color: #1B5E20;
}

.badge-warning {
  background: #FFF3E0;
  color: #E65100;
}

.badge-danger {
  background: #FFEBEE;
  color: #B71C1C;
}

.badge-info {
  background: #E3F2FD;
  color: #0D47A1;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--gp-white);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 28px 32px;
  border-bottom: 2px solid var(--gp-light-gray);
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gp-teal);
  margin: 0;
}

.modal-body {
  padding: 32px;
}

.modal-footer {
  padding: 20px 32px;
  border-top: 2px solid var(--gp-light-gray);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Log Container */
.log-container {
  background: var(--gp-dark-gray);
  color: #00FF00;
  font-family: 'Consolas', 'Monaco', monospace;
  padding: 20px;
  border-radius: 8px;
  max-height: 400px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gp-light-gray);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gp-gold), var(--gp-gold-light));
  transition: width var(--transition-base);
  border-radius: 4px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gp-light-gray);
  transition: var(--transition-base);
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: var(--gp-white);
  transition: var(--transition-base);
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--gp-teal);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

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

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px;
  }
  
  .header {
    padding: 24px;
  }
  
  .brand-lockup {
    flex-direction: column;
    text-align: center;
  }
  
  .brand-logo {
    height: 60px;
  }
  
  .brand-lockup h1 {
    font-size: 1.5rem;
  }
  
  .landing-hero h2 {
    font-size: 1.8rem;
  }
  
  .automation-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  .tab-navigation {
    flex-direction: column;
  }
  
  .modal {
    margin: 20px;
  }
}
