/*
|--------------------------------------------------
| AL-VIN Attendance System
| Responsive Layout
|--------------------------------------------------
*/

@media (max-width: 1600px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    gap: 16px;
  }
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .app-sidebar {
    padding: 18px 12px;
  }

  .brand-title,
  .brand-subtitle,
  .nav-section-title,
  .nav-link span {
    display: none;
  }

  .brand-block {
    justify-content: center;
  }

  .nav-link {
    justify-content: center;
    padding: 10px;
  }

  .nav-icon {
    margin: 0;
  }

  .grid-col-9,
  .grid-col-8,
  .grid-col-6,
  .grid-col-4,
  .grid-col-3 {
    grid-column: span 12;
  }

  .scan-card {
    min-height: 540px;
  }
}

@media (max-width: 1180px) {
  .admin-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .admin-sidebar {
    padding: 18px 12px;
  }

  .admin-nav {
    gap: 6px;
  }

  .nav-item {
    min-height: 40px;
    padding: 10px 11px;
    font-size: 13px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .app-shell,
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: -100%;
    width: 280px;
    transition: left 220ms ease;
    z-index: 100;
  }

  .app-sidebar.open {
    left: 0;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(148,163,184,0.14);
    box-shadow: 0 18px 55px rgba(0,0,0,0.22);
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }

  .sidebar-profile {
    margin-top: 16px;
  }

  .app-main,
  .admin-main {
    padding: 18px;
  }

  .app-topbar,
  .admin-topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .app-topbar-right,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar input,
  .filter-bar select,
  .filter-bar button {
    width: 100%;
  }

  .table-card,
  .table-wrap {
    border-radius: 20px;
  }

  .terminal-shell {
    padding: 14px;
  }

  .scan-card {
    width: 100%;
    min-height: 480px;
    padding: 20px;
    border-radius: 28px;
  }

  .terminal-header,
  .terminal-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .app-main,
  .admin-main {
    padding: 14px;
  }

  .app-page-title,
  .admin-topbar h1 {
    font-size: 28px;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-block {
    padding-bottom: 18px;
  }

  .card,
  .panel,
  .form-card,
  .stat-card {
    padding: 16px;
    border-radius: 20px;
  }

  .card-header,
  .panel-header,
  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-card,
  .stat-card {
    min-height: 100px;
    padding: 16px;
  }

  .stats-value,
  .stat-card strong {
    font-size: 32px;
  }

  .data-table,
  .table {
    min-width: 680px;
  }

  .worker-mobile-shell {
    width: 100%;
    padding: 14px;
    padding-bottom: 110px;
  }

  .worker-bottom-nav {
    width: calc(100vw - 18px);
    bottom: 10px;
    border-radius: 20px;
  }

  .worker-bottom-nav a {
    min-height: 46px;
    font-size: 10px;
  }

  .scan-card {
    min-height: 420px;
  }

  .content-grid {
    gap: 14px;
  }

  .btn,
  .action-btn,
  .small-btn,
  .primary-btn,
  .secondary-btn,
  .ghost-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .app-main,
  .admin-main {
    padding: 12px;
  }

  .app-topbar,
  .admin-topbar {
    border-radius: 18px;
    gap: 12px;
  }

  .app-page-title,
  .admin-topbar h1 {
    font-size: 24px;
  }

  .app-page-subtitle,
  .admin-topbar p {
    font-size: 13px;
  }

  .admin-sidebar {
    padding: 12px;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .nav-item {
    min-height: 42px;
    font-size: 13px;
  }

  .sidebar-profile {
    border-radius: 16px;
  }

  .stats-card,
  .stat-card {
    border-radius: 18px;
  }

  .stats-value,
  .stat-card strong {
    font-size: 28px;
  }

  .filter-bar {
    padding: 10px;
    border-radius: 16px;
  }

  .filter-bar input,
  .filter-bar select,
  .form-control,
  input,
  select,
  textarea {
    min-height: 40px;
    font-size: 12px;
  }

  .data-table th,
  .data-table td,
  .table th,
  .table td {
    padding: 12px 10px;
    font-size: 12px;
  }

  .worker-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .worker-name,
  .project-title,
  .company-name,
  .subcontractor-name,
  .terminal-name {
    font-size: 13px;
  }

  .worker-email,
  .project-subtitle,
  .company-vat,
  .subcontractor-country,
  .terminal-number {
    font-size: 11px;
  }

  .terminal-shell {
    padding: 10px;
  }

  .scan-card {
    min-height: 360px;
    border-radius: 22px;
    padding: 16px;
  }

  .worker-bottom-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .worker-bottom-nav a {
    min-height: 42px;
    border-radius: 14px;
  }
}

@media (max-width: 420px) {
  .app-page-title,
  .admin-topbar h1 {
    font-size: 22px;
  }

  .stats-value,
  .stat-card strong {
    font-size: 24px;
  }

  .card,
  .panel,
  .form-card,
  .stats-card,
  .stat-card {
    border-radius: 16px;
  }

  .scan-card {
    min-height: 320px;
  }

  .worker-mobile-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .worker-bottom-nav {
    width: calc(100vw - 12px);
    bottom: 6px;
  }
}