/* ============================================================
   Xudov Garage — Base Reset & Typography
   ============================================================ */

/* ============================================================
   1. RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ============================================================
   2. BODY
   ============================================================ */
body {
  background: var(--bg);
  background-image: var(--bg-accent);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s, color .25s;
  overflow-x: hidden;
}

body.modal-lock {
  overflow: hidden;
}

/* ============================================================
   3. HEADINGS
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -.3px;
  color: var(--text);
}

h1 { font-size: 26px; letter-spacing: -.5px; }
h2 { font-size: 23px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; }
h5 { font-size: 13.5px; }
h6 { font-size: 12.5px; }

/* ============================================================
   4. TEXT ELEMENTS
   ============================================================ */
p {
  margin: 0 0 10px;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity .15s;
}

a:hover {
  opacity: .8;
}

b, strong {
  font-weight: 700;
  color: var(--text);
}

small {
  font-size: 12px;
  color: var(--muted);
}

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--accent);
}

pre {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow-x: auto;
  margin: 0 0 12px;
}

blockquote {
  margin: 12px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  color: var(--muted);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 14px 0;
}

/* ============================================================
   5. FORM ELEMENTS
   ============================================================ */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
  line-height: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
textarea {
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: .7;
}

/* Hide number spinner */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Date input tint */
input[type="date"] {
  color-scheme: dark;
}

[data-theme="light"] input[type="date"],
[data-theme="m3"] input[type="date"],
[data-theme="clay"] input[type="date"],
[data-theme="vintage"] input[type="date"],
[data-theme="brutal"] input[type="date"] {
  color-scheme: light;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(.6);
  opacity: .7;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="m3"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="clay"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="vintage"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="brutal"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0);
}

/* Checkbox / Radio accent */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%238F939C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
  padding-right: 32px !important;
}

[data-theme="light"] select,
[data-theme="m3"] select,
[data-theme="clay"] select,
[data-theme="vintage"] select,
[data-theme="brutal"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* ============================================================
   6. MEDIA
   ============================================================ */
img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  -webkit-user-drag: none;
  user-select: none;
}

svg {
  flex-shrink: 0;
}

/* ============================================================
   7. TABLES
   ============================================================ */
table {
  border-collapse: collapse;
  width: 100%;
}

th, td {
  text-align: left;
}

/* ============================================================
   8. LISTS
   ============================================================ */
ul, ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

li {
  margin: 2px 0;
}

/* ============================================================
   9. UTILITY
   ============================================================ */
.mono {
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.text-muted {
  color: var(--muted);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 0;
}

/* ============================================================
   10. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* ============================================================
   11. SELECTION
   ============================================================ */
::selection {
  background: var(--accent-soft);
  color: var(--text);
}

::-moz-selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* ============================================================
   12. ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   13. PRINT (struk only)
   ============================================================ */
@media print {
  body * {
    visibility: hidden;
  }

  #strukArea,
  #strukArea * {
    visibility: visible;
  }

  #strukArea {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff;
  }

  @page {
    margin: 0;
    size: 58mm auto;
  }
}