/* ==========================================
   AGROLINE GEORGIA
   MAIN STYLE
========================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #F5F6F3;
    color: #14201A;
}

button,
input,
select {
    font-family: inherit;
}


/* ==========================================
   SIDEBAR
========================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    width: 245px;

    background: #14201A;

    border-right: none;

    display: flex;
    flex-direction: column;

    z-index: 20;
}


.logo {
    height: 100px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    background: #ffffff;
}


.logo img {
    max-width: 180px;
    max-height: 65px;
    object-fit: contain;
}


.sidebar nav {
    display: flex;
    flex-direction: column;

    padding: 14px 16px;

    gap: 2px;
}


.sidebar nav a {
    display: flex;
    align-items: center;

    gap: 13px;

    padding: 12px 16px;

    border-radius: 10px;

    color: #9BA79A;

    text-decoration: none;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition: 0.15s;
}


.sidebar nav a:hover {
    background: #1C2A22;
    color: #F3F5F0;
}


.sidebar nav a.active {
    background: #F0A93E;
    color: #14201A;

    font-weight: 600;
}


.sidebar nav .nav-icon {
    stroke: currentColor !important;
}


.user {
    margin-top: auto;

    padding: 20px;

    border-top: 1px solid #1F2C24;

    display: flex;
    align-items: center;

    gap: 11px;
}


.avatar {
    width: 38px;
    height: 38px;

    border-radius: 50%;

    background: #1C2A22;

    color: #F0A93E;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 700;
    font-family: 'Sora', sans-serif;
}


.user strong {
    display: block;

    font-size: 13px;
    color: #F3F5F0;
}


.user span {
    display: block;

    margin-top: 3px;

    color: #6E7D6F;

    font-size: 11px;
}


/* ==========================================
   MAIN
========================================== */

.main {
    margin-left: 245px;

    min-height: 100vh;

    padding: 0 30px 40px;
}


/* ==========================================
   TOPBAR
========================================== */

.topbar {
    min-height: 78px;

    display: flex;
    align-items: center;

    gap: 20px;

    border-bottom: 1px solid #F0F1EC;

    margin-bottom: 28px;
}


.topbar h1 {
    margin: 0;

    font-size: 26px;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #14201A;

    flex: 1;
}


.topbar input {
    width: 280px;

    padding: 11px 14px;

    border: 1px solid #dce3ea;

    border-radius: 9px;

    background: white;

    outline: none;

    font-size: 13px;
}


.topbar input:focus {
    border-color: #75a963;

    box-shadow:
        0 0 0 3px rgba(117, 169, 99, 0.12);
}


.top-icons {
    display: flex;

    gap: 12px;

    font-size: 18px;
}


/* ==========================================
   DASHBOARD STATS
========================================== */

.stats {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 16px;

    margin-bottom: 26px;
}


.card {
    background: #ffffff;

    border: none;

    border-radius: 16px;

    padding: 22px 24px;

    box-shadow:
        0 1px 3px rgba(20, 32, 26, 0.06),
        0 1px 2px rgba(20, 32, 26, 0.04);
}


.card span {
    display: block;

    color: #8A9189;

    font-size: 12.5px;
    font-weight: 600;

    margin-bottom: 11px;
}


.card strong {
    display: block;

    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #14201A;

    margin-bottom: 14px;
}


.card small {
    display: block;

    color: #8A9189;

    font-size: 11.5px;
    font-weight: 600;

    margin: 0 -24px -22px;
    padding: 13px 24px 15px;

    border-top: 3px solid #F0A93E;
    border-radius: 0 0 16px 16px;
}


/* ==========================================
   PANELS
========================================== */

.panel {
    background: #ffffff;

    border: none;

    border-radius: 16px;

    box-shadow:
        0 1px 3px rgba(20, 32, 26, 0.06),
        0 1px 2px rgba(20, 32, 26, 0.04);

    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}


.panel-header {
    padding: 20px 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid #F0F1EC;
}


.panel-header h2 {
    margin: 0;

    font-family: 'Sora', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #14201A;
}


.panel-header span {
    color: #B5760E;

    font-size: 12.5px;
    font-weight: 600;

    cursor: pointer;
}


/* ==========================================
   TABLE
========================================== */

table {
    width: 100%;

    border-collapse: collapse;
}


th {
    text-align: left;

    background: #FAFAF8;

    color: #8A9189;

    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;

    padding: 14px 20px;

    border-bottom: 1px solid #F0F1EC;
}


td {
    padding: 16px 20px;

    font-size: 13.5px;
    color: #4A524A;

    border-bottom: 1px solid #F5F6F3;
}


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


tbody tr:hover {
    background: #FBF9F2;
}


/* ==========================================
   PRODUCTS PAGE
========================================== */

.products-page {
    width: 100%;
}


.products-toolbar {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


.products-toolbar h2 {
    margin: 0;

    font-size: 22px;
}


.products-toolbar p {
    margin: 7px 0 0;

    color: #8A9189;

    font-size: 13px;
}


.add-product-btn {
    border: none;

    background: #14201A;

    color: white;

    padding: 12px 17px;

    border-radius: 9px;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}


.add-product-btn:hover {
    background: #1C2A22;
}


.filters {
    margin-bottom: 15px;
}


.filters select {
    padding: 10px 13px;

    border: 1px solid #E5E3DA;

    border-radius: 8px;

    background: white;

    outline: none;
}


/* ==========================================
   PRODUCT ACTIONS
========================================== */

.product-actions {
    display: flex;

    gap: 7px;
}


.edit-btn,
.delete-btn {
    width: 32px;
    height: 32px;

    border: none;

    border-radius: 7px;

    cursor: pointer;
}


.edit-btn {
    background: #eff6ff;
}


.delete-btn {
    background: #fff1f2;
}


/* ==========================================
   RECEIVING PAGE
========================================== */

.receiving-page,
.issuing-page,
.history-page {
    width: 100%;
}


.receiving-header,
.issuing-header {
    margin-bottom: 20px;
}


.receiving-header h2,
.issuing-header h2,
.history-header h2 {
    margin: 0;

    font-size: 22px;
}


.receiving-header p,
.issuing-header p,
.history-header p {
    margin: 7px 0 0;

    color: #8A9189;

    font-size: 13px;
}


.receiving-card,
.issuing-card {
    max-width: 850px;

    background: white;

    border: 1px solid #F0F1EC;

    border-radius: 15px;

    padding: 28px;

    box-shadow:
        0 3px 12px rgba(15, 23, 42, 0.035);
}


.receiving-card-title,
.issuing-card-title {
    display: flex;

    align-items: center;

    gap: 14px;

    padding-bottom: 22px;

    margin-bottom: 24px;

    border-bottom: 1px solid #F0F1EC;
}


.receiving-icon,
.issuing-icon {
    width: 48px;
    height: 48px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 23px;
}


.receiving-icon {
    background: #edf8e9;
}


.issuing-icon {
    background: #fff1f1;
}


.receiving-card-title h3,
.issuing-card-title h3 {
    margin: 0;

    font-size: 18px;
}


.receiving-card-title p,
.issuing-card-title p {
    margin: 5px 0 0;

    color: #8A9189;

    font-size: 13px;
}


/* ==========================================
   FORM FIELDS
========================================== */

.receiving-field,
.issuing-field {
    display: flex;

    flex-direction: column;

    gap: 8px;

    margin-bottom: 20px;
}


.receiving-field label,
.issuing-field label {
    color: #334155;

    font-size: 13px;

    font-weight: 600;
}


.receiving-field input,
.receiving-field select,
.issuing-field input,
.issuing-field select {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #E5E3DA;

    border-radius: 9px;

    background: white;

    font-size: 14px;

    outline: none;
}


.receiving-field input:focus,
.receiving-field select:focus,
.issuing-field input:focus,
.issuing-field select:focus {
    border-color: #F0A93E;

    box-shadow:
        0 0 0 3px rgba(112, 166, 93, 0.10);
}


/* ==========================================
   STOCK INFO
========================================== */

.stock-info,
.issue-stock-info {
    display: flex;

    align-items: center;

    gap: 8px;

    background: #f8fafc;

    border-radius: 10px;

    padding: 14px 16px;

    margin-bottom: 20px;

    color: #8A9189;

    font-size: 13px;
}


.stock-info strong,
.issue-stock-info strong {
    color: #14201A;

    font-size: 17px;
}


.new-stock-info {
    background: #edf8e9;

    border: 1px solid #cfe8c5;

    border-radius: 10px;

    padding: 16px;

    margin-bottom: 23px;

    color: #3f6f32;

    font-size: 13px;
}


.new-stock-info strong {
    font-size: 23px;

    margin: 0 5px;
}


.remaining-stock-info {
    background: #fef2f2;

    border: 1px solid #fecaca;

    border-radius: 10px;

    padding: 16px;

    margin-bottom: 20px;

    color: #7f1d1d;

    font-size: 13px;
}


.remaining-stock-info strong {
    color: #b91c1c;

    font-size: 23px;

    margin: 0 5px;
}


.issue-warning {
    background: #fff7ed;

    border: 1px solid #fed7aa;

    color: #c2410c;

    border-radius: 9px;

    padding: 12px 14px;

    margin-bottom: 20px;

    font-size: 13px;

    font-weight: 600;
}


/* ==========================================
   FORM BUTTONS
========================================== */

.receiving-actions,
.issuing-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    padding-top: 20px;

    border-top: 1px solid #F0F1EC;
}


.cancel-btn {
    border: 1px solid #E5E3DA;

    background: white;

    color: #4A524A;

    padding: 11px 17px;

    border-radius: 9px;

    cursor: pointer;

    font-size: 13px;
    font-weight: 600;
}


.cancel-btn:hover {
    background: #FAFAF8;
}


.receive-btn {
    border: none;

    background: #14201A;

    color: white;

    padding: 11px 18px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 600;
}


.receive-btn:hover {
    background: #1C2A22;
}


.issue-btn {
    border: none;

    background: #d34a4a;

    color: white;

    padding: 11px 18px;

    border-radius: 8px;

    cursor: pointer;

    font-size: 13px;

    font-weight: 600;
}


.issue-btn:hover {
    background: #b93838;
}


.issue-btn:disabled {
    background: #cbd5e1;

    cursor: not-allowed;
}


/* ==========================================
   HISTORY
========================================== */

.history-header {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;
}


.history-count {
    background: white;

    border: 1px solid #F0F1EC;

    border-radius: 10px;

    padding: 10px 16px;

    text-align: right;
}


.history-count span {
    display: block;

    color: #8A9189;

    font-size: 11px;
}


.history-count strong {
    display: block;

    margin-top: 3px;

    font-size: 20px;
}


.history-filters {
    display: flex;

    gap: 10px;

    margin-bottom: 17px;
}


.history-filters select {
    padding: 10px 13px;

    border: 1px solid #E5E3DA;

    border-radius: 8px;

    background: white;

    outline: none;

    font-size: 13px;
}


.history-panel {
    overflow-x: auto;
}


.history-operation {
    display: inline-block;

    padding: 6px 10px;

    border-radius: 7px;

    font-size: 12px;

    font-weight: 600;
}


.history-in {
    background: #eaf6e5;

    color: #3f8629;
}


.history-out {
    background: #fef2f2;

    color: #b91c1c;
}


.history-cancelled {
    display: inline-block;

    margin-left: 6px;

    padding: 5px 8px;

    border-radius: 6px;

    background: #f1f5f9;

    color: #8A9189;

    font-size: 11px;

    font-weight: 600;
}


.cancel-operation-btn {
    border: 1px solid #fecaca;

    background: #fff7f7;

    color: #b91c1c;

    padding: 7px 10px;

    border-radius: 7px;

    cursor: pointer;

    font-size: 12px;

    font-weight: 600;
}


.cancel-operation-btn:hover {
    background: #fee2e2;
}


/* ==========================================
   MODAL
========================================== */

.modal-overlay {
    position: fixed;

    inset: 0;

    background: rgba(15, 23, 42, 0.45);

    display: flex;

    align-items: center;

    justify-content: center;

    opacity: 0;

    visibility: hidden;

    transition: 0.2s;

    z-index: 100;
}


.modal-overlay.active {
    opacity: 1;

    visibility: visible;
}


.modal {
    width: min(650px, calc(100% - 30px));

    background: white;

    border-radius: 16px;

    box-shadow:
        0 20px 60px rgba(20, 32, 26, 0.16);

    padding: 25px;
}


.modal-header {
    display: flex;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 25px;
}


.modal-header h2 {
    margin: 0;

    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #14201A;
}


.modal-header p {
    margin: 6px 0 0;

    color: #8A9189;

    font-size: 12px;
}


.close-modal {
    width: 34px;
    height: 34px;

    border: none;

    background: #f1f5f9;

    border-radius: 8px;

    font-size: 22px;

    cursor: pointer;

    color: #475569;
}


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 17px;
}


.form-group {
    display: flex;

    flex-direction: column;

    gap: 7px;
}


.form-group label {
    font-size: 12px;

    font-weight: 600;

    color: #334155;
}


.form-group input,
.form-group select {
    padding: 12px 13px;

    border: 1px solid #E5E3DA;

    border-radius: 9px;

    outline: none;

    font-size: 16px; /* 16px+ ხელს უშლის iOS Safari-ს ავტომატურ zoom-ს ველზე ფოკუსისას */

    background: white;
}


.form-group input:focus,
.form-group select:focus {
    border-color: #F0A93E;
}


.modal-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    border-top: 1px solid #F0F1EC;

    margin-top: 25px;

    padding-top: 20px;
}


.save-btn {
    border: none;

    background: #14201A;

    color: #F3F5F0;

    padding: 11px 18px;

    border-radius: 9px;

    cursor: pointer;

    font-size: 13px;
    font-family: 'Sora', sans-serif;

    font-weight: 600;
}


.save-btn:hover {
    background: #1C2A22;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 1100px) {

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

}


@media (max-width: 800px) {

    .sidebar {
        width: 200px;
    }

    .main {
        margin-left: 200px;

        padding-left: 18px;
        padding-right: 18px;
    }

    .topbar input {
        width: 200px;
    }

}


@media (max-width: 650px) {

    .sidebar {
        position: relative;

        width: 100%;

        height: auto;
    }

    .sidebar nav {
        flex-direction: row;

        flex-wrap: wrap;
    }

    .main {
        margin-left: 0;
    }

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

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

    .topbar {
        flex-wrap: wrap;

        padding: 15px 0;
    }

    .topbar h1 {
        width: 100%;

        flex: auto;
    }

    .topbar input {
        width: 100%;
    }

}
/* ==========================================
   CATEGORIES
========================================== */

.categories-page {
    width: 100%;
}

.categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.categories-header h2 {
    margin: 0;
    font-size: 22px;
}

.categories-header p {
    margin: 7px 0 0;
    color: #8A9189;
    font-size: 13px;
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.categories-panel {
    overflow: hidden;
}

.categories-panel table {
    width: 100%;
}

.categories-panel td {
    vertical-align: middle;
}

.category-name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.category-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #edf6e9;
    border-radius: 8px;

    font-size: 16px;
}

.category-product-count {
    display: inline-block;

    min-width: 32px;

    padding: 5px 9px;

    text-align: center;

    background: #f1f5f9;

    border-radius: 7px;

    color: #475569;

    font-size: 12px;

    font-weight: 600;
}

.category-actions {
    display: flex;
    gap: 7px;
}

.category-edit-btn,
.category-delete-btn {
    width: 34px;
    height: 34px;

    border: none;

    border-radius: 7px;

    cursor: pointer;

    font-size: 14px;
}

.category-edit-btn {
    background: #eff6ff;
}

.category-edit-btn:hover {
    background: #dbeafe;
}

.category-delete-btn {
    background: #fff1f2;
}

.category-delete-btn:hover {
    background: #ffe4e6;
}

.category-empty {
    text-align: center;

    padding: 55px 20px;

    color: #8A9189;
}

.category-empty-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.category-empty-text {
    font-size: 13px;
}


/* ==========================================
   CATEGORY MODAL
========================================== */

.category-modal {
    max-width: 500px;
}

.category-modal .form-group {
    margin-bottom: 5px;
}

.category-modal .form-group input {
    width: 100%;
}


/* ==========================================
   RESPONSIVE CATEGORIES
========================================== */

@media (max-width: 700px) {

    .categories-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .category-stats {
        grid-template-columns: 1fr;
    }

}
/* ==========================================
   PRODUCTS - IMPROVED DESIGN
========================================== */

.products-page {
    width: 100%;
}

.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.products-toolbar h2 {
    margin: 0;
    font-size: 22px;
    color: #14201A;
}

.products-toolbar p {
    margin: 7px 0 0;
    color: #8A9189;
    font-size: 13px;
}

.add-product-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: none;
    background: #14201A;
    color: #fff;

    padding: 12px 18px;
    min-height: 42px;

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
}

.add-product-btn:hover {
    background: #1C2A22;

    box-shadow:
        0 5px 14px rgba(79, 141, 58, 0.18);
}

.add-product-btn:active {
    transform: translateY(1px);
}


/* ==========================================
   PRODUCT FILTERS
========================================== */

.filters {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 16px;
}

.filters select {
    min-width: 210px;

    padding: 11px 13px;

    border: 1px solid #E5E3DA;
    border-radius: 9px;

    background: #fff;

    color: #334155;

    outline: none;

    font-size: 13px;

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.filters select:focus {
    border-color: #F0A93E;

    box-shadow:
        0 0 0 3px rgba(112, 166, 93, 0.10);
}


/* ==========================================
   PRODUCT TABLE
========================================== */

.products-page .panel {
    overflow-x: auto;
}

.products-page table {
    min-width: 760px;
}

.products-page th {
    height: 46px;

    background: #FAFAF8;

    color: #8A9189;

    font-size: 11px;

    text-transform: none;

    white-space: nowrap;
}

.products-page td {
    height: 62px;

    vertical-align: middle;

    color: #334155;
}

.products-page tbody tr {
    transition:
        background 0.15s ease;
}

.products-page tbody tr:hover {
    background: #FBF9F2;
}


/* ==========================================
   PRODUCT NAME
========================================== */

.products-page td:first-child {
    color: #14201A;
}

.products-page td:first-child strong {
    font-size: 13px;
}


/* ==========================================
   CATEGORY BADGE
========================================== */

.products-page td:nth-child(2) {
    color: #B5760E;
}

.products-page td:nth-child(2)::before {
    content: "🏷️";

    margin-right: 6px;

    font-size: 11px;
}


/* ==========================================
   STOCK NUMBER
========================================== */

.products-page td:nth-child(4) {
    font-weight: 700;
}

.products-page td:nth-child(4)::after {
    content: "";

    display: inline-block;

    width: 6px;
    height: 6px;

    margin-left: 7px;

    border-radius: 50%;

    background: #67a950;

    vertical-align: middle;
}


/* ==========================================
   PURCHASE PRICE
========================================== */

.products-page td:nth-child(5) {
    font-weight: 600;

    color: #334155;
}


/* ==========================================
   PRODUCT ACTIONS
========================================== */

.product-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.edit-btn,
.delete-btn {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;

    border-radius: 8px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

.edit-btn {
    background: #eff6ff;
}

.edit-btn:hover {
    background: #dbeafe;

    transform: translateY(-1px);
}

.delete-btn {
    background: #fff1f2;
}

.delete-btn:hover {
    background: #ffe4e6;

    transform: translateY(-1px);
}


/* ==========================================
   PRODUCT MODAL - CLEANER
========================================== */

.modal {
    max-height: calc(100vh - 40px);

    overflow-y: auto;
}

.modal-header {
    padding-bottom: 5px;
}

.modal-header h2 {
    color: #14201A;
}

.form-grid {
    gap: 18px;
}

.form-group input,
.form-group select {
    min-height: 43px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.form-group input::placeholder {
    color: #a1acb9;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #F0A93E;

    box-shadow:
        0 0 0 3px rgba(240, 169, 62, 0.14);
}

.save-btn,
.cancel-btn {
    min-height: 40px;
}


/* ==========================================
   EMPTY PRODUCTS STATE
========================================== */

.products-page td[colspan="6"] {
    padding: 60px 20px !important;

    font-size: 13px;
}


/* ==========================================
   SEARCH
========================================== */

#productSearch {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#productSearch:focus {
    border-color: #F0A93E;

    box-shadow:
        0 0 0 3px rgba(112, 166, 93, 0.10);
}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 700px) {

    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .products-toolbar .add-product-btn {
        width: 100%;
    }

    .filters {
        width: 100%;
    }

    .filters select {
        width: 100%;
        min-width: 0;
    }

}
/* ==========================================
   DASHBOARD - IMPROVED
========================================== */

#dashboardPage {
    width: 100%;
}

/* ზედა სათაური */

#dashboardPage .topbar {
    margin-bottom: 25px;
}

#dashboardPage .topbar h1 {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.3px;
}


/* ==========================================
   STAT CARDS
========================================== */

#dashboardPage .stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

#dashboardPage .stats .card {
    position: relative;
    min-height: 130px;

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease;
}

#dashboardPage .stats .card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 22px rgba(20, 32, 26, 0.1);
}


/* ==========================================
   DASHBOARD ANALYTICS GRID (chart + top debtors)
========================================== */

.dashboard-analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-analytics-grid .panel-header h2 {
    font-size: 15px;
}


/* ==========================================
   TOP PRODUCTS / TOP DEBTORS LISTS
========================================== */

#topProductsList > div,
#topDebtorsList > div {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 11px 0;

    border-bottom: 1px solid #F5F6F3;

    font-size: 13.5px;
}

#topProductsList > div:last-child,
#topDebtorsList > div:last-child {
    border-bottom: none;
}

.top-list-rank {
    width: 22px;
    height: 22px;
    flex-shrink: 0;

    border-radius: 50%;

    background: #FDF1DD;
    color: #B5760E;

    display: flex;
    align-items: center;
    justify-content: center;

    font-family: 'Sora', sans-serif;
    font-size: 11px;
    font-weight: 700;
}

.top-list-name {
    flex: 1;
    min-width: 0;

    font-weight: 600;
    color: #14201A;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-list-sub {
    font-size: 11px;
    color: #8A9189;
    font-weight: 500;
    margin-top: 1px;
}

.top-list-value {
    flex-shrink: 0;

    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 13.5px;
    color: #14201A;
}

.top-list-empty {
    text-align: center;
    color: #8A9189;
    font-size: 13px;
    padding: 30px 10px;
}


/* ==========================================
   SECONDARY STATS (compact inventory row)
========================================== */

.secondary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.secondary-stat {
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 16px;

    box-shadow:
        0 1px 2px rgba(20, 32, 26, 0.04);
}

.secondary-stat span {
    display: block;
    font-size: 11px;
    color: #8A9189;
    font-weight: 600;
    margin-bottom: 6px;
}

.secondary-stat strong {
    display: block;
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #14201A;
}


/* ==========================================
   DASHBOARD PRODUCTS PANEL
========================================== */

#dashboardPage .products {
    border-radius: 14px;
}

#dashboardPage .products .panel-header {
    min-height: 65px;
}

#dashboardPage .products .panel-header h2 {
    font-size: 17px;
}

#dashboardPage .products .panel-header span {
    color: #B5760E;
    font-weight: 600;

    transition: color 0.2s ease;
}

#dashboardPage .products .panel-header span:hover {
    color: #8F5A08;
}


/* ==========================================
   DASHBOARD TABLE
========================================== */

#dashboardPage table {
    min-width: 650px;
}

#dashboardPage th {
    height: 45px;

    background: #FAFAF8;

    white-space: nowrap;
}

#dashboardPage td {
    height: 60px;

    vertical-align: middle;
}

#dashboardPage tbody tr {
    transition:
        background 0.15s ease;
}

#dashboardPage tbody tr:hover {
    background: #FBF9F2;
}

#dashboardPage tbody td:first-child strong {
    color: #14201A;
}

#dashboardPage tbody td:nth-child(2) {
    color: #B5760E;
}

#dashboardPage tbody td:nth-child(4) {
    font-weight: 700;
}


/* ==========================================
   DASHBOARD EMPTY STATE
========================================== */

#dashboardPage td[colspan="5"] {
    padding: 60px 20px !important;

    font-size: 13px;
}


/* ==========================================
   DASHBOARD SEARCH
========================================== */

#dashboardPage .topbar input {
    border-radius: 10px;

    background: #fff;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

#dashboardPage .topbar input:focus {
    border-color: #F0A93E;

    box-shadow:
        0 0 0 3px rgba(240, 169, 62, 0.14);
}


/* ==========================================
   RESPONSIVE DASHBOARD
========================================== */

@media (max-width: 1050px) {

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

}


@media (max-width: 650px) {

    #dashboardPage .stats {
        grid-template-columns: 1fr;
    }

    #dashboardPage .topbar {
        margin-bottom: 18px;
    }

}
/* ==========================================
   RECENT OPERATIONS - DASHBOARD
========================================== */

.recent-operations-panel {
    margin-top: 20px;
}

.recent-operations {
    display: flex;
    flex-direction: column;
}

.recent-operation {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 15px 20px;

    border-bottom: 1px solid #f0f2f5;

    transition: background 0.15s ease;
}

.recent-operation:last-child {
    border-bottom: none;
}

.recent-operation:hover {
    background: #fafcfb;
}

.recent-operation-icon {
    width: 40px;
    height: 40px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    font-size: 17px;
}

.recent-operation-icon.receiving {
    background: #edf8e9;
}

.recent-operation-icon.issuing {
    background: #fff1f2;
}

.recent-operation-info {
    flex: 1;

    min-width: 0;
}

.recent-operation-name {
    display: block;

    color: #14201A;

    font-size: 13px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.recent-operation-date {
    display: block;

    margin-top: 4px;

    color: #8A9189;

    font-size: 11px;
}

.recent-operation-quantity {
    flex-shrink: 0;

    font-size: 14px;

    font-weight: 700;
}

.recent-operation-quantity.receiving {
    color: #1FA05C;
}

.recent-operation-quantity.issuing {
    color: #c24141;
}

.recent-operation-cancelled {
    flex-shrink: 0;

    padding: 5px 8px;

    border-radius: 6px;

    background: #f1f5f9;

    color: #8A9189;

    font-size: 10px;

    font-weight: 600;
}

.recent-operation-empty {
    padding: 45px 20px;

    text-align: center;

    color: #8A9189;

    font-size: 13px;
}

.recent-operation-empty-icon {
    margin-bottom: 9px;

    font-size: 28px;
}


/* ==========================================
   RECENT OPERATIONS RESPONSIVE
========================================== */

@media (max-width: 600px) {

    .recent-operation {
        gap: 10px;

        padding: 13px 15px;
    }

    .recent-operation-icon {
        width: 36px;
        height: 36px;
    }

    .recent-operation-quantity {
        font-size: 13px;
    }

}

/* ==========================================
   FIX: standalone forms (sales, transactions,
   employees) outside of modals — make inputs
   consistent size with the rest of the app
========================================== */

.categories-panel form .form-group {
    margin-bottom: 14px;
}

.categories-panel form .form-group:last-of-type {
    margin-bottom: 0;
}

.categories-panel form .form-group input,
.categories-panel form .form-group select {
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    height: auto;
    line-height: normal;
}

.categories-panel form .form-group input[type="number"],
.categories-panel form .form-group input[type="date"],
.categories-panel form .form-group input[type="text"],
.categories-panel form .form-group input[type="email"] {
    padding: 12px 13px;
    border: 1px solid #E5E3DA;
    border-radius: 8px;
    font-size: 13px;
    background: white;
}


/* ==========================================
   BANK SELECTOR BADGES (TBC / BOG)
========================================== */

.bank-option {
    cursor: pointer;
}

.bank-badge {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    border: 2px solid transparent;
    transition: all 0.15s;
    letter-spacing: 0.5px;
}

.bank-tbc {
    background: #e8f0fe;
    color: #1a56db;
}

.bank-bog {
    background: #fef3e8;
    color: #d97706;
}

.bank-other {
    background: #f1f5f9;
    color: #8A9189;
}

input[name="customerTransactionBank"]:checked + .bank-tbc,
input[name="supplierTransactionBank"]:checked + .bank-tbc {
    border-color: #1a56db;
    box-shadow: 0 0 0 2px rgba(26,86,219,0.2);
}

input[name="customerTransactionBank"]:checked + .bank-bog,
input[name="supplierTransactionBank"]:checked + .bank-bog {
    border-color: #d97706;
    box-shadow: 0 0 0 2px rgba(217,119,6,0.2);
}

input[name="customerTransactionBank"]:checked + .bank-other,
input[name="supplierTransactionBank"]:checked + .bank-other {
    border-color: #8A9189;
    box-shadow: 0 0 0 2px rgba(100,116,139,0.2);
}


/* ==========================================
   DARK MODE
========================================== */

body.dark-mode {
    background: #0f172a;
    color: #e2e8f0;
}

/* sidebar-ი ახლა მუდმივად მუქია ახალ დიზაინში —
   dark-mode toggle აღარ ცვლის მას ცალკე ფერზე */

body.dark-mode .topbar h1 {
    color: #f1f5f9;
}

body.dark-mode .topbar input {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .categories-panel,
body.dark-mode .modal,
body.dark-mode .modal-overlay .modal {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .card span,
body.dark-mode .card small,
body.dark-mode .panel-header span {
    color: #8A9189;
}

body.dark-mode #topProductsList > div,
body.dark-mode #topDebtorsList > div {
    border-bottom-color: #334155 !important;
}

body.dark-mode .card strong,
body.dark-mode .panel-header h2,
body.dark-mode h1,
body.dark-mode h2 {
    color: #f1f5f9;
}

body.dark-mode table {
    color: #e2e8f0;
}

body.dark-mode th {
    color: #8A9189 !important;
    background: #0f172a !important;
    border-color: #334155 !important;
}

body.dark-mode .receiving-card,
body.dark-mode .issuing-card {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode .receiving-card-title h3,
body.dark-mode .receiving-field label {
    color: #f1f5f9;
}

body.dark-mode .receiving-card-title p {
    color: #8A9189;
}

body.dark-mode td {
    border-color: #334155 !important;
}

body.dark-mode tbody tr:hover {
    background: #273548;
}

body.dark-mode .form-group label {
    color: #8A9189;
}

body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .categories-panel form .form-group input,
body.dark-mode .categories-panel form .form-group select {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .modal-header p,
body.dark-mode p {
    color: #8A9189;
}

body.dark-mode .close-modal {
    color: #8A9189;
}

body.dark-mode .cancel-btn {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .item-card {
    background: #1e293b;
    box-shadow: none;
    border: 1px solid #334155;
}

/* ID-სელექტორების (მაღალი specificity) გადაფარვა დარკ მოუდში —
   ეს ის ადგილია, სადაც ციფრები/ტექსტი ქრებოდა */

body.dark-mode #dashboardPage .stats .card strong,
body.dark-mode .stats .card strong {
    color: #f8fafc !important;
}

body.dark-mode #dashboardPage .stats .card span,
body.dark-mode #dashboardPage .stats .card small {
    color: #8A9189 !important;
}

body.dark-mode table td,
body.dark-mode table th {
    color: #e2e8f0;
}

body.dark-mode .empty,
body.dark-mode .loading {
    color: #8A9189 !important;
}

body.dark-mode input::placeholder {
    color: #8A9189;
}

body.dark-mode .add-product-btn {
    color: white;
}


/* ==========================================
   MOBILE RESPONSIVENESS — admin panel
========================================== */

#mobileMenuBtn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 60;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid #E5E3DA;
    background: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#sidebarOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 45;
}

@media (max-width: 900px) {

    #mobileMenuBtn {
        display: block;
    }

    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh !important;
        height: 100dvh !important;
        width: 260px !important;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
        display: flex !important;
        flex-direction: column !important;
    }

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

    .sidebar.mobile-open ~ #sidebarOverlay,
    #sidebarOverlay.active {
        display: block;
    }

    .sidebar nav {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }

    .user {
        position: sticky;
        bottom: 0;
        background: #14201A;
        z-index: 5;
    }

    .main {
        margin-left: 0 !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-top: 70px !important;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .topbar input {
        width: 100% !important;
    }

    .stats,
    .category-stats,
    .summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dashboard-analytics-grid {
        grid-template-columns: 1fr !important;
    }

    .secondary-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .card {
        padding: 14px !important;
    }

    .card small {
        margin: 0 -14px -14px !important;
        padding: 10px 14px 12px !important;
    }

    .card strong {
        font-size: 20px !important;
    }

    #salesTrendChart {
        max-height: none !important;
    }

    .dashboard-analytics-grid .panel > div[style*="height:280px"] {
        height: 200px !important;
    }

    #topProductsList > div,
    #topDebtorsList > div {
        font-size: 13px !important;
    }

    /* ღილაკები — მინიმუმ 44px, თითით მარტივად დასაჭერი (Apple/Google-ის რეკომენდაცია) */
    .save-btn,
    .cancel-btn {
        min-height: 44px;
        padding: 12px 18px;
        font-size: 14px;
    }

    /* აიქონ-ღილაკები (რედაქტირება/წაშლა) — კვადრატული, ხატულა ცენტრში,
       არა ტექსტური padding (რომელიც ხატულას "აქრობდა") */
    .edit-btn,
    .delete-btn {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

}

@media (max-width: 480px) {

    .modal,
    .category-modal {
        padding: 18px !important;
    }

}

@media (max-width: 480px) {

    .stats,
    .category-stats,
    .summary-grid,
    .secondary-stats {
        grid-template-columns: 1fr !important;
    }

}

@media (max-width: 900px) {

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    /* ცხრილები — ჰორიზონტალური სქროლი, ტელეფონზე რომ არ ჩამოწვეს */
    .panel table,
    .categories-panel table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal,
    .category-modal {
        width: 92% !important;
        max-width: 92% !important;
        margin: 0 4%;
    }

}


/* ==========================================
   INITIAL LOADING OVERLAY
========================================== */

#initialLoadingOverlay {
    position: fixed;
    inset: 0;
    background: #f4f6f8;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    transition: opacity 0.3s ease;
}

#initialLoadingOverlay img {
    width: 120px;
    opacity: 0.9;
}

#initialLoadingOverlay .spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #E5E3DA;
    border-top-color: #16a34a;
    border-radius: 50%;
    animation: agrolineSpin 0.8s linear infinite;
}

#initialLoadingOverlay p {
    color: #8A9189;
    font-size: 13px;
}

#initialLoadingOverlay.hidden {
    opacity: 0;
    pointer-events: none;
}

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

body.dark-mode #initialLoadingOverlay {
    background: #0f172a;
}


/* ==========================================
   NAV ICONS (SVG, feather-style)
========================================== */

.nav-icon {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ==========================================
   FLATPICKR — ბრენდის ფერებში მორგება
========================================== */

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #16a34a;
    border-color: #16a34a;
}

.flatpickr-day.today {
    border-color: #16a34a;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    color: #14532d;
}

.flatpickr-day:hover {
    background: #edf6e9;
}

body.dark-mode .flatpickr-calendar {
    background: #1e293b;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

body.dark-mode .flatpickr-day {
    color: #e2e8f0;
}

body.dark-mode .flatpickr-months .flatpickr-month,
body.dark-mode .flatpickr-weekdays,
body.dark-mode span.flatpickr-weekday {
    background: #1e293b;
    color: #8A9189;
}


/* ==========================================
   SEARCHABLE SELECT — საკუთარი, მარტივი dropdown
========================================== */

.searchable-select-wrap {
    position: relative;
}

.searchable-select-input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #E5E3DA;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    box-sizing: border-box;
    cursor: text;
    font-family: inherit;
}

.searchable-select-input:focus {
    outline: none;
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12);
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: white;
    border: 1px solid #E5E3DA;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 40;
}

.searchable-select-item {
    padding: 10px 13px;
    font-size: 13px;
    cursor: pointer;
}

.searchable-select-item:hover,
.searchable-select-item.selected {
    background: #edf6e9;
    color: #14532d;
}

.searchable-select-empty {
    padding: 12px 13px;
    font-size: 13px;
    color: #8A9189;
    text-align: center;
}

body.dark-mode .searchable-select-input {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .searchable-select-dropdown {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .searchable-select-item {
    color: #e2e8f0;
}

body.dark-mode .searchable-select-item:hover,
body.dark-mode .searchable-select-item.selected {
    background: rgba(22,163,74,0.18);
    color: #4ade80;
}

body.dark-mode .searchable-select-empty {
    color: #8A9189;
}
