/* ============================================================
   LAUNDRY MANAGEMENT SYSTEM - RESPONSIVE STYLESHEET
   ============================================================ */

/* ----- LARGE DESKTOP / LAPTOP (Default styles apply) ----- */

/* ----- TABLET (≤992px) ----- */
@media (max-width: 992px) {
  :root {
    --sidebar-width: 240px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar-search input {
    width: 200px;
  }

  .page-content {
    padding: 16px;
  }

  .clothing-item {
    grid-template-columns: 1.5fr 1fr 0.8fr 1.5fr auto;
  }
}

/* ----- TABLET SMALL / MOBILE LANDSCAPE (≤768px) ----- */
@media (max-width: 768px) {
  /* Sidebar becomes offcanvas */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1035;
    display: none;
  }
  .sidebar-backdrop.show {
    display: block;
    animation: fadeIn 0.2s ease;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    padding: 0 16px;
  }
  .topbar .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .topbar-search {
    display: none;
  }
  .topbar-breadcrumb {
    display: none;
  }

  .page-title {
    font-size: 20px;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  /* Stat cards stack */
  .stat-card {
    padding: 16px;
  }
  .stat-card .stat-value {
    font-size: 24px;
  }

  /* Table becomes card/list on mobile */
  .table-wrap.mobile-cards table.data-table thead {
    display: none;
  }
  .table-wrap.mobile-cards table.data-table,
  .table-wrap.mobile-cards table.data-table tbody,
  .table-wrap.mobile-cards table.data-table tr,
  .table-wrap.mobile-cards table.data-table td {
    display: block;
    width: 100%;
  }
  .table-wrap.mobile-cards table.data-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    background: var(--white);
  }
  .table-wrap.mobile-cards table.data-table td {
    border-bottom: 1px solid var(--border-light);
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
  }
  .table-wrap.mobile-cards table.data-table td:last-child {
    border-bottom: none;
  }
  .table-wrap.mobile-cards table.data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
  }
  .table-wrap.mobile-cards table.data-table .td-actions {
    justify-content: flex-end;
  }

  /* Form becomes single column */
  .clothing-item {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .clothing-item .clothing-note {
    grid-column: 1 / -1;
  }
  .clothing-item .btn-remove-item {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Chart */
  .chart-bars {
    height: 180px;
  }
  .chart-bar-label {
    font-size: 10px;
  }

  /* Filter bar */
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar .filter-search,
  .filter-bar select,
  .filter-bar input[type="date"] {
    width: 100%;
  }

  /* Login */
  .login-card {
    padding: 28px 24px;
  }

  /* Modal */
  .modal {
    max-width: 100%;
    max-height: 95vh;
  }

  /* Scan area */
  .scan-area {
    max-width: 100%;
  }

  /* Status timeline */
  .status-timeline .timeline-step {
    min-width: 60px;
  }
  .status-timeline .timeline-label {
    font-size: 10px;
  }

  /* Info list */
  .info-list {
    grid-template-columns: 1fr 1fr;
  }

  /* QR card */
  .qr-card .qr-image img,
  .qr-card .qr-image canvas {
    width: 160px !important;
    height: 160px !important;
  }

  /* Laundry label */
  .laundry-label {
    width: 100%;
    max-width: 350px;
  }
}

/* ----- MOBILE PORTRAIT (≤480px) ----- */
@media (max-width: 480px) {
  .page-content {
    padding: 12px;
  }

  .page-title {
    font-size: 18px;
  }

  .stat-card {
    padding: 14px;
  }
  .stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  .stat-card .stat-value {
    font-size: 22px;
  }

  .card-body {
    padding: 16px;
  }
  .card-header {
    padding: 12px 16px;
  }

  .topbar {
    height: 56px;
    padding: 0 12px;
  }
  .topbar-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;
  }
  .btn-lg {
    padding: 10px 20px;
    font-size: 14px;
  }

  .info-list {
    grid-template-columns: 1fr;
  }

  .clothing-item {
    grid-template-columns: 1fr;
  }

  .chart-bars {
    height: 150px;
    gap: 4px;
  }
  .chart-bar {
    max-width: 28px;
  }

  .login-card {
    padding: 24px 20px;
  }
  .login-title {
    font-size: 20px;
  }

  .toast {
    min-width: 280px;
    max-width: calc(100vw - 40px);
  }
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .pagination .page-item .page-link {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .laundry-label {
    padding: 12px;
  }
  .laundry-label .label-shop-name {
    font-size: 14px;
  }
  .laundry-label .label-qr img,
  .laundry-label .label-qr canvas {
    width: 120px !important;
    height: 120px !important;
  }
}

/* ----- PRINT (handled in print.css) ----- */
@media print {
  /* See print.css */
}
