/*
  Kay Bee Motors ERP — shared design tokens.
  The login page establishes this visual language; every future module
  (masters, sales, purchase, stock, accounts, reports...) reuses these same
  variables instead of introducing new colors/spacing/radii per screen.
*/

:root {
  /* Brand */
  --primary-color: #1a4fd6;
  --primary-dark: #123a9e;
  --primary-light: #e8effc;
  --secondary-color: #0b1830;
  --accent-color: #e0503f;

  /* Surfaces */
  --background-color: #eef3f9;
  --card-background: #ffffff;
  --footer-background: #0b1830;

  /* Text */
  --text-color: #101e3a;
  --muted-color: #6b7688;
  --text-inverse: #ffffff;

  /* Borders */
  --border-color: #e1e6ee;
  --border-color-strong: #c6d1e0;

  /* State */
  --success-color: #1c7c3f;
  --danger-color: #c22b2b;
  --danger-dark: #9c2222;
  --warning-color: #b8790a;

  /* Sidebar (reserved for future modules) */
  --sidebar-bg: #f2f7fd;
  --sidebar-text: #1c2c42;
  --sidebar-active-bg: var(--primary-color);
  --sidebar-active-text: #ffffff;

  /* App shell layout — the ERP is targeted/tested primarily at 1360x768;
     these are the single source of truth for shell dimensions so no
     template/CSS file hardcodes its own copy of the sidebar width. */
  --sidebar-width: 210px;
  --header-height: 60px;
  --footer-height: 40px;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 24, 48, 0.08);
  --shadow-md: 0 10px 30px rgba(11, 24, 48, 0.16);
  --shadow-lg: 0 24px 60px rgba(11, 24, 48, 0.28);

  --font-base: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-base);
  color: var(--text-color);
  background: var(--background-color);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.75;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* Form controls */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-color);
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: var(--muted-color);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7688' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

/* Inputs with a leading icon — shared by the login page, the dashboard
   filter bar, and anywhere else a form field needs one. */
.input-icon-wrap {
  position: relative;
}

.input-icon-wrap .field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted-color);
  pointer-events: none;
}

.input-icon-wrap .form-input,
.input-icon-wrap .form-select {
  padding-left: 44px;
}

.field-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.field-error {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--danger-color);
}

/* Alerts / messages */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: var(--space-4);
  border: 1px solid transparent;
}

.alert-error {
  background: #fdecea;
  border-color: #f6c4bd;
  color: var(--danger-color);
}

.alert-success {
  background: #e8f5ec;
  border-color: #bfe3cb;
  color: var(--success-color);
}

.placeholder-card {
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.placeholder-card h1 {
  margin: 0 0 var(--space-3);
  font-size: 24px;
  color: var(--text-color);
}
