/*
 * Myanmar Golf Administration theme — DARK BLUE.
 * Forces a light (white) admin even in OS dark mode. Change --mg-brand /
 * --mg-brand-dark to recolour the admin. (The public site stays green; it does
 * not load this stylesheet.)
 */
:root,
html[data-theme="light"],
html[data-theme="dark"] {
  --mg-brand: #1d4ed8;        /* primary (blue-700) */
  --mg-brand-dark: #1e3a8a;   /* header / hover (blue-900) */
  --mg-tint: #eef2ff;         /* light surfaces / row headers */
  --mg-sel: #e0e7ff;          /* selected */

  --primary: var(--mg-brand);
  --secondary: var(--mg-brand-dark);
  --accent: var(--mg-brand);
  --header-bg: var(--mg-brand-dark);
  --header-color: #ffffff;
  --header-branding-color: #ffffff;
  --header-link-color: #ffffff;
  --link-fg: var(--mg-brand);
  --link-hover-color: var(--mg-brand-dark);
  --button-bg: var(--mg-brand);
  --button-hover-bg: var(--mg-brand-dark);
  --default-button-bg: var(--mg-brand);
  --default-button-hover-bg: var(--mg-brand-dark);

  color-scheme: light;
  --body-bg: #ffffff;
  --body-fg: #1f2937;
  --body-quiet-color: #4b5563;
  --body-loud-color: #111827;
  --darkened-bg: #f3f4f6;
  --selected-bg: var(--mg-sel);
  --selected-row: #f1f5ff;
  --module-bg: #ffffff;
  --hairline-color: #e5e7eb;
  --border-color: #e5e7eb;
  --message-success-bg: var(--mg-tint);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: light;
    --body-bg: #ffffff; --body-fg: #1f2937; --darkened-bg: #f3f4f6;
    --module-bg: #ffffff; --header-bg: var(--mg-brand-dark); --primary: var(--mg-brand);
  }
  body { background: #ffffff; color: #1f2937; }
}

/* Header, cards, tables, buttons, forms */
#header { background: linear-gradient(90deg, var(--mg-brand-dark) 0%, var(--mg-brand) 100%); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
/* Branding title — force crisp white so it reads clearly on the blue header */
#branding h1, #branding h1 a, #site-name, #site-name a, #header #branding * {
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: .3px;
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
#header a:link, #header a:visited { color: #ffffff; }

.module { border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); overflow: hidden; }
.module > h2, .module caption, .inline-group .tabular caption { background: var(--mg-tint); color: var(--mg-brand-dark); font-weight: 600; }

#content-main .object-tools a, .button, input[type=submit], a.button { border-radius: 8px; font-weight: 600; }
.button.default, input[type=submit].default { background: var(--mg-brand); border-radius: 8px; }
.button.default:hover, input[type=submit].default:hover { background: var(--mg-brand-dark); }

#result_list, table { border-collapse: separate; border-spacing: 0; }
#result_list thead th { background: var(--mg-tint); color: var(--mg-brand-dark); }
#result_list tbody tr:hover { background: #f5f8ff; }
#changelist-filter { border-radius: 12px; }

.form-row input[type=text], .form-row input[type=number], .form-row input[type=email],
.form-row input[type=url], .form-row textarea, .form-row select, .vTextField {
  border: 1px solid #d1d5db; border-radius: 8px; padding: 6px 9px;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  border-color: var(--mg-brand); outline: 2px solid rgba(29,78,216,.18);
}
.submit-row { border-radius: 12px; }
fieldset.collapsed { border-radius: 12px; }

/* Left nav sidebar — keep text visible on the light theme */
#nav-sidebar { background: #f5f7fe; border-right: 1px solid #e5e7eb; }
#nav-sidebar a, .app-list a, #nav-sidebar .current-model { color: #1f2937; }
#nav-sidebar a:hover { color: var(--mg-brand-dark); }
#nav-sidebar caption, #nav-sidebar .module caption,
#nav-sidebar caption a, #nav-sidebar .module caption a,
.app-list caption, .app-list caption a {
  background: var(--mg-brand-dark) !important; color: #ffffff !important; border-radius: 8px;
}
#nav-filter { color: #111827; background: #ffffff; border: 1px solid #d1d5db; border-radius: 8px; }
#nav-filter::placeholder { color: #9ca3af; }
#nav-sidebar .current-model { background: var(--mg-sel); border-radius: 6px; }

div.breadcrumbs { background: var(--mg-brand-dark); color: #fff; }
div.breadcrumbs a { color: #c7d2fe; }

/* Hide the raw hole-data JSON rows — edited via the visual Hole Data grid */
.field-hole_par, .field-hole_index, .field-hole_index_ladies, .field-hole_distances { display: none !important; }

/* ── Tee Markers as spacious cards (golf-handicap-app look) ── */
#tee_set-group, .inline-group { background: transparent; border: 0; }
.mg-tee-card {
  border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(16,24,40,.10); margin: 0 0 26px; background: #fff;
}
/* coloured header bar (colour set by JS) */
.mg-tee-card > h3 {
  padding: 16px 20px; margin: 0; border: 0;
  font-size: 15px; font-weight: 800; letter-spacing: .3px;
}
.mg-tee-card > h3 a, .mg-tee-card > h3 .inline_label { color: inherit !important; }
.mg-tee-card > h3 .delete label { color: inherit !important; opacity: .9; }

/* section blocks (Front 9 / Back 9 / totals) */
.mg-tee-card fieldset { border: 0; margin: 0; padding: 8px 20px 4px; background: transparent; }
.mg-tee-card fieldset > h2 {
  background: transparent !important; color: #166534 !important;
  font-size: 13px !important; text-transform: uppercase; letter-spacing: .05em;
  padding: 16px 0 6px !important; margin: 0; font-weight: 800; border: 0 !important;
}
.mg-tee-card fieldset:nth-of-type(2) > h2::before { content: "● "; color: #16a34a; }
.mg-tee-card fieldset:nth-of-type(3) > h2::before { content: "● "; color: #1d4ed8; }

/* rows of fields → evenly-spaced columns with labels above big inputs */
.mg-tee-card .form-row { border: 0 !important; padding: 4px 0 14px; }
.mg-tee-card .form-row > div { display: flex; gap: 22px; flex-wrap: wrap; }
.mg-tee-card .fieldBox { flex: 1 1 0; min-width: 140px; margin: 0; }
.mg-tee-card .fieldBox > label, .mg-tee-card .form-row label {
  display: block; float: none; width: auto; text-align: center;
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: #6b7280; font-weight: 600; margin: 0 0 6px; padding: 0;
}
.mg-tee-card .fieldBox input, .mg-tee-card .form-row input,
.mg-tee-card select {
  width: 100% !important; box-sizing: border-box;
  height: 46px; font-size: 16px; text-align: center;
  border: 1px solid #d1d5db; border-radius: 10px; padding: 6px 10px;
}
/* the colour name field keeps its left colour swatch via JS border */
.mg-tee-card .field-color input { text-align: left; }

/* 18-hole totals — highlighted light-green panel */
.mg-tee-card fieldset:nth-of-type(4) {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px;
  margin: 8px 20px 20px; padding: 6px 18px 16px;
}
/* "18-hole totals (…)" heading — dark grey & clearly readable on the green panel */
.mg-tee-card fieldset:nth-of-type(4) > h2,
.mg-tee-card fieldset:nth-of-type(4) > h2::before {
  text-align: center; color: #1f2937 !important; opacity: 1 !important;
  font-size: 13px !important; font-weight: 800;
}
.mg-tee-card fieldset:nth-of-type(4) input { background: #fff; font-weight: 700; color: #166534; }

/* Help text under sections — force readable dark grey instead of the faint default. */
.mg-tee-card .help, .mg-tee-card .help-text,
.mg-tee-card fieldset .description,
.mg-tee-card p.help {
  color: #374151 !important; opacity: 1 !important;
  font-size: 12px; font-weight: 500; text-align: center;
  margin: 0 0 8px; padding: 0;
}

/* "Add another Tee" button spacing */
.inline-group .add-row { padding: 10px 0; }
