/* Gateway Seed-to-Sale - Custom Styles */

/* --- Root Colors ------------------------------- */
:root {
    --gw-primary: #198754;
    --gw-primary-rgb: 25, 135, 84;
    --gw-dark: #1a1e24;
    --gw-dark-lighter: #252a31;
    --gw-dark-border: #2e343c;
    --gw-sidebar-text: #c8ced5;
    --gw-sidebar-muted: #8a929b;
    --gw-sidebar-hover: rgba(255, 255, 255, 0.08);
    --gw-sidebar-active: rgba(255, 255, 255, 0.12);
}

/* --- Sidebar ----------------------------------- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
}
.sidebar .sidebar-header {
	background-color:#c7ced4;
}
.sidebar .sidebar-header h5 {
	color: black;
}
.sidebar .sidebar-header .text-muted {
	color: #2d3f53!important;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.sidebar .nav-link {
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.12);
    border-left-color: #198754;
    color: #fff !important;
    font-weight: 500;
}

.sidebar .text-muted {
    color: var(--gw-sidebar-muted) !important;
}

.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    color: var(--gw-sidebar-muted);
}

.sidebar-footer {
    color: var(--gw-sidebar-muted);
}

/* --- Main Content ------------------------------ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
}

/* --- Topbar ------------------------------------ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .breadcrumb {
    font-size: 0.875rem;
}

/* --- Cards ------------------------------------- */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0.75rem 1rem;
}

/* --- Tables ------------------------------------ */
.table th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* --- Badges ------------------------------------ */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* Status badge colors */
.badge-active { background-color: #198754 !important; }
.badge-pending { background-color: #ffc107 !important; color: #000 !important; }
.badge-suspended { background-color: #dc3545 !important; }
.badge-revoked { background-color: #343a40 !important; }
.badge-expired { background-color: #6c757d !important; }

/* Growth phase badges */
.badge-clone { background-color: #20c997 !important; }
.badge-vegetative { background-color: #198754 !important; }
.badge-flowering { background-color: #fd7e14 !important; }
.badge-harvested { background-color: #0dcaf0 !important; color: #000 !important; }
.badge-destroyed { background-color: #dc3545 !important; }

/* Package status badges */
.badge-on-hold { background-color: #ffc107 !important; color: #000 !important; }
.badge-in-transit { background-color: #0d6efd !important; }
.badge-sold { background-color: #6c757d !important; }

/* --- Stat Cards -------------------------------- */
.border-start.border-4 .card-body .h3 {
    font-weight: 700;
}

/* --- Forms ------------------------------------- */
.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

/* --- Alerts ------------------------------------ */
.alert {
    font-size: 0.9rem;
}

/* --- Timeline (for audit/plant history) -------- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.3rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #198754;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #198754;
}

.timeline-item.timeline-danger::before {
    background-color: #dc3545;
    box-shadow: 0 0 0 2px #dc3545;
}

.timeline-item.timeline-warning::before {
    background-color: #ffc107;
    box-shadow: 0 0 0 2px #ffc107;
}

.timeline-item.timeline-info::before {
    background-color: #0dcaf0;
    box-shadow: 0 0 0 2px #0dcaf0;
}

.timeline-time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* --- Purchase Limit Gauge ---------------------- */
.limit-gauge {
    height: 24px;
    border-radius: 12px;
    background-color: #e9ecef;
    overflow: hidden;
}

.limit-gauge .bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.limit-gauge .bar.safe { background-color: #198754; }
.limit-gauge .bar.warning { background-color: #ffc107; }
.limit-gauge .bar.danger { background-color: #dc3545; }

/* --- Responsive -------------------------------- */
@media (max-width: 767.98px) {
    .sidebar {
        margin-left: -260px;
    }
    .sidebar.show {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0;
    }
}

/* --- Print ------------------------------------- */
@media print {
    .sidebar,
    .topbar,
    .btn,
    .pagination {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
}

/* --- Misc -------------------------------------- */
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* JSON payload display */
.json-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 400px;
    overflow-y: auto;
}
