/* ===== GLOBAL STYLES - HERI FASHIONSKE POS ===== */
:root {
    --primary: #1b2e1b;
    --primary-light: #1f3a1f;
    --accent: #22a45d;
    --accent-hover: #1d8f50;
    --accent-dark: #18753f;
    --accent-light: #e6f7ee;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --bg: #f4f6f4;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 40px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --sidebar-width: 256px;
    --topbar-height: 64px;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--gray-800);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        display: block;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 0;
    overflow: hidden;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

.sidebar-header {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -0.5px;
}

.logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}

.nav-item.active {
    background: rgba(34, 164, 93, 0.15);
    color: #5ee89c;
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 18px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.sidebar-copyright {
    margin-top: 12px;
    font-size: 9px;
    color: rgba(255,255,255,0.2);
    text-align: center;
    letter-spacing: 0.3px;
}

/* ===== MAIN CONTENT ===== */
/* (defined above with sidebar) */

/* ===== TOP BAR ===== */
.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--gray-600);
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background: var(--gray-100);
}

.sidebar-toggle-btn svg {
    width: 20px;
    height: 20px;
    color: var(--gray-500);
    transition: var(--transition);
}

.sidebar-toggle-btn.active svg {
    color: var(--accent);
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.4px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.live-clock {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.3px;
    padding: 6px 12px;
    background: var(--accent-light);
    border: 1px solid rgba(34, 164, 93, 0.15);
    border-radius: 20px;
}

.current-date {
    font-size: 12.5px;
    color: var(--gray-500);
    font-weight: 500;
    padding: 6px 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 20px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 9px;
    border-radius: 50%;
    position: relative;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-100);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
    color: var(--gray-600);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.notification-badge.hidden {
    display: none;
}

/* Notification Dropdown */
.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    display: none;
    z-index: 200;
    overflow: hidden;
}

.notif-dropdown.open {
    display: block;
    animation: slideUp 0.2s ease;
}

.notif-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}

.notif-clear-btn {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 4px;
}

.notif-clear-btn:hover {
    background: var(--accent-light);
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-50);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background 0.15s;
    cursor: pointer;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-icon svg {
    width: 16px;
    height: 16px;
}

.notif-icon.order { background: #dbeafe; color: #2563eb; }
.notif-icon.stock { background: #fee2e2; color: #dc2626; }
.notif-icon.payment { background: #d1fae5; color: #059669; }
.notif-icon.info { background: #f3f4f6; color: #6b7280; }

.notif-content {
    flex: 1;
}

.notif-text {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.4;
}

.notif-time {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 3px;
}

.notif-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
}

@media (max-width: 768px) {
    .notif-dropdown {
        width: 300px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .notif-dropdown {
        width: calc(100vw - 32px);
        right: -16px;
    }
}

/* ===== PAGE CONTENT ===== */
.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-success {
    background: var(--accent);
    color: var(--white);
}

.btn-success:hover {
    background: var(--accent-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ===== COLORED STAT CARDS WITH WATERMARK ICONS ===== */
.colored-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.colored-stat-card {
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    cursor: default;
}

.colored-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.colored-stat-card.green {
    background: #16a34a;
    color: var(--white);
}

.colored-stat-card.teal {
    background: #0d9488;
    color: var(--white);
}

.colored-stat-card.blue {
    background: #2563eb;
    color: var(--white);
}

.colored-stat-card.orange {
    background: #ea580c;
    color: var(--white);
}

.colored-stat-card.purple {
    background: #7c3aed;
    color: var(--white);
}

.colored-stat-card.red {
    background: #dc2626;
    color: var(--white);
}

.colored-stat-card.slate {
    background: #475569;
    color: var(--white);
}

/* Watermark icon - large, half-visible, bottom-right */
.stat-card-watermark {
    position: absolute;
    bottom: -14px;
    right: -10px;
    width: 90px;
    height: 90px;
    opacity: 0.18;
}

.stat-card-watermark svg {
    width: 100%;
    height: 100%;
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
    margin-bottom: 3px;
    position: relative;
    z-index: 1;
}

.stat-card-label {
    font-size: 12.5px;
    font-weight: 500;
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.stat-card-trend {
    margin-top: 10px;
    font-size: 11.5px;
    font-weight: 500;
    opacity: 0.7;
    position: relative;
    z-index: 1;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: var(--white);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 13px 16px;
    text-align: left;
    font-size: 13px;
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

td {
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--gray-50);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #1e40af;
}

.badge-purple {
    background: var(--purple-light);
    color: #5b21b6;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13.5px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-800);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 164, 93, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* ===== RECEIPT ===== */
.receipt-modal {
    max-width: 380px;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.receipt-modal .receipt {
    flex: 1;
    overflow-y: auto;
}

.receipt-modal .modal-actions {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
    background: var(--white);
}

.receipt {
    padding: 32px 24px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed var(--gray-300);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.receipt-header h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.receipt-items {
    border-bottom: 1px dashed var(--gray-300);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-300);
}

.receipt-footer {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--gray-300);
    color: var(--gray-500);
}

/* ===== SEARCH ===== */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--gray-400);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .colored-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar.collapsed {
        width: var(--sidebar-width) !important;
        transform: translateX(-100%);
        overflow: visible;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .main-content.expanded {
        margin-left: 0;
        height: auto;
        overflow: visible;
    }

    .menu-toggle {
        display: block;
    }

    .sidebar-toggle-btn {
        display: none;
    }

    .page-content {
        overflow: visible;
        height: auto;
    }

    .topbar {
        padding: 0 16px;
        height: 56px;
    }

    .topbar-title {
        font-size: 17px;
    }

    .page-content {
        padding: 16px;
    }

    .colored-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .colored-stat-card {
        padding: 14px 12px;
    }

    .stat-card-value {
        font-size: 20px;
    }

    .stat-card-label {
        font-size: 11px;
    }

    .stat-card-trend {
        font-size: 10px;
        margin-top: 6px;
    }

    .stat-card-watermark {
        width: 60px;
        height: 60px;
        bottom: -10px;
        right: -6px;
    }

    /* Dashboard grids go single column on mobile */
    .dash-mid-row {
        grid-template-columns: 1fr !important;
    }

    .dash-bottom-row {
        grid-template-columns: 1fr !important;
    }

    .dash-stats-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .table-container {
        border-radius: 10px;
    }

    th, td {
        padding: 10px 12px;
        font-size: 12px;
    }

    th {
        font-size: 10px;
    }

    .btn {
        padding: 9px 16px;
        font-size: 12.5px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }

    .form-input, .form-select {
        padding: 9px 12px;
        font-size: 13px;
    }

    .inventory-header,
    .orders-header,
    .payments-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .inventory-filters,
    .orders-filters {
        flex-direction: column;
    }

    .inventory-filters .search-box {
        min-width: 100%;
    }

    .inventory-filters .form-select,
    .orders-filters .form-select {
        width: 100%;
    }

    .payment-methods-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .colored-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .colored-stat-card {
        padding: 12px 10px;
    }

    .stat-card-value {
        font-size: 18px;
    }

    .stat-card-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
        margin-bottom: 10px;
    }

    .stat-card-icon svg {
        width: 16px;
        height: 16px;
    }

    .stat-card-watermark {
        width: 50px;
        height: 50px;
    }

    .page-content {
        padding: 12px;
    }

    .topbar {
        padding: 0 12px;
    }

    .current-date {
        display: none;
    }

    .live-clock {
        font-size: 11.5px;
        padding: 5px 10px;
    }

    .card {
        padding: 16px;
        border-radius: 10px;
    }

    .modal {
        width: 95%;
        padding: 24px 20px;
        border-radius: 14px;
    }

    .sweet-modal {
        width: 92%;
        padding: 28px 20px 24px;
    }
}
