/* ============================================================
   GRAMATON.PRO — OLD MONEY DESIGN SYSTEM
   "Сдержанный люкс" — Dark Academia / Old Money
   v1.0 — 2026-07-03
   ============================================================ */

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

/* === DESIGN TOKENS === */
:root {
  /* === OLD MONEY PALETTE === */
  --om-bg-primary: #0f0d0a;
  --om-bg-secondary: #1a1714;
  --om-bg-card: rgba(26, 23, 20, 0.85);
  --om-bg-elevated: rgba(36, 32, 28, 0.6);
  --om-bg-cream: #f5f0e8;
  --om-bg-ivory: #faf6ef;
  
  /* Wood & Velvet tones */
  --om-wood-dark: #2c1810;
  --om-wood-mahogany: #3d1111;
  --om-velvet-burgundy: #4a1525;
  --om-velvet-green: #1a2e22;
  --om-velvet-navy: #0f1a2e;
  
  /* Gold accents */
  --om-gold-primary: #c9a84c;
  --om-gold-light: #e2c76c;
  --om-gold-dark: #a88a2e;
  --om-gold-burnished: #b8942e;
  --om-gold-subtle: rgba(201, 168, 76, 0.15);
  --om-gold-glow: rgba(201, 168, 76, 0.3);
  
  /* Cream & Ivory */
  --om-cream: #f5f0e8;
  --om-ivory: #faf6ef;
  --om-champagne: #f7e8d0;
  
  /* Text palette */
  --om-text-primary: #f5f0e8;
  --om-text-heading: #faf6ef;
  --om-text-body: rgba(245, 240, 232, 0.78);
  --om-text-muted: rgba(245, 240, 232, 0.4);
  --om-text-accent: #c9a84c;
  --om-text-gold: #c9a84c;
  --om-text-error: #c94c4c;
  
  /* Dark text (for light sections) */
  --om-text-dark-primary: #1a1714;
  --om-text-dark-body: rgba(26, 23, 20, 0.75);
  --om-text-dark-muted: rgba(26, 23, 20, 0.4);
  
  /* Borders */
  --om-border-gold: 1px solid rgba(201, 168, 76, 0.2);
  --om-border-gold-light: 1px solid rgba(201, 168, 76, 0.1);
  --om-border-gold-hover: 1px solid rgba(201, 168, 76, 0.4);
  --om-border-charcoal: 1px solid rgba(245, 240, 232, 0.06);
  --om-border-charcoal-visible: 1px solid rgba(245, 240, 232, 0.12);
  
  /* Shadows */
  --om-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.5);
  --om-shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.6);
  --om-shadow-gold: 0 4px 20px rgba(201, 168, 76, 0.15);
  --om-shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  
  /* Gradients */
  --om-grad-gold: linear-gradient(135deg, #c9a84c 0%, #e2c76c 40%, #b8942e 100%);
  --om-grad-gold-subtle: linear-gradient(135deg, rgba(201, 168, 76, 0.1) 0%, rgba(226, 199, 108, 0.05) 100%);
  --om-grad-dark: linear-gradient(180deg, #0f0d0a 0%, #1a1714 100%);
  --om-grad-warm: linear-gradient(180deg, #1a1714 0%, #241f1a 100%);
  --om-grad-burgundy: linear-gradient(135deg, #3d1111 0%, #4a1525 100%);
  --om-grad-navy: linear-gradient(135deg, #0f1a2e 0%, #1a2e3d 100%);
  
  /* Shapes */
  --om-radius-sm: 6px;
  --om-radius-md: 10px;
  --om-radius-lg: 16px;
  --om-radius-xl: 20px;
  --om-radius-full: 9999px;
  
  /* Typography */
  --om-font-heading: 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --om-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --om-font-accent: 'Cormorant Garamond', Georgia, serif;
  
  /* Durations */
  --om-duration-fast: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --om-duration-smooth: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --om-duration-slow: 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === RESET === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow-x: hidden;
  font-family: var(--om-font-body);
  background: var(--om-bg-primary);
  color: var(--om-text-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* === SCROLLBAR ELEGANT === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 168, 76, 0.35); }

/* === OLD MONEY BACKGROUND === */
.om-bg {
  position: relative;
}
.om-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 15% 20%, rgba(201, 168, 76, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(61, 17, 17, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, rgba(201, 168, 76, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Subtle damask pattern overlay */
.om-bg::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* === GLASS CARD — Old Money Style === */
.om-card {
  background: var(--om-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--om-border-gold-light);
  border-radius: var(--om-radius-md);
  box-shadow: var(--om-shadow-card);
  transition: all var(--om-duration-smooth);
}
.om-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  box-shadow: var(--om-shadow-gold);
  transform: translateY(-2px);
}

/* === GOLD BORDER VARIANTS === */
.om-border-gold {
  border: 1px solid rgba(201, 168, 76, 0.2);
}
.om-border-gold-thin {
  border: 1px solid rgba(201, 168, 76, 0.12);
}
.om-border-gold-bottom {
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}

/* === BUTTONS === */
.om-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--om-radius-sm);
  border: none;
  background: var(--om-grad-gold);
  color: #0f0d0a;
  font-family: var(--om-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--om-duration-fast);
  text-decoration: none;
  white-space: nowrap;
}
.om-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.25);
}
.om-btn-primary:active {
  transform: translateY(0);
}

.om-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: var(--om-radius-sm);
  border: var(--om-border-gold);
  background: transparent;
  color: var(--om-text-accent);
  font-family: var(--om-font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--om-duration-fast);
  text-decoration: none;
  white-space: nowrap;
}
.om-btn-secondary:hover {
  background: rgba(201, 168, 76, 0.08);
  border-color: var(--om-gold-primary);
  color: var(--om-text-heading);
}

.om-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--om-radius-sm);
  border: none;
  background: transparent;
  color: var(--om-text-body);
  font-family: var(--om-font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--om-duration-fast);
  text-decoration: none;
}
.om-btn-ghost:hover {
  background: rgba(245, 240, 232, 0.04);
  color: var(--om-text-primary);
}

/* === HEADINGS === */
.om-heading-xl {
  font-family: var(--om-font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--om-text-heading);
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.om-heading-lg {
  font-family: var(--om-font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--om-text-heading);
  line-height: 1.2;
}
.om-heading-md {
  font-family: var(--om-font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--om-text-heading);
  line-height: 1.25;
}
.om-heading-sm {
  font-family: var(--om-font-heading);
  font-size: 17px;
  font-weight: 600;
  color: var(--om-text-heading);
  line-height: 1.3;
}
.om-heading-xs {
  font-family: var(--om-font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--om-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* === TEXT GRADIENT GOLD === */
.om-text-gold {
  background: var(--om-grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === DIVIDER WITH GOLD === */
.om-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.2), transparent);
  margin: 24px 0;
  border: none;
}

/* === BADGE === */
.om-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: var(--om-radius-full);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.om-badge-gold {
  background: rgba(201, 168, 76, 0.12);
  color: var(--om-gold-primary);
  border: 1px solid rgba(201, 168, 76, 0.15);
}
.om-badge-green {
  background: rgba(76, 201, 120, 0.1);
  color: #4cc978;
  border: 1px solid rgba(76, 201, 120, 0.15);
}
.om-badge-red {
  background: rgba(201, 76, 76, 0.1);
  color: #c94c4c;
  border: 1px solid rgba(201, 76, 76, 0.15);
}
.om-badge-amber {
  background: rgba(201, 168, 76, 0.08);
  color: var(--om-gold-light);
  border: 1px solid rgba(201, 168, 76, 0.1);
}

/* === AVATAR === */
.om-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--om-grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #0f0d0a;
  flex-shrink: 0;
  font-family: var(--om-font-heading);
}
.om-avatar-lg {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--om-grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #0f0d0a;
  flex-shrink: 0;
  font-family: var(--om-font-heading);
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.2);
  position: relative;
}
.om-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 168, 76, 0.3);
}

/* === STATUS INDICATOR === */
.om-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--om-text-muted);
}
.om-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.om-status-dot.online { background: #4cc978; }
.om-status-dot.offline { background: rgba(245, 240, 232, 0.2); }
.om-status-dot.away { background: #c9a84c; }

/* === FORM ELEMENTS === */
.om-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--om-radius-sm);
  border: var(--om-border-charcoal-visible);
  background: rgba(15, 13, 10, 0.6);
  color: var(--om-text-primary);
  font-family: var(--om-font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--om-duration-fast);
}
.om-input:focus {
  border-color: rgba(201, 168, 76, 0.35);
}
.om-input::placeholder {
  color: var(--om-text-muted);
}

.om-select {
  padding: 10px 14px;
  border-radius: var(--om-radius-sm);
  border: var(--om-border-charcoal-visible);
  background: rgba(15, 13, 10, 0.6);
  color: var(--om-text-primary);
  font-family: var(--om-font-body);
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--om-duration-fast);
}
.om-select:focus {
  border-color: rgba(201, 168, 76, 0.35);
}

/* === TOAST === */
.om-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.om-toast {
  padding: 14px 20px;
  background: rgba(26, 23, 20, 0.92);
  backdrop-filter: blur(20px);
  border: var(--om-border-gold-light);
  border-radius: var(--om-radius-sm);
  color: var(--om-text-primary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--om-shadow-elevated);
  animation: om-toast-in 300ms ease-out;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
@keyframes om-toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === LOADING === */
.om-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--om-bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.5s ease;
}
.om-loading.hidden {
  opacity: 0;
  pointer-events: none;
}
.om-loading-crest {
  font-family: var(--om-font-heading);
  font-size: 42px;
  font-weight: 800;
  color: var(--om-text-heading);
  letter-spacing: 6px;
}
.om-loading-crest span {
  background: var(--om-grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.om-loading-line {
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.3), transparent);
  overflow: hidden;
}
.om-loading-line-bar {
  height: 100%;
  width: 0%;
  background: var(--om-grad-gold);
  animation: om-load-progress 1.8s ease-in-out forwards;
}
@keyframes om-load-progress {
  0% { width: 0%; }
  50% { width: 60%; }
  100% { width: 100%; }
}
.om-loading-text {
  font-size: 10px;
  color: var(--om-text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* === SECTION TITLE === */
.om-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}
.om-section-title h2 {
  font-family: var(--om-font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--om-text-heading);
  display: flex;
  align-items: center;
  gap: 10px;
}
.om-section-title .om-section-link {
  font-size: 12px;
  color: var(--om-text-accent);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--om-duration-fast);
}
.om-section-title .om-section-link:hover {
  color: var(--om-text-heading);
}

/* === SERVICE GRID === */
.om-service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.om-service-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px 18px;
  background: var(--om-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--om-border-charcoal-visible);
  border-radius: var(--om-radius-md);
  text-decoration: none;
  color: var(--om-text-primary);
  cursor: pointer;
  transition: all var(--om-duration-smooth);
  position: relative;
  text-align: center;
}
.om-service-card:hover {
  border-color: rgba(201, 168, 76, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.om-service-card .om-svc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--om-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(201, 168, 76, 0.1);
}
.om-service-card .om-svc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--om-text-primary);
  letter-spacing: 0.3px;
}
.om-service-card .om-svc-badge {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* === STAT CARD === */
.om-stat-card {
  padding: 22px 20px;
  background: var(--om-bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: var(--om-border-charcoal-visible);
  border-radius: var(--om-radius-md);
  transition: all var(--om-duration-smooth);
  position: relative;
  overflow: hidden;
}
.om-stat-card:hover {
  border-color: rgba(201, 168, 76, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--om-shadow-card);
}
.om-stat-card .om-stat-value {
  font-family: var(--om-font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--om-text-heading);
  line-height: 1;
}
.om-stat-card .om-stat-label {
  font-size: 11px;
  color: var(--om-text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 6px;
}
.om-stat-card .om-stat-change {
  font-size: 10px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-block;
}
.om-stat-card .om-stat-change.up { color: #4cc978; }
.om-stat-card .om-stat-change.down { color: #c94c4c; }

/* === QUICK ACTION CARD === */
.om-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  background: rgba(36, 32, 28, 0.4);
  border: var(--om-border-charcoal);
  border-radius: var(--om-radius-md);
  cursor: pointer;
  transition: all var(--om-duration-fast);
  text-decoration: none;
  color: var(--om-text-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.om-quick-action:hover {
  background: rgba(201, 168, 76, 0.06);
  border-color: rgba(201, 168, 76, 0.15);
  color: var(--om-text-primary);
  transform: translateY(-2px);
}
.om-quick-action .om-qa-icon {
  font-size: 24px;
}

/* === ACTIVITY ITEM === */
.om-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(245, 240, 232, 0.04);
  font-size: 13px;
}
.om-activity-item:last-child {
  border-bottom: none;
}
.om-activity-item .om-ai-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.om-activity-item .om-ai-dot.gold { background: var(--om-gold-primary); }
.om-activity-item .om-ai-dot.green { background: #4cc978; }
.om-activity-item .om-ai-dot.amber { background: #c9a84c; }
.om-activity-item .om-ai-dot.blue { background: #4e8cc9; }
.om-activity-item .om-ai-label { flex: 1; color: var(--om-text-body); }
.om-activity-item .om-ai-status {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--om-radius-full);
}
.om-activity-item .om-ai-status.active { background: rgba(76, 201, 120, 0.1); color: #4cc978; }
.om-activity-item .om-ai-status.done { background: rgba(201, 168, 76, 0.1); color: var(--om-gold-primary); }
.om-activity-item .om-ai-status.pending { background: rgba(201, 168, 76, 0.06); color: var(--om-gold-light); }
.om-activity-item .om-ai-value {
  font-weight: 600;
  color: var(--om-text-accent);
  font-size: 12px;
}

/* === ANIMATIONS === */
@keyframes om-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes om-slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes om-slideRight {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .om-service-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .om-service-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .om-heading-xl { font-size: 28px; }
  .om-heading-lg { font-size: 24px; }
  .om-stat-card .om-stat-value { font-size: 24px; }
}

@media (max-width: 480px) {
  .om-service-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .om-heading-xl { font-size: 24px; }
  .om-service-card { padding: 16px 10px; }
}
