/* styles.css contoh dan benar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    line-height: 1.5;
    display: flex;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: white;
    height: 100vh;
    position: fixed;
    border-right: 1px solid #e2e8f0;
    overflow-y: auto;
}

.logo {
    padding: 24px;
    font-size: 20px;
    font-weight: 600;
    color: #2563eb;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.logo i {
    font-size: 24px;
}

.nav-group {
    padding: 16px 0;
}

.nav-group-title {
    padding: 8px 24px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.nav-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-item.active {
    background: #2563eb;
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
}

/* Search Bar */
.search-bar {
    margin-bottom: 24px;
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-title {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

/* Table Styles */
.table-container {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.stock-table {
    width: 100%;
    border-collapse: collapse;
}

.stock-table th {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 500;
    font-size: 14px;
    color: #64748b;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.stock-table th:hover {
    background: #f1f5f9;
}

.stock-table td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.stock-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge i {
    font-size: 12px;
}

.status-in-stock {
    background: #dcfce7;
    color: #166534;
}

.status-low-stock {
    background: #fef3c7;
    color: #92400e;
}

.status-out-of-stock {
    background: #fee2e2;
    color: #991b1b;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Responsive Design */
@media screen and (max-width: 1280px) {
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/*@media screen and (max-width: 1024px) {
    .sidebar {
        display: none;
    }

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

@media screen and (max-width: 768px) {
    .stats-container {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        max-width: none;
    }

    .table-container {
        overflow-x: auto;
    }

    .stock-table {
        min-width: 800px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .search-bar {
        display: none;
    }

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

    .stats-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .stat-card,
    .table-container {
        border: 1px solid #e2e8f0;
        box-shadow: none;
    }

    .stock-table th {
        background: white;
    }

    .status-badge {
        border: 1px solid currentColor;
    }
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Animation for Status Badges */
.status-badge {
    animation: fadeIn 0.2s ease-in-out;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.notification.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-2px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-topbar {
    display: none;
}
  
/* ----- Mobile (≤1024px) ----- */
@media screen and (max-width: 1024px) {
    /* Tampilkan burger topbar */
    .mobile-topbar {
      display: flex;
      position: fixed;
      top: 0; left: 0; right: 0;
      padding: 16px;
      background: #fff;
      border-bottom: 1px solid #e2e8f0;
      align-items: center;
      justify-content: space-between;
      z-index: 999;
    }
  
    .mobile-topbar button {
      background: none;
      border: none;
      font-size: 20px;
      color: #2563eb;
      cursor: pointer;
    }
    .mobile-topbar .topbar-title {
      font-size: 18px;
      font-weight: 600;
      color: #1e293b;
    }
  
    /* Off‑canvas sidebar */
    .sidebar {
        display: block;
        position: fixed;
        top: 0; left: -260px;
        width: 260px;
        height: 100vh;
        background: #fff;
        border-right: 1px solid #e2e8f0;
        overflow-y: auto;
        transition: left 0.3s ease;
        z-index: 998;
    }
  
    .sidebar.show {
      left: 0;
    }
  
    /* Geser konten biar nggak ketutup topbar */
    .main-content {
      margin-left: 0 !important;
      padding-top: 70px;
    }
}
  