/* 
  Tumber Project CSS 
  Modern CSS with Custom Properties, CSS variables, and Glassmorphism 
*/

:root {
    /* Color Palette */
    --primary: #2d6a4f;
    --primary-light: #40916c;
    --primary-dark: #1b4332;
    --secondary: #e9c46a;
    --accent: #f4a261;

    /* UI Colors */
    --bg-body: #f4f7f6;
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-glass: rgba(255, 255, 255, 0.4);

    /* Text Colors */
    --text-dark: #2b2d42;
    --text-muted: #6c757d;
    --text-light: #ffffff;

    /* Status Colors */
    --success: #2a9d8f;
    --success-light: rgba(42, 157, 143, 0.15);
    --warning: #f4a261;
    --warning-light: rgba(244, 162, 97, 0.15);
    --danger: #e63946;
    --danger-light: rgba(230, 57, 70, 0.15);
    --info: #0077b6;
    --info-light: rgba(0, 119, 182, 0.15);

    /* Typography & Spacing */
    --font-main: 'Inter', sans-serif;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 24px rgba(45, 106, 79, 0.08);
    --shadow-hover: 0 16px 32px rgba(45, 106, 79, 0.12);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-dark);
    background-color: var(--bg-body);
    /* Subtle organic background gradient */
    background-image:
        radial-gradient(at 0% 0%, rgba(64, 145, 108, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(233, 196, 106, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(255, 255, 255, 0.8) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(45, 106, 79, 0.4);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--primary-light);
    color: var(--primary);
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: var(--border-radius-sm);
}

.btn-outline-sm:hover {
    background: var(--primary-light);
    color: var(--text-light);
}

.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary);
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 100;
    border-right: 1px solid var(--border-glass);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 40px;
}

.logo-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(64, 145, 108, 0.08);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Important for flex children */
}

/* Top Header */
.top-header {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid var(--border-glass);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.search-bar {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 8px 16px;
    width: 350px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.search-bar:focus-within {
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary-light);
    border-color: transparent;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-btn {
    position: relative;
}

.notification-btn .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* App View Wrappers (Global Container Layout) */
.app-view {
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    animation: fadeInUp 0.4s ease forwards;
}

/* Welcome Banner */
.welcome-banner {
    border-radius: var(--border-radius);
    padding: 32px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
    position: relative;
    overflow: hidden;
}

.banner-content {
    max-width: 60%;
    z-index: 2;
}

.banner-content h1 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 12px;
}

.banner-content p {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.banner-decoration {
    position: absolute;
    right: -20px;
    top: -40px;
    font-size: 15rem;
    color: var(--primary);
    opacity: 0.05;
    z-index: 1;
    transform: rotate(15deg);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    /* Start hidden until animation fills mode forwards */
}

/* Hover Effects */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.stat-card {
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.bg-green-light {
    background: var(--success-light);
}

.text-green {
    color: var(--success);
}

.bg-yellow-light {
    background: var(--warning-light);
}

.text-yellow {
    color: var(--warning);
}

.bg-blue-light {
    background: var(--info-light);
}

.text-blue {
    color: var(--info);
}

.bg-red-light {
    background: var(--danger-light);
}

.text-red {
    color: var(--danger);
}

.stat-details h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-details h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-details .unit {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: normal;
}

.trend {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.trend.positive {
    color: var(--success);
}

.trend.negative {
    color: var(--danger);
}

.trend.neutral {
    color: var(--text-muted);
}

/* Splits Layout */
.dashboard-splits {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    align-items: start;
}

.split-card {
    border-radius: var(--border-radius);
    padding: 28px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 1.2rem;
    color: var(--text-dark);
}

/* List Items Styles */
.commodity-list,
.task-list,
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 400px;
    padding-right: 8px;
}

/* Custom Scrollbar */
.commodity-list::-webkit-scrollbar,
.task-list::-webkit-scrollbar,
.transaction-list::-webkit-scrollbar {
    width: 6px;
}

.commodity-list::-webkit-scrollbar-track,
.task-list::-webkit-scrollbar-track,
.transaction-list::-webkit-scrollbar-track {
    background: transparent;
}

.commodity-list::-webkit-scrollbar-thumb,
.task-list::-webkit-scrollbar-thumb,
.transaction-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.list-item:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.item-main {
    display: flex;
    align-items: center;
    gap: 16px;
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.icon-padi {
    background: linear-gradient(135deg, #e9c46a, #f4a261);
}

.icon-jagung {
    background: linear-gradient(135deg, #f4a261, #e76f51);
}

.icon-bawang {
    background: linear-gradient(135deg, #9b5de5, #f15bb5);
}

.icon-cabai {
    background: linear-gradient(135deg, #e63946, #d90429);
}

.icon-tugas {
    background: linear-gradient(135deg, #00b4d8, #0077b6);
}

.icon-in {
    background: linear-gradient(135deg, #2a9d8f, #21867a);
}

.icon-out {
    background: linear-gradient(135deg, #e63946, #c1121f);
}

.item-info h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.finance-amount {
    font-weight: 700;
    font-size: 1.1rem;
}

.text-income {
    color: var(--success);
}

.text-expense {
    color: var(--danger);
}

.finance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.finance-header h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
}

.item-info h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.item-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-semai {
    background: var(--info-light);
    color: var(--info);
}

.status-tumbuh {
    background: var(--success-light);
    color: var(--success);
}

.status-panen {
    background: var(--warning-light);
    color: #d97706;
}

/* Task List Specific */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.task-item:last-child {
    border-bottom: none;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-light);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.task-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.task-checkbox.checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.7rem;
}

.task-content {
    flex-grow: 1;
}

.task-content h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.task-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.task-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.task-completed .task-content h4,
.task-completed .task-content p {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--border-radius);
    padding: 32px;
    transform: translateY(20px) scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.4rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

/* Custom View Switches — merged into .app-view above */

/* Data Table Styles */
.data-table th,
.data-table td {
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.custom-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Master Komoditas Cards */
.master-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 100%;
    position: relative;
    padding: 0;
}

.master-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #e2e8f0;
}

.master-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.master-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.master-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.master-card .status-akan {
    background: var(--warning);
}

.master-card .status-sudah {
    background: var(--success);
}

.master-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.master-info-row i {
    color: var(--primary-light);
    margin-top: 3px;
    width: 16px;
    text-align: center;
}

/* Dynamic Schedule Row */
.schedule-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-row input {
    margin-bottom: 0;
}

/* ============================
   Jadwal & Tugas - Task Cards
   ============================ */
.jadwal-task-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
    transition: var(--transition);
    position: relative;
}

.jadwal-task-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.jadwal-task-card.status-pending {
    border-left-color: var(--text-muted);
}

.jadwal-task-card.status-done_pending {
    border-left-color: var(--warning);
    background: rgba(244, 162, 97, 0.04);
}

.jadwal-task-card.status-approved {
    border-left-color: var(--success);
    background: rgba(42, 157, 143, 0.04);
}

.jadwal-task-card.status-overdue {
    border-left-color: var(--danger);
    background: rgba(230, 57, 70, 0.04);
}

.task-status-dot {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.task-card-body {
    flex: 1;
    min-width: 0;
}

.task-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.task-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.task-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.task-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}

.task-badge-pending {
    background: rgba(108, 117, 125, 0.12);
    color: var(--text-muted);
}

.task-badge-waiting {
    background: var(--warning-light);
    color: #b45309;
}

.task-badge-approved {
    background: var(--success-light);
    color: var(--success);
}

.task-badge-overdue {
    background: var(--danger-light);
    color: var(--danger);
}

.task-badge-auto {
    background: var(--info-light);
    color: var(--info);
    font-size: 0.72rem;
}

.jadwal-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.jadwal-empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
    display: block;
}


@media (max-width: 1024px) {
    .dashboard-splits {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: var(--bg-body);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: 100dvh;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }

    .search-bar {
        display: none;
        /* Hide on mobile to save space, maybe add search icon */
    }

    .top-header {
        padding: 0 20px;
    }

    .app-view {
        padding: 20px;
        gap: 20px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 24px;
    }

    .banner-content {
        max-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ── Early Warning Banner Animation ── */
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ── Risiko view stat icon colors (re-use existing bg/text classes) ── */
.bg-red-light  { background: var(--danger-light); }
.text-red      { color: var(--danger); }
.bg-yellow-light { background: var(--warning-light); }
.text-yellow   { color: var(--warning); }

/* ── Camera capture button pulse ── */
#capturePhotoBtn {
    animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(45,106,79,0.5); }
    50% { box-shadow: 0 0 0 8px rgba(45,106,79,0); }
}

/* ── Receipt / Risiko thumbnail hover ── */
.risiko-foto-thumb:hover, #transReceiptImg:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ── btn-sm helper ── */
.btn-sm {
    padding: 4px 10px;
    font-size: 0.82rem;
    border-radius: 6px;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.data-table th {
    background: rgba(45, 106, 79, 0.05);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    transition: var(--transition);
}

.data-table tr:hover td {
    background: rgba(45, 106, 79, 0.02);
}

/* Chart Styles */
canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Specific Finance Badges */
.task-badge-auto {
    background: rgba(0, 119, 182, 0.1);
    color: var(--info);
}

/* Responsive Table */
@media (max-width: 768px) {
    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Calendar Modal Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day-header {
    background: var(--primary);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.calendar-cell {
    background: white;
    min-height: 100px;
    padding: 8px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.calendar-cell:hover {
    background: rgba(45,106,79,0.05);
}

.calendar-cell.today {
    background: rgba(45,106,79,0.1);
}

.calendar-cell.other-month {
    background: #f8f9fa;
    color: #ccc;
    cursor: default;
}

.calendar-date-num {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.calendar-task-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 5px;
}

.task-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.task-dot.status-approved { background: var(--success); }
.task-dot.status-waiting { background: var(--warning); }
.task-dot.status-pending { background: var(--danger); }

/* All Commodities Grouping */
.project-group-card {
    margin-bottom: 25px;
}

.project-group-title {
    background: rgba(45,106,79,0.08);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.commodity-grid-simple {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Plant Photos Thumbnails */
.plant-photo-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.plant-photo-thumb:hover {
    transform: scale(1.1);
    z-index: 2;
}

.plant-photo-wrapper {
    position: relative;
    display: inline-block;
}

.remove-plant-photo {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 3;
}

/* ── Gudang module helpers ──────────────────────────────────────────────────── */
.form-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.gudang-tab.active,
.purchasing-tab.active {
    background: white !important;
    color: var(--primary-dark) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ── Offline Sync ─────────────────────────────────────────────────────────── */
@keyframes slideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

body.is-offline .btn-primary::after {
    content: ' (offline)';
    font-size: 0.7em;
    opacity: 0.7;
}

.pending-badge {
    background: #e63946;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -4px;
    right: -4px;
}


