/* Kenzo Michika */
:root {
  --km-primary: #1a6b4f;
  --km-primary-dark: #145a42;
}

/* Halaman login / auth */
.auth-body {
  background: #e8e4de;
  color: #222;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.login-panel,
.auth-panel {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border: 1px solid #d4cfc7;
  border-radius: 6px;
  padding: 1.75rem 1.5rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.auth-panel--wide {
  max-width: 680px;
}

.auth-screen--register {
  align-items: flex-start;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.auth-intro {
  margin: -0.5rem 0 1.25rem;
  font-size: 0.85rem;
  color: #6b6560;
  line-height: 1.45;
}

.auth-alert-success {
  background: #e8f5ee;
  border: 1px solid #b8dcc8;
  color: #1a5c3e;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-section {
  border: none;
  margin: 0;
  padding: 0;
}

.auth-section legend {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  padding: 0;
  margin-bottom: 0.75rem;
  float: none;
  width: 100%;
}

.auth-grid {
  display: grid;
  gap: 0.85rem;
}

.auth-grid--2 {
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .auth-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-grid-full {
  grid-column: 1 / -1;
}

.auth-hint {
  font-size: 0.75rem;
  color: #8a8580;
  font-weight: 400;
  line-height: 1.35;
}

.req {
  color: #b33;
  font-style: normal;
}

.login-field select,
.login-field textarea {
  border: 1px solid #c9c4bc;
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  background: #faf9f7;
  width: 100%;
}

.login-field select:focus,
.login-field textarea:focus {
  outline: none;
  border-color: var(--km-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 107, 79, 0.12);
}

.referral-status {
  border: 1px solid #c9c4bc;
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  font-size: 0.875rem;
  background: #faf9f7;
  min-height: 2.35rem;
  display: flex;
  align-items: center;
}

.referral-status--ok { color: #1a6b4f; font-weight: 600; }
.referral-status--bad { color: #8a2a22; }
.referral-status--warn { color: #7a5c00; }
.referral-status--idle { color: #8a8580; }

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.auth-actions .login-submit {
  width: 100%;
}

.auth-actions-link {
  margin: 0 !important;
}

.login-brand {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ebe7e0;
}

.login-brand-name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.login-brand-tag {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: #6b6560;
}

.login-alert {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: #8a2a22;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.login-field span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #444;
}

.login-field input {
  border: 1px solid #c9c4bc;
  border-radius: 4px;
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  background: #faf9f7;
}

.login-field input:focus {
  outline: none;
  border-color: var(--km-primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 107, 79, 0.12);
}

.login-submit {
  margin-top: 0.35rem;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--km-primary);
  cursor: pointer;
}

.login-submit:hover {
  background: var(--km-primary-dark);
}

.login-register {
  margin: 1.15rem 0 0;
  font-size: 0.82rem;
  color: #6b6560;
  text-align: center;
}

.login-register a {
  color: var(--km-primary);
  font-weight: 600;
  text-decoration: none;
}

.login-register a:hover {
  text-decoration: underline;
}

.login-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #ebe7e0;
  font-size: 0.78rem;
  color: #8a8580;
  text-align: center;
  line-height: 1.5;
}

.login-footer a {
  color: #444;
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  color: var(--km-primary);
}

.login-box { width: 100%; max-width: 420px; padding: 15px; }
.login-page { background: #e8e4de; min-height: 100vh; }

[data-bs-theme="dark"] .login-page { background: #1a1a2e; }
[data-bs-theme="dark"] .content-wrapper { background-color: #1a1a2e; }
[data-bs-theme="dark"] .card { background-color: #212529; border-color: #373b3e; }
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; }
[data-bs-theme="dark"] #templateApplySection .bg-light { background-color: #2b3035 !important; }

.small-box .icon i { font-size: 70px; opacity: 0.3; }
.nav-icon.bi { width: 1.2rem; }

/* Responsive layout */
.content-header h1 { font-size: clamp(1.1rem, 2.5vw, 1.75rem); }
.card-header .card-title { font-size: clamp(1rem, 2vw, 1.25rem); }

.btn-group-mobile {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.info-box .info-box-number {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  word-break: break-word;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

/* Mobile stacked tables */
@media (max-width: 767.98px) {
  .table-mobile-stack thead { display: none; }
  .table-mobile-stack tbody tr {
    display: block;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 0.5rem;
  }
  .table-mobile-stack tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    border: 0;
    padding: 0.35rem 0.5rem;
    text-align: right;
  }
  .table-mobile-stack tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    text-align: left;
    flex: 0 0 40%;
  }
  .table-mobile-stack tbody td[data-label="Aksi"] {
    justify-content: flex-end;
  }
  .table-mobile-stack tbody td[data-label="Aksi"]::before {
    display: none;
  }

  .main-header .navbar-nav .nav-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .content-wrapper > .content {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .card-body .row.g-3 > [class*="col-"] {
    margin-bottom: 0;
  }

  .btn, .form-control, .form-select {
    min-height: 42px;
  }

  .sidebar-open .main-sidebar {
    transform: translateX(0);
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .info-box .info-box-icon {
    width: 60px;
    font-size: 1.5rem;
  }
}

/* POS Styles */
.pos-container { height: calc(100vh - 72px); }
.pos-store-navbar { min-height: 56px; }
.pos-store-navbar .navbar-brand { line-height: 1.2; }
.pos-products { background: #f4f6f9; }
[data-bs-theme="dark"] .pos-products { background: #1a1a2e; }
[data-bs-theme="dark"] .pos-cart { background: #212529 !important; border-color: #373b3e !important; }

.pos-category-filter { max-height: 72px; overflow-y: auto; }
.pos-category-filter .btn { white-space: nowrap; }

.featured-card {
  cursor: pointer;
  border: 2px solid #e9ecef;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.featured-card:hover:not(.opacity-50) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--km-primary);
}
.featured-card .featured-icon { font-size: 1.5rem; color: var(--km-primary); opacity: 0.7; }
.featured-card .price { color: var(--km-primary); font-weight: bold; }

.pos-product-table tbody tr:not(.table-secondary) { cursor: pointer; }
.pos-product-table tbody tr:hover:not(.table-secondary) { background-color: rgba(13,110,253,0.06); }
[data-bs-theme="dark"] .pos-product-table tbody tr:hover:not(.table-secondary) { background-color: rgba(13,110,253,0.15); }
.pos-product-table thead.sticky-top { z-index: 1; }

.product-card {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); border-color: var(--km-primary); }
.product-card .price { color: var(--km-primary); font-weight: bold; }
.product-card .stock { font-size: 0.75rem; }

.cart-item { border-bottom: 1px solid #dee2e6; padding: 8px 0; }
[data-bs-theme="dark"] .cart-item { border-color: #373b3e; }
.cart-item .qty-control { display: flex; align-items: center; gap: 4px; }
.cart-item .qty-control button { width: 28px; height: 28px; padding: 0; font-size: 14px; }

@media (max-width: 991px) {
  .pos-container { flex-direction: column !important; height: auto; min-height: calc(100vh - 56px); }
  .pos-cart { max-width: 100% !important; max-height: 50vh; }
  .pos-products .table { font-size: 0.9rem; }
  .featured-card { min-height: 88px; }
}

/* AdminLTE icon fix for Bootstrap Icons */
.nav-sidebar .nav-icon { margin-right: 0.5rem; }
