/* -----------------------------------
   Base & Global Styles
----------------------------------- */
body {
    font-family: 'Segoe UI', sans-serif;
    background: #f4f6f9;
    color: #2c3e50;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    margin: 0 0 20px;
    font-weight: bold;
    color: #2c3e50;
}

label {
    display: block;
    font-weight: 600;
    margin: 12px 0 6px;
    color: #333;
}

/* -----------------------------------
   Container Layouts
----------------------------------- */
.container,
.page-container,
.product-form-container {
    max-width: 1200px;
    min-width: 500px;
    margin: 25px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

h2.page-heading {
    text-align: center;
    font-size: 26px;
    margin-bottom: 30px;
    font-weight: 600;
}

/* -----------------------------------
   Inputs & Forms
----------------------------------- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fafafa;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #888;
    background-color: #fff;
}

/* -----------------------------------
   Buttons
----------------------------------- */
.btn,
.btn-primary,
.btn-submit,
.btn-add,
.btn-action {
    padding: 10px 20px;
    margin-top: 15px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    background-color: #2c3e50;
    color: white;
    cursor: pointer;
}

.btn:hover,
.btn-primary:hover,
.btn-submit:hover,
.btn-add:hover,
.btn-action:hover {
    background-color: #1a252f;
}

/* Shared Base for All Action Buttons */
/* Action Buttons in Table Cell */
.action-buttons {
    display: flex;
    flex-direction: row; /* Change to 'row' for side-by-side */
    gap: 6px;
    align-items: center;
    justify-content: center;

}

/* Base style for action buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    text-align: center;
    white-space: nowrap;       /* Prevents line break */
    overflow: hidden;          /* Hides overflowed text */
    text-overflow: ellipsis;   /* Shows "..." at the end */
}


/* Color variations */
.btn-save {
    background-color: #28a745;
}
.btn-save:hover {
    background-color: #218838;
}

.btn-toggle {
    background-color: #2196f3;
}
.btn-toggle:hover {
    background-color: #1565c0;
}

.btn-delete {
    background-color: #dc3545;
}
.btn-delete:hover {
    background-color: #b52a37;
}

.btn-del {
    background-color: #dc3545;
}

.btn-del:hover {
    background-color: #b52a37;
}

.manage-warehouse .add-row input,
.manage-warehouse .add-row textarea {
    background: #eef6ff;
}



/* -----------------------------------
   Tables
----------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
}

/* -----------------------------------
   Flex Utilities & Layout Helpers
----------------------------------- */
.flex {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.text-center { text-align: center; }

/* -----------------------------------
   Alerts
----------------------------------- */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 20px;
}

/* -----------------------------------
   Header - Admin
----------------------------------- */
.admin-header {
    background: #1f2d3d;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
}

.admin-left, .admin-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-left a img {
    height: 40px;
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 38px;
    right: 0;
    background: #34495e;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1000;
}

.dropdown.open .dropdown-content { display: block; }

.dropdown-content a {
    display: block;
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.dropdown-content a:hover {
    background-color: #3b556e;
}

/* Lang Selector */
.lang-selector .dropdown-content {
    background: #fff;
    color: #2c3e50;
}

.lang-selector .dropdown-content a {
    color: #2c3e50;
    font-weight: 500;
    padding: 8px 12px;
}

.lang-selector .dropdown-content a:hover {
    background-color: #eee;
}

.clock {
    font-size: 13px;
    color: #ccc;
    white-space: nowrap;
}

.admin-group-cell {
    background-color: #2c3e50;
    border: 1px solid #3e4d5c;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.admin-group-cell:hover {
    background-color: #3b556e;
}

/* -----------------------------------
   Dark Mode
----------------------------------- */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

body.dark-mode .container,
body.dark-mode .product-form-container,
body.dark-mode .page-container,
body.dark-mode form,
body.dark-mode .card {
    background-color: #1e1e1e;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #2a2a2a;
    color: #fff;
    border-color: #555;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #888;
}

body.dark-mode .btn {
    background-color: #2979ff;
    color: #fff;
}

body.dark-mode .btn:hover {
    background-color: #5393ff;
}

body.dark-mode .admin-header {
    background: #121212;
}

body.dark-mode .dropdown-content {
    background: #222;
}

body.dark-mode .dropdown-content a {
    color: #ddd;
}

body.dark-mode .dropdown-content a:hover {
    background-color: #333;
}

body.dark-mode label,
body.dark-mode h2,
body.dark-mode .section-title {
    color: #ddd;
}


/* -----------------------------------
   Utility Classes
----------------------------------- */
.back-link {
    text-align: center;
    margin-top: 30px;
}

.back-link a {
    color: #007bff;
    font-weight: 500;
}

body.dark-mode .back-link a {
    color: #61dafb;
}

.section-title {
    margin-top: 20px;
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}

/* Fix for dark mode section title */
body.dark-mode .section-title {
    color: #fff;
}

/* -----------------------------------
   Tray & Inventory
----------------------------------- */
.tray_code {
    width: 100px;
    padding: 6px;
    text-align: center;
}

.add-tray-form {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.add-tray-form input {
    flex: 1;
    min-width: 200px;
}

.card {
    background: #f9fbfd;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
}

body.dark-mode .card {
    background-color: #1e1e1e;
}

/* -----------------------------------
   Responsive Fixes
----------------------------------- */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: center;
    }

    .admin-left, .admin-right {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .guest-header {
        flex-direction: column;
        align-items: center;
        padding: 20px 10px;
    }

    .guest-left {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .guest-left img {
        height: 80px;
    }

    .guest-title {
        font-size: 24px;
        text-align: center;
    }

    .lang-selector {
        margin-top: 10px;
    }

    .lang-selector select {
        font-size: 18px;
        padding: 10px 14px;
        min-width: 180px;
    }
}

a:visited {
    color: #f4b400;
}


body.dark-mode a,
body.dark-mode a:visited {
    color: #00b8a9; /* or any other nice blue */
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.filters select,
.filters input[type="text"],
.filters button {
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.filters input[type="text"] {
    flex: 1;
    min-width: 180px;
}

.filters button {
    padding: 8px 16px;
    height: 40px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 6px;
    background-color: #007bff;
    color: white;
    border: none;
    font-weight: 600;
    cursor: pointer;
    align-self: center;
}


.filters button:hover {
    background-color: #0056b3;
}

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

.thumb {
    height: 40px;
    display: block;
    margin: 0 auto 5px;
}

.status-msg {
    font-size: 12px;
    margin-top: 5px;
}


.new_category {
    margin-top: 6px;
    height: 34px;
}


td select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='20' viewBox='0 0 24 24' width='20'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 28px;
}

/* Chart container styling */
.chart-wrapper {
    flex-grow: 1;
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Make chart fill container */
.chart-wrapper canvas {
    width: 100% !important;
    height: auto !important;
}

body.dark-mode .chart-wrapper {
    background-color: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .main-content h2 {
    color: #ffffff;
}

datalabels: {
    color: document.body.classList.contains('dark-mode') ? '#fff' : '#000',
    ...
}

.main-content {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.main-content h2 {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
}

body.dark-mode .main-content h2 {
    color: #ffffff;
}
/* MIS Report Container */
.report-container {
    max-width: 95%;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Report Heading */
.report-container h2 {
    text-align: center;
    color: #1a237e;
    margin-top: 0;
}

/* Filter Box */
.filter-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* aligns button and input fields nicely */
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-box form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}


.filter-box input,
.filter-box button {
    padding: 8px 12px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

/* Export Button */
.export-btn {
    background-color: green;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin: 5px;
}

.export-btn:hover {
    background-color: #0d7b2a;
}

/* Back to Dashboard Button */
.btn-back {
    display: block;
    margin: 30px auto 0;
    background-color: #1a237e;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    width: fit-content;
    font-weight: bold;
}

.btn-back:hover {
    background-color: #3949ab;
}

/* Table Row Highlights */
.warning {
    background: #fff3cd;
    color: #856404;
    font-weight: bold;
}

.success {
    background: #d4edda;
    color: #155724;
}


body.dark-mode .report-container {
    background-color: #1e1e1e;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

body.dark-mode .filter-box input,
body.dark-mode .filter-box button {
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
}

body.dark-mode .filter-box label {
    color: #ccc;
}

body.dark-mode .export-btn {
    background-color: #1e7e34;
    color: #fff;
}

body.dark-mode .export-btn:hover {
    background-color: #28a745;
}

body.dark-mode th {
    background-color: #333;
    color: #fff;
}

body.dark-mode td {
    background-color: #222;
    color: #ccc;
}

body.dark-mode .btn-back {
    background-color: #2979ff;
    color: #fff;
}

body.dark-mode .btn-back:hover {
    background-color: #5393ff;
}

body.dark-mode tr:nth-child(even) {
    background-color: #2a2a2a;
}

/* Force background for success rows in dark mode */
body.dark-mode tr.success td {
    background-color: #2e7d32 !important;
    color: #d4edda !important;
}

/* Optional: contrast boost for better readability */
body.dark-mode tr.warning td {
    background-color: #8a6d3b !important;
    color: #fff3cd !important;
}

.sales-report-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 25px;
}

.sales-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

.sales-filter-form select,
.sales-filter-form input[type="date"],
.sales-filter-form input[type="month"],
.sales-filter-form input[type="number"] {
        width: auto; /* ✅ This overrides the global 100% */
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-width: 160px;
    flex: 1;
    max-width: 240px;
}

.sales-filter-form .btn-submit {
    background-color: #1a237e;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
}

.sales-filter-form .btn-submit:hover {
    background-color: #3949ab;
}

.export-btn {
    background-color: green;
    color: white;
    font-weight: bold;
    padding: 10px 18px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    height: 42px;
    display: flex;
    align-items: center;
}

.export-btn:hover {
    background-color: #0b7a24;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
    .sales-report-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .sales-filter-form {
        flex-direction: column;
    }

    .export-btn {
        width: 100%;
        justify-content: center;
    }
}


.site-footer {
    background: #1f2d3d;
    color: #fff;
    padding: 10px;
    font-size: 15px;
    text-align: center;
    margin-top: 25px;
}

.site-footer a {
    color: #fff;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #f4b400;
}


.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-left,
.footer-right {
    flex: 1;
}

.text-link,
.site-footer a,
.site-footer a:visited {
    color: #fff;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #f4b400;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-left,
    .footer-right {
        width: 100%;
    }
}



