/* Janta Hardware - Brand Theme */
:root {
    --bg-primary: #F4F6FF;
    --accent-yellow: #F3C623;
    --accent-orange: #EB8317;
    --primary-dark: #10375C;
    --success: #198754;
    --danger: #dc3545;
    --warning: #fd7e14;
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-primary);
    color: #333;
    margin: 0;
    min-height: 100vh;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, #1a5080 50%, var(--accent-orange) 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(16, 55, 92, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo-img {
    max-width: 240px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-logo p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

/* Layout */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-dark);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    z-index: 1030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.navbar-brand-wrap {
    display: flex;
    align-items: center;
}

.brand-logo {
    height: 42px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

.sidebar-brand {
    padding: 1rem 1rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #e0e4f0;
    margin-bottom: 0.25rem;
}

.sidebar-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.app-wrapper {
    display: flex;
    padding-top: 60px;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid #e0e4f0;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.3s;
}

.sidebar-nav { padding: 1rem 0; }

.nav-section {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    padding: 1rem 1.25rem 0.35rem;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: #555;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--primary-dark);
}

.nav-item.active {
    background: rgba(243, 198, 35, 0.2);
    color: var(--primary-dark);
    border-left-color: var(--accent-orange);
    font-weight: 500;
}

.badge-coming {
    background: var(--accent-yellow);
    color: var(--primary-dark);
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem;
    padding-bottom: 80px;
    width: calc(100% - var(--sidebar-width));
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(16, 55, 92, 0.08);
    border-left: 4px solid var(--accent-orange);
    height: 100%;
}

.stat-card.yellow { border-left-color: var(--accent-yellow); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.red { border-left-color: var(--danger); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-card .stat-label {
    color: #888;
    font-size: 0.85rem;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    color: var(--primary-dark);
    font-weight: 600;
    margin: 0;
}

.card-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(16, 55, 92, 0.08);
    overflow: hidden;
}

.card-panel .card-header {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.85rem 1.25rem;
    font-weight: 500;
}

/* Tables */
.table-products img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: #eee;
}

.table-products tr.low-stock {
    background: rgba(235, 131, 23, 0.12) !important;
}

.table-products tr.out-stock {
    background: rgba(220, 53, 69, 0.1) !important;
}

.table-products tr.selected-row {
    outline: 2px solid var(--accent-yellow);
    background: rgba(243, 198, 35, 0.15) !important;
}

.status-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-in { background: #d1e7dd; color: #0f5132; }
.status-low { background: #fff3cd; color: #856404; }
.status-out { background: #f8d7da; color: #842029; }

/* Buttons */
.btn-primary-custom {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: #fff;
}

.btn-primary-custom:hover {
    background: #d47212;
    border-color: #d47212;
    color: #fff;
}

.btn-accent {
    background: var(--accent-yellow);
    color: var(--primary-dark);
    border: none;
    font-weight: 500;
}

.btn-accent:hover {
    background: #e0b61f;
    color: var(--primary-dark);
}

/* Forms */
.form-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(16, 55, 92, 0.08);
}

.product-thumb {
    max-width: 200px;
    border-radius: 8px;
}

/* Calculator */
.calculator-overlay {
    position: fixed;
    bottom: 70px;
    right: 20px;
    width: 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 1060;
    overflow: hidden;
}

.calculator-header {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    user-select: none;
}

.calculator-display {
    background: #f8f9fa;
    padding: 1rem;
    font-size: 1.5rem;
    text-align: right;
    font-weight: 600;
    color: var(--primary-dark);
    min-height: 52px;
    word-break: break-all;
}

.calculator-keys {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
}

.calculator-keys button {
    padding: 0.75rem;
    border: none;
    background: var(--accent-yellow);
    color: var(--primary-dark);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

.calculator-keys button:hover { background: #e0b61f; }
.calculator-keys button.wide { grid-column: span 2; }

/* Shortcut bar */
.shortcut-hint-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    padding: 0.4rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    z-index: 1040;
    transition: transform 0.3s;
}

.shortcut-hint-bar.hidden { transform: translateY(100%); }

.hint-pill {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(243, 198, 35, 0.4);
    border-radius: 20px;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s;
}

.hint-pill:hover {
    background: var(--accent-yellow);
    color: var(--primary-dark);
}

/* Toast */
.toast-container-custom {
    position: fixed;
    bottom: 55px;
    left: 20px;
    z-index: 1070;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-custom {
    background: var(--primary-dark);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.shortcut-modal .shortcut-group { margin-bottom: 1.25rem; }
.shortcut-modal .shortcut-group h6 {
    color: var(--accent-orange);
    font-weight: 600;
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 0.35rem;
}

.shortcut-row { display: none; }
.shortcut-row.visible { display: table-row; }

/* Product detail */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
}

.detail-item .value {
    font-weight: 500;
    color: var(--primary-dark);
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show { transform: translateX(0); }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Navbar quick actions */
.navbar-quick-actions .btn-accent {
    font-weight: 500;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 700;
}

/* Global search modal */
.global-search-modal {
    border-radius: 12px;
    overflow: hidden;
}

.global-search-results {
    max-height: 360px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #e8ecf4;
    margin-bottom: 0.5rem;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--bg-primary);
    border-color: var(--accent-yellow);
}

.search-result-sub {
    font-size: 0.8rem;
    color: #888;
}

.search-result-meta {
    font-size: 0.85rem;
    color: var(--accent-orange);
    font-weight: 600;
}

/* Billing product suggestions */
.suggestions-dropdown {
    position: absolute;
    z-index: 100;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 220px;
    overflow-y: auto;
    width: 100%;
    margin-top: 4px;
}

.suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.suggestion-item:hover {
    background: var(--bg-primary);
}

.suggestion-item small {
    display: block;
    color: #888;
}

.col-md-5 { position: relative; }

/* Reports dashboard charts */
.reports-page .chart-card {
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.reports-page .chart-title {
    color: var(--primary-dark);
    font-weight: 600;
    margin-bottom: 1rem;
}

.reports-page .chart-wrap {
    position: relative;
    flex: 1;
    min-height: 240px;
    height: 260px;
}

.reports-page .chart-wrap-tall {
    min-height: 260px;
    height: 280px;
}

.report-link-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(16, 55, 92, 0.08);
    text-decoration: none;
    color: var(--primary-dark);
    font-weight: 500;
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-link-card i {
    font-size: 1.5rem;
    color: var(--accent-orange);
}

.report-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 55, 92, 0.12);
    color: var(--primary-dark);
}

@media print {
    .sidebar, .top-navbar, .shortcut-hint-bar, .calculator-overlay { display: none !important; }
    .main-content { margin: 0; width: 100%; padding: 0; }
}
