/* iTrade Theme — base global styles (cloned from wes_theme/css/theme.css on
 * 2026-05-17). Carries the red brand + UTM Avo design tokens so every iTrade
 * Drupal page shares the same canvas as the landing/dashboard surfaces. */

:root {
  --itrade-red:        #DC1C1C;
  --itrade-red-2:      #B01010;
  --itrade-red-soft:   rgba(220, 28, 28, 0.08);
  /* Anh chốt 2026-04-26: 1 background style cho mọi trang. Homepage trắng
   * #fff đã đẹp → mọi trang khác (dashboard, /admin, /location, …) reuse. */
  --itrade-bg:         #ffffff;
  --itrade-bg-alt:     #fafbfd;  /* light off-white reserved for cards-in-page */
  --itrade-fg:         #1a1a1a;
  --itrade-fg-muted:   #666;
  --itrade-fg-soft:    #888;
  --itrade-border:     #e6e9f0;
  --itrade-card:       #fff;
  --itrade-shadow-sm:  0 1px 3px rgba(0,0,0,0.04);
  --itrade-shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --itrade-shadow-lg:  0 12px 48px rgba(0,0,0,0.10);
  --itrade-content-max: 1280px;
  --itrade-sidebar-width: 240px;
  --itrade-sidebar-width-mobile: 52px;
  --itrade-page-pad-y: 24px;
  --itrade-page-pad-x: 32px;
  --itrade-page-pad-mobile: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: 'UTM Avo', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--itrade-fg);
  background: var(--itrade-bg);
  /* Subtle 60×60 red grid — same as homepage `.itrade-landing-shell .grid-bg`
   * but applied site-wide so dashboard / admin / location all share the
   * homepage canvas style (anh chốt 2026-04-26 — 1 background style 1). */
  background-image:
    linear-gradient(rgba(220,28,28,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,28,28,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  background-attachment: fixed;
}

a { color: var(--itrade-red); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; z-index: 99999;
  background: var(--itrade-red); color: #fff;
  padding: 8px 16px; border-radius: 4px;
}
.skip-link:focus { left: 16px; top: 16px; }

/* Visually hidden */
.visually-hidden {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.visually-hidden.focusable:focus { position: static; width: auto; height: auto; }

/* Hide Drupal admin toolbar — iTrade sidebar has its own nav */
#toolbar-bar, #toolbar-administration, .toolbar-tray, .toolbar-tab,
#toolbar-administration-secondary,
body.toolbar-fixed, body.toolbar-vertical, body.toolbar-horizontal {
  /* Reset body margins set by toolbar */
}
body { padding-top: 0 !important; }
#toolbar-administration { display: none !important; }

/* Page shell layout */
.itrade-shell {
  min-height: 100vh;
  display: flex; flex-direction: column;
  position: relative;
  isolation: isolate;
}
.itrade-bg-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}
.itrade-bg-layer .grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(220,28,28,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(220,28,28,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}
.itrade-bg-layer .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.itrade-bg-layer .orb1 {
  width: 600px; height: 600px;
  background: rgba(220,28,28,0.06);
  top: -200px; left: -100px;
}
.itrade-bg-layer .orb2 {
  width: 500px; height: 500px;
  background: rgba(176,16,16,0.05);
  bottom: 0; right: -150px;
}
.itrade-bg-layer .orb3 {
  width: 400px; height: 400px;
  background: rgba(220,28,28,0.04);
  top: 40%; left: 40%;
}
.itrade-page-body {
  display: block;       /* was flex — sidebar is now position:fixed via region template */
  position: relative;
  z-index: 1;
  min-height: 100vh;
}
/* Logged-in canonical rail: every Drupal page in the sidebar app uses the
 * exact same geometry as Settings/Staking. Keep this stronger than older
 * page-specific max-width/margin rules so Location/Homepage cannot drift. */
body.itrade-logged-in main.itrade-page-main,
body.itrade-logged-in .itrade-page-main {
  margin: 0 0 0 var(--itrade-sidebar-width) !important;
  width: calc(100% - var(--itrade-sidebar-width)) !important;
  max-width: calc(100% - var(--itrade-sidebar-width)) !important;
  flex: 0 0 auto !important;
}
.itrade-page-main {
  width: 100%;
  padding: var(--itrade-page-pad-y) var(--itrade-page-pad-x);
  min-width: 0;
  box-sizing: border-box;
}
@media (max-width: 768px) {
  .itrade-page-main { padding: var(--itrade-page-pad-mobile); }
  body.itrade-logged-in main.itrade-page-main,
  body.itrade-logged-in .itrade-page-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Highlighted, help, breadcrumb */
.itrade-page-highlighted, .itrade-page-help {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: var(--itrade-red-soft); color: var(--itrade-fg);
  border-radius: 8px;
}
.itrade-page-breadcrumb {
  margin: 0 0 16px;
  font-size: 12px; color: var(--itrade-fg-soft);
}

/* Forms — Drupal renders many .form-item nodes; tighten them */
.form-item { margin-bottom: 14px; }
.form-item label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--itrade-fg); letter-spacing: 0.4px;
  text-transform: uppercase; margin-bottom: 6px;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="tel"],
input[type="url"], textarea, select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--itrade-border); border-radius: 8px;
  font-size: 14px; background: #fff;
  transition: border-color 200ms;
}
input:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--itrade-red);
  box-shadow: 0 0 0 3px var(--itrade-red-soft);
}

.button, button[type="submit"] {
  background: linear-gradient(135deg, var(--itrade-red), var(--itrade-red-2));
  color: #fff; border: 0; border-radius: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform 100ms;
}
.button:hover, button[type="submit"]:hover { transform: translateY(-1px); }

.button--secondary {
  background: #fff; color: var(--itrade-fg);
  border: 1px solid var(--itrade-border);
}

/* Tables */
table {
  width: 100%; border-collapse: collapse;
  background: var(--itrade-card); border-radius: 12px;
  overflow: hidden; box-shadow: var(--itrade-shadow-sm);
}
th { background: var(--itrade-bg); text-align: left; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--itrade-border); }
tbody tr:hover { background: var(--itrade-red-soft); }

/* Headings */
h1 { font-size: 28px; font-weight: 800; margin: 0 0 16px; color: var(--itrade-fg); }
h2 { font-size: 22px; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }

/* Tabs (Drupal entity tabs) */
.tabs, .tabs--primary {
  display: flex; gap: 4px; border-bottom: 1px solid var(--itrade-border);
  margin: 0 0 24px; list-style: none; padding: 0;
}
.tabs li, .tabs a {
  display: inline-block; padding: 10px 18px;
  text-decoration: none; color: var(--itrade-fg-muted);
  font-weight: 600; border-bottom: 2px solid transparent;
}
.tabs a.is-active, .tabs li.is-active a {
  color: var(--itrade-red); border-bottom-color: var(--itrade-red);
}

/* Messages */
.messages, [data-drupal-messages] {
  padding: 12px 16px; border-radius: 8px; margin: 0 0 16px;
}
.messages--status { background: rgba(25,195,125,0.1); color: #157f4d; }
.messages--warning { background: rgba(217,119,6,0.1); color: #92510a; }
.messages--error { background: var(--itrade-red-soft); color: var(--itrade-red); }
