/* ============================================
   PostPro Nexus - Shared Styles
   ============================================ */

:root {
  --bg-color: #F0F2F5;
  --card-bg: #FFFFFF;
  --text-main: #1A202C;
  --text-muted: #718096;
  --accent-color: #000000;
  --tech-blue: #3B82F6;
  --tech-cyan: #06B6D4;
  --tech-green: #10B981;
  --tech-red: #EF4444;
  --tech-purple: #8B5CF6;
  --tech-orange: #F59E0B;
  --border-color: #E2E8F0;
  --grid-line: rgba(0, 0, 0, 0.05);
}

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

body { 
  background-color: var(--bg-color);
  background-image: 
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 20px 20px;
  color: var(--text-main); 
  font-family: 'Rajdhani', sans-serif; 
  min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Rajdhani', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tech-font {
  font-family: 'Share Tech Mono', monospace;
}

/* --- Header --- */
.header { 
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--text-main);
  padding: 12px 24px; 
  position: sticky; 
  top: 0; 
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  height: 70px;
}

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

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.1em;
}

.logo-divider {
  height: 20px;
  width: 1px;
  background: #e2e8f0;
  margin: 0 10px;
}

/* --- Futuristic Cards --- */
.card { 
  background: var(--card-bg); 
  border: 1px solid var(--border-color); 
  position: relative;
  padding: 20px; 
  clip-path: polygon(
    0 0, 
    100% 0, 
    100% calc(100% - 15px), 
    calc(100% - 15px) 100%, 
    0 100%, 
    0 15px,
    15px 0
  );
}

.card::before {
  content: ''; 
  position: absolute; 
  top: 0; 
  left: 0; 
  width: 30px; 
  height: 30px;
  border-top: 2px solid var(--text-main); 
  border-left: 2px solid var(--text-main); 
  pointer-events: none;
}

.card::after {
  content: ''; 
  position: absolute; 
  bottom: 0; 
  right: 0; 
  width: 30px; 
  height: 30px;
  border-bottom: 2px solid var(--text-main); 
  border-right: 2px solid var(--text-main); 
  pointer-events: none;
}

/* --- Buttons --- */
.btn { 
  background: var(--text-main); 
  color: white; 
  padding: 8px 20px; 
  font-family: 'Share Tech Mono', monospace; 
  text-transform: uppercase; 
  font-size: 14px;
  border: 1px solid var(--text-main); 
  cursor: pointer; 
  transition: all 0.2s; 
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover { 
  background: transparent; 
  color: var(--text-main); 
}

.btn:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
}

.btn-secondary { 
  background: transparent; 
  color: var(--text-main); 
  border: 1px solid var(--border-color);
  padding: 8px 16px; 
  cursor: pointer; 
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase; 
  font-size: 13px; 
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-secondary:hover { 
  background: var(--border-color); 
  border-color: var(--text-main); 
}

.btn-danger { 
  background: var(--tech-red); 
  border-color: var(--tech-red); 
  color: white; 
  padding: 8px 16px;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  font-size: 13px;
  transition: all 0.2s;
}

.btn-danger:hover { 
  background: transparent; 
  color: var(--tech-red); 
}

/* --- Inputs --- */
.input { 
  background: #F8FAFC; 
  border: 1px solid var(--border-color); 
  padding: 10px 12px; 
  color: var(--text-main); 
  width: 100%; 
  font-family: 'Share Tech Mono', monospace;
  transition: border-color 0.2s;
  font-size: 14px;
}

.input:focus { 
  outline: none; 
  border-color: var(--text-main); 
  background: white; 
}

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

/* --- Lists & Rows --- */
.row { 
  padding: 12px; 
  margin-bottom: 4px; 
  cursor: pointer; 
  transition: all 0.15s; 
  border-left: 3px solid transparent; 
  border-bottom: 1px solid #f1f1f1;
}

.row:hover { 
  background: #F8FAFC; 
  border-left-color: var(--border-color); 
}

.row.selected { 
  background: #EDF2F7; 
  border-left-color: var(--text-main); 
  font-weight: 600; 
}

/* --- Badges --- */
.badge { 
  display: inline-block; 
  padding: 2px 8px; 
  font-size: 11px; 
  font-weight: 600; 
  font-family: 'Share Tech Mono', monospace; 
  text-transform: uppercase; 
  border: 1px solid transparent;
}

.badge-green { 
  background: rgba(16, 185, 129, 0.1); 
  color: var(--tech-green); 
  border-color: var(--tech-green); 
}

.badge-yellow { 
  background: rgba(245, 158, 11, 0.1); 
  color: #D97706; 
  border-color: #D97706; 
}

.badge-gray { 
  background: #E2E8F0; 
  color: var(--text-muted); 
}

.badge-cyan { 
  background: rgba(6, 182, 212, 0.1); 
  color: var(--tech-cyan); 
  border-color: var(--tech-cyan); 
}

.badge-red { 
  background: rgba(239, 68, 68, 0.1); 
  color: var(--tech-red); 
  border-color: var(--tech-red); 
}

.badge-blue { 
  background: rgba(59, 130, 246, 0.1); 
  color: var(--tech-blue); 
  border-color: var(--tech-blue); 
}

.badge-purple {
  background: rgba(139, 92, 246, 0.1);
  color: var(--tech-purple);
  border-color: var(--tech-purple);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tech-orange);
  border-color: var(--tech-orange);
}

.btn-sm { padding: 4px 10px; font-size: 11px; }

/* --- Modals --- */
dialog { 
  background: var(--card-bg); 
  border: 1px solid var(--text-main); 
  color: var(--text-main); 
  padding: 0; 
  max-width: 90vw; 
  max-height: 90vh; 
  position: fixed; 
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%); 
  margin: 0;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 10000;
}

dialog::backdrop { 
  background: rgba(255, 255, 255, 0.8); 
  backdrop-filter: blur(4px);
  z-index: 9999;
}

.modal-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F8FAFC;
}

.modal-header h3 {
  font-weight: 700;
  font-size: 16px;
}

.modal-body {
  padding: 24px;
}

/* --- Stats & Details --- */
.stat-box { 
  padding: 16px; 
  background: #F8FAFC; 
  border: 1px solid var(--border-color); 
}

.stat-number { 
  font-family: 'Share Tech Mono', monospace; 
  font-size: 32px; 
  font-weight: 700; 
  margin-bottom: 4px; 
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-label { 
  color: var(--text-muted); 
  font-size: 12px; 
  text-transform: uppercase; 
  font-weight: 600; 
  margin-bottom: 4px;
  display: block;
}

.detail-value { 
  font-family: 'Share Tech Mono', monospace; 
  font-size: 15px; 
  color: var(--text-main); 
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #F8FAFC;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

tr:hover {
  background: #FAFAFA;
}

/* --- Loading --- */
@keyframes spin { 
  to { transform: rotate(360deg); } 
}

.loading-spinner {
  border: 4px solid #f3f3f3; 
  border-top: 4px solid var(--text-main); 
  border-radius: 50%;
  width: 40px; 
  height: 40px; 
  animation: spin 1s linear infinite;
}

/* --- Scrollbars --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Utility Classes --- */
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }

/* --- Back Link --- */
.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-main);
}

/* --- Item Cards (for components/tools) --- */
.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s;
}

.item-card:hover {
  border-color: var(--text-main);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.item-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

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

.item-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.item-meta {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Grid Layouts --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* --- Form Sections --- */
.form-section {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 16px;
}

.form-section h4 {
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14px;
}