/* ==========================================================================
   Omesh Design System v1.0
   https://omesh.net — Community mesh networking platform

   Usage: <link href="/omesh.css" rel="stylesheet">
   Theme: Override :root variables to customize colors.
   ========================================================================== */

/* ===== Theme Variables ===== */
:root {
  --o-primary: #3b82f6;
  --o-primary-hover: #2563eb;
  --o-primary-light: #eff6ff;
  --o-success: #22c55e;
  --o-success-light: #dcfce7;
  --o-warning: #f59e0b;
  --o-warning-light: #fef3c7;
  --o-error: #ef4444;
  --o-error-light: #fee2e2;

  --o-bg: #f8fafc;
  --o-bg-card: #ffffff;
  --o-bg-input: #f1f5f9;
  --o-bg-hover: #e2e8f0;
  --o-border: #e2e8f0;
  --o-border-focus: #3b82f6;

  --o-text: #1e293b;
  --o-text-sec: #64748b;
  --o-text-muted: #94a3b8;

  --o-radius: 12px;
  --o-radius-sm: 8px;
  --o-radius-pill: 24px;

  --o-font: system-ui, -apple-system, sans-serif;
  --o-mono: ui-monospace, 'SF Mono', monospace;
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  :root:not(.o-light) {
    --o-bg: #0a0f1a;
    --o-bg-card: #111827;
    --o-bg-input: #1e293b;
    --o-bg-hover: #1e3a5f;
    --o-border: #1e293b;
    --o-text: #e2e8f0;
    --o-text-sec: #94a3b8;
    --o-text-muted: #64748b;
    --o-primary-light: #1e3a5f;
    --o-success-light: #052e16;
    --o-warning-light: #451a03;
    --o-error-light: #450a0a;
  }
}
.o-dark {
  --o-bg: #0a0f1a; --o-bg-card: #111827; --o-bg-input: #1e293b;
  --o-bg-hover: #1e3a5f; --o-border: #1e293b;
  --o-text: #e2e8f0; --o-text-sec: #94a3b8; --o-text-muted: #64748b;
  --o-primary-light: #1e3a5f; --o-success-light: #052e16; --o-error-light: #450a0a;
}
.o-light {
  --o-bg: #f8fafc; --o-bg-card: #ffffff; --o-bg-input: #f1f5f9;
  --o-bg-hover: #e2e8f0; --o-border: #e2e8f0;
  --o-text: #1e293b; --o-text-sec: #64748b; --o-text-muted: #94a3b8;
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: var(--o-font);
  background: var(--o-bg);
  color: var(--o-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== Top Bar ===== */
.o-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--o-bg-card);
  border-bottom: 1px solid var(--o-border);
  position: sticky; top: 0; z-index: 20;
}
.o-topbar a { color: var(--o-primary); text-decoration: none; font-size: .9rem; font-weight: 500; }
.o-topbar h1 { flex: 1; font-size: 1.1rem; text-align: center; }

/* ===== Cards ===== */
.o-card {
  background: var(--o-bg-card);
  border: 1px solid var(--o-border);
  border-radius: var(--o-radius);
  padding: 16px;
  margin-bottom: 12px;
}
.o-card h2, .o-card h3 {
  color: var(--o-primary);
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ===== Buttons ===== */
.o-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--o-primary); color: #fff;
  border: none; padding: 10px 18px;
  border-radius: var(--o-radius-sm);
  font-size: .9rem; font-weight: 500; font-family: var(--o-font);
  cursor: pointer; width: 100%;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.o-btn:active { background: var(--o-primary-hover); }
.o-btn-sm { padding: 6px 14px; font-size: .8rem; width: auto; }
.o-btn-green { background: var(--o-success); }
.o-btn-green:active { background: #16a34a; }
.o-btn-red { background: var(--o-error); }
.o-btn-outline {
  background: transparent; border: 1px solid var(--o-border);
  color: var(--o-text-sec);
}

/* ===== Forms ===== */
.o-input, .o-textarea, .o-select,
input[type=text], input[type=password], input[type=number],
input[type=email], input[type=date], textarea, select {
  width: 100%;
  background: var(--o-bg-input);
  border: 1px solid var(--o-border);
  color: var(--o-text);
  padding: 10px 12px;
  border-radius: var(--o-radius-sm);
  font-size: .9rem;
  font-family: var(--o-font);
  margin-bottom: 8px;
}
.o-input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--o-border-focus);
}
textarea, .o-textarea { height: 100px; resize: vertical; }

/* ===== Badges & Tags ===== */
.o-badge {
  display: inline-block;
  font-size: .7rem; font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--o-radius-pill);
}
.o-badge-green { background: var(--o-success-light); color: var(--o-success); }
.o-badge-blue { background: var(--o-primary-light); color: var(--o-primary); }
.o-badge-orange { background: var(--o-warning-light); color: var(--o-warning); }
.o-badge-red { background: var(--o-error-light); color: var(--o-error); }

.o-tag {
  display: inline-block;
  background: var(--o-primary-light);
  color: var(--o-primary);
  padding: 2px 10px;
  border-radius: var(--o-radius-pill);
  font-size: .8rem;
}

/* ===== Responsive Grid ===== */
.o-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .o-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .o-grid { grid-template-columns: repeat(3, 1fr); } }
.o-span-full { grid-column: 1 / -1; }

/* ===== Content ===== */
.o-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px;
}
@media (min-width: 768px) { .o-content { padding: 20px 24px; } }

/* ===== Price List ===== */
.o-pricelist { background: var(--o-bg-card); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 16px; }
.o-pricelist h3 { color: var(--o-primary); font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.o-pricelist-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px dotted var(--o-border); }
.o-pricelist-row:last-child { border: none; }
.o-pricelist-name { font-weight: 500; }
.o-pricelist-desc { font-size: .8rem; color: var(--o-text-sec); margin-top: 2px; }
.o-pricelist-price { font-weight: 700; color: var(--o-primary); white-space: nowrap; margin-left: 12px; }

/* ===== Hours ===== */
.o-hours { background: var(--o-bg-card); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 16px; }
.o-hours h3 { color: var(--o-primary); font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.o-hours-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: .9rem; }

/* ===== Contact ===== */
.o-contact { background: var(--o-bg-card); border: 1px solid var(--o-border); border-radius: var(--o-radius); padding: 16px; }
.o-contact-row { display: flex; gap: 8px; margin: 6px 0; font-size: .9rem; color: var(--o-text-sec); }

/* ===== Search ===== */
.o-search { display: flex; gap: 8px; margin-bottom: 16px; }
.o-search input {
  flex: 1; background: var(--o-bg-input); border: 1px solid var(--o-border);
  color: var(--o-text); padding: 12px 16px; border-radius: var(--o-radius-pill); font-size: 1rem;
}
.o-search button {
  background: var(--o-primary); color: #fff; border: none;
  padding: 12px 20px; border-radius: var(--o-radius-pill);
  font-size: .9rem; cursor: pointer; font-weight: 500;
}

/* ===== Icons ===== */
.o-icon {
  width: 22px; height: 22px;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: middle;
}
.o-icon-lg { width: 32px; height: 32px; }
.o-icon-app { width: 44px; height: 44px; }

/* ===== Utility ===== */
.o-text-center { text-align: center; }
.o-text-muted { color: var(--o-text-muted); }
.o-text-sec { color: var(--o-text-sec); }
.o-text-sm { font-size: .85rem; }
.o-text-xs { font-size: .75rem; }
.o-mono { font-family: var(--o-mono); }
.o-mt-1 { margin-top: 8px; }
.o-mt-2 { margin-top: 16px; }
.o-mb-1 { margin-bottom: 8px; }
.o-mb-2 { margin-bottom: 16px; }
.o-flex { display: flex; }
.o-flex-col { display: flex; flex-direction: column; }
.o-gap-1 { gap: 8px; }
.o-gap-2 { gap: 16px; }
.o-items-center { align-items: center; }
.o-justify-between { justify-content: space-between; }

/* ===== Animations ===== */
@keyframes o-fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.o-fade-in { animation: o-fadeIn .25s ease; }
