/**
 * Gold Market Data Manager — frontend styles.
 * Minimal, theme-independent, RTL-friendly (logical properties throughout).
 */

.gmd-section { margin-block: 1.5rem; }
.gmd-section-title { font-size: 1.35rem; margin-block-end: .75rem; }

.gmd-dashboard .gmd-cards,
.gmd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.gmd-card { border: 1px solid #dcdcdc; border-radius: .5rem; padding: 1rem; background: #fff; }
.gmd-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

.gmd-rate { font-size: 1.15rem; font-weight: 600; margin-block: .25rem; }
.gmd-buy { color: #137333; }
.gmd-sell { color: #a50e0e; }
.gmd-total { font-size: 1.6rem; }
.gmd-change-up { color: #137333; }
.gmd-change-down { color: #a50e0e; }
.gmd-change-flat { color: #5f6368; }
.gmd-midpoint { font-style: italic; color: #5f6368; }

.gmd-updated, .gmd-source, .gmd-verification { font-size: .85rem; color: #5f6368; }
.gmd-rate-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-block-start: .5rem; font-size: .85rem; }

.gmd-status { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.gmd-stale, .gmd-badge-stale { background: #fef7e0; color: #b06000; }
.gmd-fresh, .gmd-badge-fresh { background: #e6f4ea; color: #137333; }
.gmd-status-fair { background: #e6f4ea; color: #137333; }
.gmd-status-high { background: #fef7e0; color: #b06000; }
.gmd-status-expensive { background: #fce8e6; color: #a50e0e; }
.gmd-status-incomplete { background: #f1f3f4; color: #5f6368; }
.gmd-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; }

.gmd-table { width: 100%; border-collapse: collapse; margin-block: 1rem; background: #fff; }
.gmd-table caption { text-align: start; font-weight: 700; padding-block-end: .5rem; }
.gmd-table th, .gmd-table td { border: 1px solid #e0e0e0; padding: .5rem .65rem; text-align: start; }
.gmd-table thead th { background: #f7f7f7; }
.gmd-table-scroll { overflow-x: auto; }
.gmd-meta-row td { background: #fafafa; border-top: 0; }

.gmd-form { display: grid; gap: .9rem; max-width: 640px; margin-block: 1rem; }
.gmd-field label { display: grid; gap: .3rem; font-weight: 600; }
.gmd-field input[type="text"], .gmd-field input[type="number"],
.gmd-field input[type="date"], .gmd-field input[type="url"],
.gmd-field select, .gmd-field textarea {
  width: 100%; max-width: 100%; padding: .5rem .6rem; border: 1px solid #c9c9c9; border-radius: .35rem; font: inherit;
}
.gmd-fieldset { border: 1px solid #e0e0e0; border-radius: .5rem; padding: 1rem; display: grid; gap: .9rem; }
.gmd-fieldset legend { font-weight: 700; padding-inline: .4rem; }
.gmd-hint, .gmd-note { font-size: .85rem; color: #5f6368; font-weight: 400; }
.gmd-submit { margin-block-start: .5rem; }

.gmd-button { display: inline-block; padding: .55rem 1.1rem; border: 1px solid #1a73e8; background: #1a73e8; color: #fff;
  border-radius: .35rem; cursor: pointer; font: inherit; text-decoration: none; }
.gmd-button:hover { background: #1765cc; color: #fff; }
.gmd-button-secondary { background: #fff; color: #1a73e8; }
.gmd-button-small { padding: .3rem .7rem; font-size: .85rem; }
.gmd-button-danger { background: #a50e0e; border-color: #a50e0e; }
.gmd-inline-form { display: inline-block; margin-inline-end: .5rem; }

.gmd-result { border: 1px solid #dcdcdc; border-radius: .5rem; padding: 1.25rem; margin-block: 1.25rem; background: #fff; }
.gmd-result h3 { margin-block-start: 0; }
.gmd-breakdown th { width: 55%; font-weight: 600; }
.gmd-formula { margin-block: 1rem; }
.gmd-formula summary { cursor: pointer; font-weight: 600; }
.gmd-disclaimer { border-inline-start: 4px solid #f9ab00; background: #fef7e0; padding: .75rem 1rem; font-size: .9rem; }
.gmd-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-block-start: 1rem; }
.gmd-share-output a { word-break: break-all; }

.gmd-notice { border: 1px solid #dcdcdc; border-inline-start-width: 4px; padding: .7rem 1rem; margin-block: .8rem; border-radius: .25rem; }
.gmd-notice-info { border-inline-start-color: #1a73e8; background: #e8f0fe; }
.gmd-notice-warning { border-inline-start-color: #f9ab00; background: #fef7e0; }
.gmd-notice-error { border-inline-start-color: #a50e0e; background: #fce8e6; }

.gmd-chart { position: relative; margin-block: 1rem; }
.gmd-chart-canvas { width: 100%; height: 260px; display: block; }
.gmd-attribution { font-size: .85rem; color: #5f6368; font-style: italic; }

.gmd-print-report { }
@media print {
  .no-print, .gmd-actions.no-print { display: none !important; }
  .gmd-result { border: 0; padding: 0; }
  body * { visibility: hidden; }
  .gmd-print-report, .gmd-print-report * { visibility: visible; }
  .gmd-print-report { position: absolute; inset-block-start: 0; inset-inline-start: 0; width: 100%; }
}
