/* ═══════════════════════════════════════════════════════════
   HYDESON SCHOOL UNIFORM STOCK MANAGEMENT SYSTEM
   Complete Design System
   ═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600;1,700&display=swap');
@import url('variables.css');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body,
h1, h2, h3, h4, h5, h6,
button,
input,
select,
textarea,
table, th, td,
.navbar,
.nav-item,
.btn,
.form-control,
.form-label,
.modal,
.modal-title,
.modal-body,
.card,
.card-header,
.card-body,
.card-title,
.badge,
.dropdown-menu,
.dropdown-item,
.receipt,
label {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-size: var(--hy-text-base);
    color: var(--hy-text);
    background: var(--hy-bg);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--hy-primary); text-decoration: none; transition: color var(--hy-transition); }
a:hover { color: var(--hy-primary-dark); }

img { max-width: 100%; height: auto; }
table { border-collapse: collapse; width: 100%; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════ */

/* ── Login Layout ── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--hy-bg);
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--hy-space-8);
    background: linear-gradient(135deg, var(--hy-primary) 0%, var(--hy-primary-darker) 100%);
    color: var(--hy-white);
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
}

.login-left .brand-logo {
    width: 170px;
    height: 170px;
    max-width: 180px;
    max-height: 180px;
    border-radius: var(--hy-radius-xl);
    background: var(--hy-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    margin-bottom: var(--hy-space-6);
    box-shadow: var(--hy-shadow-xl);
    position: relative;
    z-index: 1;
}

.login-left .brand-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.login-left h1 {
    font-size: var(--hy-text-3xl);
    font-weight: 700;
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-left p {
    font-size: var(--hy-text-md);
    opacity: 0.9;
    margin-top: var(--hy-space-2);
    text-align: center;
    position: relative;
    z-index: 1;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--hy-space-8);
}

.login-form-container {
    width: 100%;
    max-width: 420px;
}

.login-form-container h2 {
    font-size: var(--hy-text-2xl);
    font-weight: 700;
    color: var(--hy-gray-900);
    margin-bottom: var(--hy-space-1);
}

.login-form-container .subtitle {
    color: var(--hy-text-secondary);
    font-size: var(--hy-text-base);
    margin-bottom: var(--hy-space-8);
}

/* ── App Layout ── */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--hy-sidebar-width);
    background: var(--hy-white);
    border-right: 1px solid var(--hy-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--hy-transition-slow);
}

.sidebar-header {
    padding: var(--hy-space-5) var(--hy-space-5);
    border-bottom: 1px solid var(--hy-border);
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
}

.sidebar-header .logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-header .brand-text {
    font-size: var(--hy-text-sm);
    font-weight: 700;
    color: var(--hy-gray-900);
    line-height: 1.2;
}

.sidebar-header .brand-sub {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--hy-space-3) var(--hy-space-3);
}

.sidebar-section {
    margin-bottom: var(--hy-space-4);
}

.sidebar-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--hy-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--hy-space-2) var(--hy-space-3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
    padding: var(--hy-space-2) var(--hy-space-3);
    border-radius: var(--hy-radius);
    color: var(--hy-gray-600);
    font-size: var(--hy-text-base);
    font-weight: 500;
    transition: all var(--hy-transition);
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--hy-gray-50);
    color: var(--hy-gray-800);
}

.nav-item.active {
    background: var(--hy-primary-soft);
    color: var(--hy-primary-dark);
    font-weight: 600;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--hy-danger);
    color: var(--hy-white);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--hy-radius-full);
    min-width: 20px;
    text-align: center;
}

/* ── Main Content ── */
.main-content {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    max-width: calc(100% - var(--hy-sidebar-width));
    margin-left: var(--hy-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Top Header ── */
.top-header {
    height: var(--hy-header-height);
    background: var(--hy-white);
    border-bottom: 1px solid var(--hy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--hy-space-6);
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--hy-space-4);
}

.header-left .page-title {
    font-size: var(--hy-text-lg);
    font-weight: 700;
    color: var(--hy-gray-900);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--hy-space-2);
    font-size: var(--hy-text-sm);
    color: var(--hy-text-secondary);
}

.breadcrumb a { color: var(--hy-text-secondary); }
.breadcrumb a:hover { color: var(--hy-primary); }
.breadcrumb .separator { color: var(--hy-gray-300); }

.header-right {
    display: flex;
    align-items: center;
    gap: var(--hy-space-4);
}

.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--hy-radius);
    border: 1px solid var(--hy-border);
    background: var(--hy-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--hy-transition);
    color: var(--hy-gray-500);
}

.header-icon-btn:hover {
    background: var(--hy-gray-50);
    border-color: var(--hy-gray-300);
    color: var(--hy-gray-700);
}

.header-icon-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hy-danger);
    border: 2px solid var(--hy-white);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
    cursor: pointer;
    padding: var(--hy-space-1) var(--hy-space-2);
    border-radius: var(--hy-radius);
    transition: background var(--hy-transition);
}

.user-menu:hover { background: var(--hy-gray-50); }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--hy-radius-full);
    background: var(--hy-primary-soft);
    color: var(--hy-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--hy-text-sm);
}

.user-info .user-name {
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-800);
}

.user-info .user-role {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
}

/* ── Page Content ── */
.page-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    padding: var(--hy-space-6);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--hy-space-6);
    flex-wrap: wrap;
    gap: var(--hy-space-4);
}

.page-header h1 {
    font-size: var(--hy-text-2xl);
    font-weight: 700;
    color: var(--hy-gray-900);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
}

/* ═══════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════ */

/* ── Cards ── */
.card {
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-lg);
    box-shadow: var(--hy-shadow-xs);
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.card-header {
    padding: var(--hy-space-5) var(--hy-space-6);
    border-bottom: 1px solid var(--hy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: var(--hy-text-md);
    font-weight: 600;
    color: var(--hy-gray-900);
}

.card-body {
    padding: var(--hy-space-6);
    min-width: 0;
    max-width: 100%;
    width: 100%;
}

.card-footer {
    padding: var(--hy-space-4) var(--hy-space-6);
    border-top: 1px solid var(--hy-border);
    background: var(--hy-gray-50);
    border-radius: 0 0 var(--hy-radius-lg) var(--hy-radius-lg);
}

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--hy-space-5);
    margin-bottom: var(--hy-space-6);
}

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

@media (max-width: 639px) {
    .kpi-grid.admin-account-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.kpi-card {
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-lg);
    padding: var(--hy-space-5) var(--hy-space-6);
    box-shadow: var(--hy-shadow-xs);
    display: flex;
    align-items: flex-start;
    gap: var(--hy-space-4);
    transition: box-shadow var(--hy-transition);
}

.kpi-card:hover { box-shadow: var(--hy-shadow-md); }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--hy-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.kpi-icon.pink { background: var(--hy-primary-soft); color: var(--hy-primary); }
.kpi-icon.green { background: var(--hy-success-light); color: var(--hy-success); }
.kpi-icon.yellow { background: var(--hy-warning-light); color: var(--hy-warning); }
.kpi-icon.red { background: var(--hy-danger-light); color: var(--hy-danger); }
.kpi-icon.blue { background: var(--hy-info-light); color: var(--hy-info); }
.kpi-icon.gray { background: var(--hy-gray-100); color: var(--hy-gray-600); }

.kpi-data { flex: 1; }

.kpi-label {
    font-size: var(--hy-text-sm);
    color: var(--hy-text-secondary);
    margin-bottom: var(--hy-space-1);
}

.kpi-value {
    font-size: var(--hy-text-2xl);
    font-weight: 700;
    color: var(--hy-gray-900);
    line-height: 1.2;
}

.kpi-change {
    font-size: var(--hy-text-xs);
    font-weight: 500;
    margin-top: var(--hy-space-1);
}

.kpi-change.up { color: var(--hy-success); }
.kpi-change.down { color: var(--hy-danger); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--hy-space-2);
    padding: 0.5625rem 1.125rem;
    border: 1px solid transparent;
    border-radius: var(--hy-radius);
    font-family: var(--hy-font);
    font-size: var(--hy-text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--hy-transition);
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
}

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

.btn-primary {
    background: var(--hy-primary);
    color: var(--hy-white);
    border-color: var(--hy-primary);
}
.btn-primary:hover { background: var(--hy-primary-dark); border-color: var(--hy-primary-dark); color: var(--hy-white); }

.btn-secondary {
    background: var(--hy-white);
    color: var(--hy-gray-700);
    border-color: var(--hy-border);
}
.btn-secondary:hover { background: var(--hy-gray-50); border-color: var(--hy-gray-300); }

.btn-success {
    background: var(--hy-success);
    color: var(--hy-white);
}
.btn-success:hover { background: var(--hy-success-dark); color: var(--hy-white); }

.btn-danger {
    background: var(--hy-danger);
    color: var(--hy-white);
}
.btn-danger:hover { background: var(--hy-danger-dark); color: var(--hy-white); }

.btn-warning {
    background: var(--hy-warning);
    color: var(--hy-white);
}

.btn-ghost {
    background: transparent;
    color: var(--hy-gray-600);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--hy-gray-100); color: var(--hy-gray-800); }

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--hy-text-xs);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--hy-text-md);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--hy-radius);
}

.btn-icon.sm { width: 28px; height: 28px; }

.btn-block { width: 100%; }

/* ── Forms ── */
.form-group {
    margin-bottom: var(--hy-space-5);
}

.form-label {
    display: block;
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-700);
    margin-bottom: var(--hy-space-2);
}

.form-label .required {
    color: var(--hy-danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 0.5625rem 0.875rem;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    font-family: var(--hy-font);
    font-size: var(--hy-text-base);
    color: var(--hy-gray-800);
    background: var(--hy-white);
    transition: border-color var(--hy-transition), box-shadow var(--hy-transition);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--hy-primary);
    box-shadow: 0 0 0 3px rgba(213, 14, 117, 0.12);
}

.form-control::placeholder {
    color: var(--hy-text-muted);
}

.form-control.is-invalid {
    border-color: var(--hy-danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.form-error {
    font-size: var(--hy-text-xs);
    color: var(--hy-danger);
    margin-top: var(--hy-space-1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--hy-space-2);
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--hy-primary);
}

.form-hint {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-muted);
    margin-top: var(--hy-space-1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--hy-space-4);
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--hy-space-4);
}

.create-user-container {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.create-user-container .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-user-container .form-group {
    min-width: 0;
}

@media (max-width: 1023px) {
    .create-user-container .form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Tables ── */
.table-container,
.table-responsive,
.table-scroll-container,
.cashier-table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.cashier-table-scroll {
    position: relative;
    max-height: calc(100vh - 315px);
    min-height: 280px;
}

@media (max-width: 1200px) {
    .cashier-table-scroll {
        max-height: calc(100vh - 365px);
    }
}

@media (max-height: 750px) {
    .cashier-table-scroll {
        max-height: calc(100vh - 265px);
    }
}

.cashier-table-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.cashier-table-scroll::-webkit-scrollbar-track {
    background: #f8fafc;
}
.cashier-table-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.cashier-table-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.table-container {
    border-radius: var(--hy-radius-lg);
    border: 1px solid var(--hy-border);
    background: var(--hy-white);
}

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

.inventory-table-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.inventory-table {
    width: max-content;
    min-width: 100%;
}

.inventory-table th,
.inventory-table td {
    white-space: nowrap;
}

.inventory-table .inventory-category,
.inventory-table .inventory-status {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-weight: 400;
}

.inventory-table .inventory-status-in { color: var(--hy-success); }
.inventory-table .inventory-status-low { color: var(--hy-warning); }
.inventory-table .inventory-status-out { color: var(--hy-danger); }

.is-inventory-page .flash-messages-bar .alert > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.user-management-table th,
.user-management-table td {
    white-space: nowrap;
}

.user-management-table .user-role-text,
.user-management-table .user-status-text {
    background: transparent;
    font-weight: 400;
}

.audit-trail-table th,
.audit-trail-table td {
    white-space: nowrap;
}

.audit-action {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-weight: 400;
}

.pagination.audit-pagination {
    margin-top: 0;
    padding: var(--hy-space-4);
    border-top: 1px solid var(--hy-border);
    flex-wrap: wrap;
}

.table th {
    padding: var(--hy-space-3) var(--hy-space-4);
    text-align: left;
    font-size: var(--hy-text-xs);
    font-weight: 600;
    color: var(--hy-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--hy-gray-50);
    border-bottom: 1px solid var(--hy-border);
    white-space: nowrap;
}

.table td {
    padding: var(--hy-space-3) var(--hy-space-4);
    font-size: var(--hy-text-base);
    color: var(--hy-gray-700);
    border-bottom: 1px solid var(--hy-border-light);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--hy-gray-50);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.cashier-table {
    width: 100%;
    min-width: max-content;
    border-collapse: separate;
    border-spacing: 0;
}

.cashier-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #F9FAFB !important;
    white-space: nowrap !important;
    vertical-align: middle;
    padding: 12px 16px;
    border-bottom: 2px solid var(--hy-border) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.cashier-table tbody td {
    white-space: nowrap !important;
    vertical-align: middle;
    padding: 12px 16px;
    border-bottom: 1px solid var(--hy-border-light);
}

.cashier-table tbody tr:hover {
    background: var(--hy-gray-50);
}

.table-actions {
    display: flex;
    gap: var(--hy-space-1);
}

.table-empty {
    text-align: center;
    padding: var(--hy-space-12) var(--hy-space-6);
    color: var(--hy-text-secondary);
}

.table-empty .empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--hy-space-3);
    opacity: 0.4;
}

.table-empty h4 {
    font-size: var(--hy-text-md);
    color: var(--hy-gray-700);
    margin-bottom: var(--hy-space-1);
}

.table-empty p {
    font-size: var(--hy-text-sm);
    color: var(--hy-text-muted);
}

/* ── Badges / Status ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--hy-radius-full);
    font-size: var(--hy-text-xs);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

.badge-success { background: var(--hy-success-light); color: var(--hy-success-dark); }
.badge-warning { background: var(--hy-warning-light); color: var(--hy-warning-dark); }
.badge-danger { background: var(--hy-danger-light); color: var(--hy-danger-dark); }
.badge-info { background: var(--hy-info-light); color: var(--hy-info-dark); }
.badge-secondary { background: var(--hy-gray-100); color: var(--hy-gray-600); }
.badge-primary { background: var(--hy-primary-soft); color: var(--hy-primary-dark); }

/* ── Alerts ── */
.alert {
    padding: var(--hy-space-4);
    border-radius: var(--hy-radius);
    display: flex;
    align-items: flex-start;
    gap: var(--hy-space-3);
    margin-bottom: var(--hy-space-4);
    font-size: var(--hy-text-sm);
    border: 1px solid transparent;
}

.alert-success { background: var(--hy-success-light); color: var(--hy-success-dark); border-color: var(--hy-success); }
.alert-warning { background: var(--hy-warning-light); color: var(--hy-warning-dark); border-color: var(--hy-warning); }
.alert-danger { background: var(--hy-danger-light); color: var(--hy-danger-dark); border-color: var(--hy-danger); }
.alert-info { background: var(--hy-info-light); color: var(--hy-info-dark); border-color: var(--hy-info); }

.alert .alert-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.6;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: inherit;
}

.alert .alert-close:hover { opacity: 1; }

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: var(--hy-space-5);
    right: var(--hy-space-5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--hy-space-3);
    max-width: 380px;
}

.toast {
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-md);
    box-shadow: var(--hy-shadow-lg);
    padding: var(--hy-space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--hy-space-3);
    animation: slideInRight 0.3s ease;
    font-size: var(--hy-text-sm);
}

.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--hy-success); }
.toast-error .toast-icon { color: var(--hy-danger); }
.toast-warning .toast-icon { color: var(--hy-warning); }
.toast-info .toast-icon { color: var(--hy-info); }

.toast-message { flex: 1; color: var(--hy-gray-700); }

.toast-close {
    cursor: pointer;
    color: var(--hy-gray-400);
    font-size: 1rem;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

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

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--hy-space-4);
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--hy-white);
    border-radius: var(--hy-radius-lg);
    box-shadow: var(--hy-shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--hy-space-5) var(--hy-space-6);
    border-bottom: 1px solid var(--hy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: var(--hy-text-lg);
    font-weight: 700;
    color: var(--hy-gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--hy-radius);
    border: none;
    background: var(--hy-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--hy-gray-500);
    font-size: 1.1rem;
}

.modal-close:hover { background: var(--hy-gray-200); color: var(--hy-gray-700); }

.modal-body {
    padding: var(--hy-space-6);
}

.modal-footer {
    padding: var(--hy-space-4) var(--hy-space-6);
    border-top: 1px solid var(--hy-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--hy-space-3);
    background: var(--hy-gray-50);
    border-radius: 0 0 var(--hy-radius-lg) var(--hy-radius-lg);
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 960px; }

/* ── Tabs ── */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--hy-border);
    gap: 0;
    margin-bottom: var(--hy-space-6);
}

.tab-item {
    padding: var(--hy-space-3) var(--hy-space-5);
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--hy-transition);
    text-decoration: none;
}

.tab-item:hover { color: var(--hy-gray-800); }

.tab-item.active {
    color: var(--hy-primary);
    border-bottom-color: var(--hy-primary);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    gap: var(--hy-space-1);
    margin-top: var(--hy-space-6);
}

.pagination-info {
    font-size: var(--hy-text-sm);
    color: var(--hy-text-secondary);
    margin-right: auto;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--hy-space-2);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    font-size: var(--hy-text-sm);
    font-weight: 500;
    color: var(--hy-gray-600);
    background: var(--hy-white);
    text-decoration: none;
    transition: all var(--hy-transition);
}

.pagination .page-link:hover {
    background: var(--hy-gray-50);
    border-color: var(--hy-gray-300);
    color: var(--hy-gray-800);
}

.pagination .page-link.active {
    background: var(--hy-primary);
    border-color: var(--hy-primary);
    color: var(--hy-white);
}

.pagination .page-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
    padding: var(--hy-space-4) var(--hy-space-5);
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-lg);
    margin-bottom: var(--hy-space-5);
    flex-wrap: wrap;
}

.filter-bar .search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-bar .search-input input {
    width: 100%;
    padding: 0.5rem 0.875rem 0.5rem 2.5rem;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    font-size: var(--hy-text-sm);
    font-family: var(--hy-font);
    background: var(--hy-white);
    transition: border-color var(--hy-transition);
}

.filter-bar .search-input input:focus {
    outline: none;
    border-color: var(--hy-primary);
    box-shadow: 0 0 0 3px rgba(213, 14, 117, 0.1);
}

.filter-bar .search-input .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hy-gray-400);
    font-size: var(--hy-text-sm);
}

.filter-bar select {
    padding: 0.5rem 2.25rem 0.5rem 0.75rem;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    font-size: var(--hy-text-sm);
    font-family: var(--hy-font);
    color: var(--hy-gray-700);
    background: var(--hy-white) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 0.5rem center / 16px 12px;
    appearance: none;
    cursor: pointer;
}

.filter-bar select:focus {
    outline: none;
    border-color: var(--hy-primary);
}

/* ── Product Card (POS) ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--hy-space-4);
}

.product-card {
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-lg);
    padding: var(--hy-space-4);
    transition: all var(--hy-transition);
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--hy-primary-light);
    box-shadow: var(--hy-shadow-md);
}

.product-card.out-of-stock {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-card .product-image {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: var(--hy-radius);
    margin-bottom: var(--hy-space-3);
    background: var(--hy-gray-50);
}

.product-card .product-name {
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-800);
    margin-bottom: var(--hy-space-1);
    line-height: 1.3;
}

.product-card .product-meta {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
    margin-bottom: var(--hy-space-2);
}

.product-card .product-price {
    font-size: var(--hy-text-md);
    font-weight: 700;
    color: var(--hy-primary);
}

.product-card .product-stock {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-muted);
    margin-top: var(--hy-space-1);
}

/* ── Cart (POS) ── */
.cart-panel {
    background: var(--hy-white);
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-header {
    padding: var(--hy-space-4) var(--hy-space-5);
    border-bottom: 1px solid var(--hy-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h3 {
    font-size: var(--hy-text-md);
    font-weight: 700;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--hy-space-3);
}

.cart-item {
    display: flex;
    align-items: center;
    gap: var(--hy-space-3);
    padding: var(--hy-space-3);
    border-radius: var(--hy-radius);
    border-bottom: 1px solid var(--hy-border-light);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-info { flex: 1; }

.cart-item-name {
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-800);
}

.cart-item-size {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
}

.cart-item-price {
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-700);
}

.qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    overflow: hidden;
}

.qty-control button {
    width: 30px;
    height: 30px;
    border: none;
    background: var(--hy-gray-50);
    cursor: pointer;
    font-size: var(--hy-text-sm);
    font-weight: 600;
    color: var(--hy-gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--hy-transition);
}

.qty-control button:hover { background: var(--hy-gray-200); }

.qty-control input {
    width: 40px;
    height: 30px;
    border: none;
    border-left: 1px solid var(--hy-border);
    border-right: 1px solid var(--hy-border);
    text-align: center;
    font-size: var(--hy-text-sm);
    font-weight: 600;
    font-family: var(--hy-font);
}

.qty-control input:focus { outline: none; }

.cart-item-remove {
    color: var(--hy-danger);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1rem;
    padding: 4px;
    border-radius: var(--hy-radius);
    transition: background var(--hy-transition);
}

.cart-item-remove:hover { background: var(--hy-danger-light); }

.cart-summary {
    padding: var(--hy-space-4) var(--hy-space-5);
    border-top: 1px solid var(--hy-border);
    background: var(--hy-gray-50);
    border-radius: 0 0 var(--hy-radius-lg) var(--hy-radius-lg);
}

.cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--hy-space-3);
}

.cart-total .label {
    font-size: var(--hy-text-sm);
    color: var(--hy-text-secondary);
}

.cart-total .amount {
    font-size: var(--hy-text-xl);
    font-weight: 700;
    color: var(--hy-gray-900);
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--hy-space-12) var(--hy-space-6);
    color: var(--hy-text-muted);
    text-align: center;
}

.cart-empty .empty-icon { font-size: 2.5rem; margin-bottom: var(--hy-space-3); opacity: 0.4; }

/* ── Receipt ── */
.receipt {
    max-width: 400px;
    margin: 0 auto;
    background: var(--hy-white);
    padding: var(--hy-space-6);
    font-size: var(--hy-text-sm);
}

.receipt-header {
    text-align: center;
    margin-bottom: var(--hy-space-5);
    padding-bottom: var(--hy-space-4);
    border-bottom: 1px dashed var(--hy-border);
}

.receipt-header img {
    height: 60px;
    margin-bottom: var(--hy-space-2);
}

.receipt-header h4 {
    font-size: var(--hy-text-md);
    font-weight: 700;
    color: var(--hy-gray-900);
}

.receipt-header p {
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
}

.receipt-info {
    margin-bottom: var(--hy-space-4);
}

.receipt-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--hy-space-1);
    font-size: var(--hy-text-xs);
}

.receipt-items {
    margin-bottom: var(--hy-space-4);
    padding-bottom: var(--hy-space-4);
    border-bottom: 1px dashed var(--hy-border);
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--hy-space-1);
    font-size: var(--hy-text-xs);
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-size: var(--hy-text-md);
    font-weight: 700;
    margin-bottom: var(--hy-space-4);
}

.receipt-footer {
    text-align: center;
    font-size: var(--hy-text-xs);
    color: var(--hy-text-secondary);
    border-top: 1px dashed var(--hy-border);
    padding-top: var(--hy-space-4);
}

/* ── Empty State ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--hy-space-16) var(--hy-space-6);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--hy-radius-full);
    background: var(--hy-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--hy-gray-400);
    margin-bottom: var(--hy-space-5);
}

.empty-state h3 {
    font-size: var(--hy-text-lg);
    font-weight: 600;
    color: var(--hy-gray-700);
    margin-bottom: var(--hy-space-2);
}

.empty-state p {
    font-size: var(--hy-text-sm);
    color: var(--hy-text-muted);
    max-width: 400px;
    margin-bottom: var(--hy-space-5);
}

/* ── Loading State ── */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--hy-border);
    border-top-color: var(--hy-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hy-space-3);
    padding: var(--hy-space-12);
    color: var(--hy-text-secondary);
    font-size: var(--hy-text-sm);
}

/* ── Divider ── */
.divider {
    height: 1px;
    background: var(--hy-border);
    margin: var(--hy-space-5) 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ── Mobile Sidebar Toggle ── */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--hy-border);
    border-radius: var(--hy-radius);
    background: var(--hy-white);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--hy-gray-600);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* Tablet (< 1024px) */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        width: 100%;
        overflow: hidden;
    }

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

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .pos-layout {
        flex-direction: column;
    }
}

/* Phone (< 640px) */
@media (max-width: 639px) {
    .login-page { flex-direction: column; }

    .login-left {
        padding: var(--hy-space-6) var(--hy-space-4);
        min-height: auto;
    }

    .login-left .brand-logo { width: 120px; height: 120px; padding: 8px; }
    .login-left h1 { font-size: var(--hy-text-xl); }

    .login-right { padding: var(--hy-space-5) var(--hy-space-4); }

    .page-content { padding: var(--hy-space-4); }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .search-input {
        min-width: 100%;
    }

    .top-header {
        padding: 0 var(--hy-space-4);
    }

    .header-left .page-title { font-size: var(--hy-text-md); }

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

    .table { font-size: var(--hy-text-sm); }
    .table th, .table td { padding: var(--hy-space-2) var(--hy-space-3); }

    .tabs { overflow-x: auto; flex-wrap: nowrap; }
    .tab-item { white-space: nowrap; padding: var(--hy-space-3) var(--hy-space-3); font-size: var(--hy-text-xs); }
}

/* ═══════════════════════════════════════════════════════════
   HYDESON CATALOGUE & PARENT PORTAL STYLES
   ═══════════════════════════════════════════════════════════ */
.catalogue-container {
    width: 80%;
    margin: 0 auto;
    padding-top: 32px;
    padding-bottom: 64px;
}

@media (max-width: 992px) {
    .catalogue-container {
        width: 92%;
        padding-top: 24px;
        padding-bottom: 48px;
    }
}

@media (max-width: 576px) {
    .catalogue-container {
        width: 94%;
        padding-top: 20px;
        padding-bottom: 40px;
    }
}

/* Public Navbar */
.public-nav {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.public-nav-inner {
    width: 80%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 992px) {
    .public-nav-inner { width: 92%; }
}
@media (max-width: 576px) {
    .public-nav-inner { width: 94%; }
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-title {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: #6B7280;
    font-weight: 500;
}

.btn-nav-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #D50E75;
    background: #FFF5FA;
    border: 1px solid #F06AAB;
    padding: 7px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.btn-nav-login:hover {
    background: #D50E75;
    color: #FFFFFF;
    border-color: #D50E75;
}

/* 4-Card Responsive Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Minimal Card Design */
.product-card {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #FFFFFF;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    outline: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    border-color: #D1D5DB;
}

.product-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(213, 14, 117, 0.25);
}

.product-image-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #F3F4F6;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

.product-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-meta {
    font-size: 13px;
    font-weight: 500;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
    line-height: 1.2;
}

.product-title {
    font-size: 15px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 6px;
    line-height: 1.35;
}

.product-price {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-top: auto;
}

/* ── Print Styles ── */
@media print {
    body { background: white; }
    .sidebar, .top-header, .sidebar-toggle, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    .card { border: none !important; box-shadow: none !important; }
    .receipt { max-width: 100%; }
}
