/* login */

.card .card-header-rose:not(.card-header-icon):not(.card-header-text) {
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(172,200,43,.4);
}
.card .card-header-rose:not(.card-header-icon):not(.card-header-text) {
    background: linear-gradient(60deg,#acc82b,#9ab326);
}
.btn.btn-rose.btn-link, 
.btn.btn-rose.btn-link:active, 
.btn.btn-rose.btn-link:hover {
    color: #acc82b !important;
}
.btn.btn-rose:active,
.btn.btn-rose:focus,
.btn.btn-rose:hover{
    box-shadow:0 14px 26px -12px rgba(154,179,38,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(154,179,38,.2) !important;
}

/* sidebar */
.sidebar[data-color=green] li.active>a {
    background-color: #8ba423;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.14), 0 7px 10px -5px rgba(139,164,35,.4);
}
.sidebar .logo a.logo-normal img {
    width: 100%;
}
.sidebar[data-background-color="white"] .nav li.active>a {
    background-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 4px 20px 0 rgba(0,0,0,.12), 0 7px 10px -5px rgba(125,178,0,.35);
}
.sidebar[data-background-color="white"] .nav li.active>a i {
    color: #ffffff;
}
.sidebar .nav .nav-link i.material-icons {
    margin-right: 8px;
    font-size: 1.1rem;
}
.sidebar .nav .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar .nav .nav-link .sidebar-normal {
    flex: 1;
}
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: var(--brand-danger);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
}

/* datatable */
table.dataTable thead>tr>th.sorting {
    vertical-align: middle !important;
}
.card .card-header-rose .card-icon, 
.card .card-header-rose .card-text {
    background: linear-gradient(60deg,#e45055,#e13a3f);
}
.alert.alert-danger {
    background-color: #e7666a;
}

/* action buttons */
.btn.btn-info {
    background-color: #e69e38;
    border-color: #e69e38;
    box-shadow: 0 2px 2px 0 rgba(230,158,56,.14), 0 3px 1px -2px rgba(230,158,56,.2), 0 1px 5px 0 rgba(230,158,56,.12);
}
.btn.btn-info:hover {
    background-color: #e39321;
    border-color: #e39321;
    box-shadow: 0 14px 26px -12px rgba(227,147,33,.14), 0 4px 23px 0 rgba(227,147,33,.2), 0 8px 10px -5px rgba(227,147,33,.12);
}
.btn.btn-success {
    background-color: #acc82b;
    border-color: #acc82b;
    box-shadow: 0 2px 2px 0 rgba(172,200,43,.14), 0 3px 1px -2px rgba(172,200,43,.2), 0 1px 5px 0 rgba(172,200,43,.12);
}
.btn.btn-success.focus, 
.btn.btn-success:focus, 
.btn.btn-success:hover {
    background-color: #9ab326;
    border-color: #9ab326;
    box-shadow: 0 14px 26px -12px rgba(154,179,38,.14), 0 4px 23px 0 rgba(154,179,38,.2), 0 8px 10px -5px rgba(154,179,38,.12);
}
.btn.btn-danger {
    background-color: #e13a3f !important;
    border-color: #e13a3f !important;
    box-shadow: 0 2px 2px 0 rgba(225,58,63,.14), 0 3px 1px -2px rgba(225,58,63,.2), 0 1px 5px 0 rgba(225,58,63,.12) !important;
}
.btn.btn-danger:hover {
    background-color: #de2429 !important;
    border-color: #de2429 !important;
    box-shadow: 0 14px 26px -12px rgba(222,36,41,.14), 0 4px 23px 0 rgba(222,36,41,.2), 0 8px 10px -5px rgba(222,36,41,.12) !important;
}

/* pagination */
.pagination>.page-item.active>a, 
.pagination>.page-item.active>a:hover {
    background-color: #8ba423;
    border-color: #8ba423;
}
.pagination>.page-item.active>a {
    box-shadow: 0 4px 5px 0 rgba(139,164,35,.14), 0 1px 10px 0 rgba(139,164,35,.12), 0 2px 4px -1px rgba(139,164,35,.2);
}
.pagination>.page-item.active>a:hover {
    box-shadow: 0 14px 26px -12px rgba(139,164,35,.14), 0 4px 23px 0 rgba(139,164,35,.12), 0 8px 10px -5px rgba(139,164,35,.2);
}

/* form */
.form-control, .is-focused .form-control {
    background-image: linear-gradient(0deg,#7db200 2px,rgba(125,178,0,0) 0),linear-gradient(0deg,#d2d2d2 1px,hsla(0,0%,82%,0) 0);
}
.btn.btn-primary, 
.btn.btn-primary:focus,
.btn.btn-primary.active, 
.btn.btn-primary:active, 
.open>.btn.btn-primary.dropdown-toggle, 
.show>.btn.btn-primary.dropdown-toggle {
    background-color: #7db200 !important;
    border-color: #7db200 !important;
    box-shadow: 0 2px 2px 0 rgba(125,178,0,.14), 0 3px 1px -2px rgba(125,178,0,.2), 0 1px 5px 0 rgba(125,178,0,.12);
}
.bootstrap-select .dropdown-item.active {
    background: #7db200;
}
.btn.btn-primary:hover, 
.bootstrap-select .dropdown-menu li a:hover, 
.dropdown-menu .dropdown-item:hover {
    background-color: #7db200 !important;
    border-color: #7db200 !important;
    box-shadow: 0 14px 26px -12px rgba(125,178,0,.42),0 4px 23px 0 rgba(0,0,0,.12),0 8px 10px -5px rgba(125,178,0,.2) !important;
}
.btn.btn-rose {
    background-color: #e8a40a;
    border-color: #e8a40a !important;
    box-shadow: 0 2px 2px 0 rgba(232,164,10,.14), 0 3px 1px -2px rgba(232,164,10,.2), 0 1px 5px 0 rgba(232,164,10,.12);
}
.btn.btn-rose:hover {
    background-color: #d09309;
    border-color: #d09309 !important;
    box-shadow: 0 14px 26px -12px rgba(208,147,9,.14), 0 4px 23px 0 rgba(208,147,9,.2), 0 8px 10px -5px rgba(208,147,9,.12);
}
.bootstrap-datetimepicker-widget a[data-action], 
.bootstrap-datetimepicker-widget a[data-action]:hover span, 
.bootstrap-datetimepicker-widget table td.today>div:before {
    color:#7db200;
}
.bootstrap-datetimepicker-widget table td.active>div {
    background-color:#7db200;
    box-shadow:0 4px 20px 0 rgba(0,0,0,.14),0 7px 10px -5px rgba(125,178,0,.4)
}
.btn .fa-download:before {
    font-size: 1.5rem;
}
.form-check .form-check-input:checked~.circle {
    border-color: #7db200;
}
.form-check .form-check-label .circle .check {
    background-color: #7db200;
}

/* modernize core surfaces */
:root {
    --brand-primary: #7db200;
    --brand-primary-600: #6a9800;
    --brand-warn: #e69e38;
    --brand-danger: #e13a3f;
    --surface: #ffffff;
    --surface-muted: #f5f7f9;
    --text-strong: #1f2a37;
    --text-muted: #5b6775;
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.08);
}

body,
.main-panel {
    background: var(--surface-muted);
    color: var(--text-strong);
}

.card {
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: var(--shadow-soft);
}

.card .card-header {
    border-radius: 16px 16px 0 0;
}

.card .card-title {
    color: var(--text-strong);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.card .card-category,
.table .text-muted {
    color: var(--text-muted) !important;
}

.table thead th {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.table td,
.table th {
    padding: 0.9rem 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* dashboard */
.dashboard-metrics .card {
    border-left: 4px solid var(--brand-primary);
}
.dashboard-stat-title {
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dashboard-stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0.4rem 0 0.3rem;
}
.dashboard-stat-sub {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.dashboard-filter {
    margin-bottom: 16px;
}
.dashboard-filter-form .form-group {
    margin-bottom: 0;
}
.dashboard-filter-label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.dashboard-chart-card .ct-chart {
    height: 220px;
}
.dashboard-chart-note {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}
.dashboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.dashboard-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px dashed #e2e8f0;
}
.dashboard-list li:last-child {
    border-bottom: none;
}
.dashboard-list-title {
    font-weight: 500;
    color: var(--text-strong);
}
.dashboard-list-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.dashboard-list-columns {
    column-count: 2;
    column-gap: 2rem;
}
.dashboard-list-columns li {
    break-inside: avoid;
}
.dashboard-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.dashboard-load-more {
    margin-top: 12px;
}
.dashboard-chart-card .ct-series-a .ct-line,
.dashboard-chart-card .ct-series-a .ct-area {
    stroke: var(--brand-primary);
    fill: rgba(125, 178, 0, 0.15);
}
.dashboard-chart-card .ct-series-a .ct-point {
    stroke: var(--brand-primary-600);
}

@media (max-width: 991px) {
    .dashboard-list-columns {
        column-count: 1;
    }
}

.btn {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn.btn-info {
    background-color: var(--brand-warn);
    border-color: var(--brand-warn);
}

.btn.btn-success,
.btn.btn-primary,
.bootstrap-select .dropdown-item.active,
.bootstrap-datetimepicker-widget table td.active > div {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn.btn-danger {
    background-color: var(--brand-danger) !important;
    border-color: var(--brand-danger) !important;
}

.pagination > .page-item.active > a,
.pagination > .page-item.active > a:hover {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* kupovine view */
.purchase-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.purchase-summary-card {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    background: var(--surface);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-strong);
}

.summary-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.summary-subvalue {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.summary-actions .summary-label {
    margin-bottom: 4px;
}

.purchase-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.purchase-actions form {
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: #e2e8f0;
    color: #1f2a37;
}

.status-pill.status-new {
    background: #d1fae5;
    color: #065f46;
}

.status-pill.status-progress {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.status-success {
    background: #dcfce7;
    color: #166534;
}

.status-pill.status-cancel {
    background: #fee2e2;
    color: #991b1b;
}

.detail-card {
    background: var(--surface);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    height: 100%;
}

.detail-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-strong);
    text-align: right;
    max-width: 65%;
}

.detail-note .detail-value {
    text-align: left;
    max-width: 100%;
    white-space: pre-line;
}

.detail-total .detail-value {
    font-size: 1.05rem;
    font-weight: 600;
}

.purchase-items {
    margin-top: 10px;
}

.purchase-items .section-title {
    font-weight: 600;
    margin-bottom: 12px;
}

.purchase-items-table tbody tr td {
    vertical-align: middle;
}

.purchase-note .detail-card {
    height: auto;
}

.purchase-note-form .form-group {
    margin-bottom: 12px;
}

.purchase-note-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.purchase-items-table th.amount,
.purchase-items-table td.amount {
    text-align: right;
    white-space: nowrap;
}

.purchase-items-table th.qty,
.purchase-items-table td.qty {
    text-align: center;
    width: 90px;
}

.purchase-details .detail-card {
    height: 100%;
}

@media (max-width: 1199px) {
    .purchase-summary-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .purchase-summary-card {
        grid-template-columns: 1fr;
    }
}
