:root {
    --primary-green: #347433;
    --primary-hover: #285a27;
    --accent-yellow: #FFC107;
    --bg-white: #FFFFFF;
    --bg-dashboard: #F1F3F1;
    --text-main: #1A1A1A;
    --text-muted: #666666;
    --border-color: #E0E0E0;
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-md: 12px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dashboard);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-logo {
    padding: 32px 24px;
}

.sidebar-logo h1 {
    font-size: 22px;
    color: var(--primary-green);
    font-weight: 800;
    letter-spacing: -0.5px;
}

.sidebar-logo p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-menu {
    flex: 1;
    padding: 0 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 18px;
}

.nav-item:hover, .nav-item.active {
    background: #F4F8F4;
    color: var(--primary-green);
}

.sidebar-footer {
    padding: 24px 16px;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hamburger-btn {
    background: #F4F8F4;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 20px;
    color: var(--primary-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.hamburger-btn:hover {
    background: var(--primary-green);
    color: white;
}

.search-container {
    position: relative;
    width: 380px;
}

.search-container input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: #F5F7F5;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-container i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icon {
    font-size: 18px;
    color: #333;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Area */
.content-area {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.hero-text h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 8px;
}

.hero-text p {
    color: var(--text-muted);
    font-size: 16px;
}

.btn-laporan {
    padding: 10px 24px;
    background: #E8EDE8;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stat-header i {
    font-size: 20px;
}

.stat-header span {
    font-size: 14px;
    font-weight: 700;
    color: #444;
}

.stat-value {
    font-size: 44px;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}

.badge-yellow { background: #FFF5D1; color: #856404; }

/* Middle Section */
.middle-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 24px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 800;
}

/* Bar Chart */
.chart-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 20px 10px;
}

.bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%; /* Ensure bars can use percentage height */
    justify-content: flex-end;
}

.bar {
    width: 60px;
    background: #E6EBE6;
    border-radius: 4px;
    position: relative;
    transition: 0.3s;
}

.bar.highlight {
    background: var(--primary-green);
}

.bar-label {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #666;
}

.bar-label.active {
    color: var(--primary-green);
}

.bar-tooltip {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
}

/* Quick Actions */
.quick-actions-card {
    background: var(--primary-green);
    color: white;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.quick-item {
    background: rgba(255,255,255,0.15);
    padding: 16px 8px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.quick-item:hover {
    background: rgba(255,255,255,0.25);
}

.quick-item i {
    font-size: 20px;
    margin-bottom: 8px;
}

.quick-item span {
    display: block;
    font-size: 11px;
    font-weight: 700;
}

/* Tasks */
.task-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
}

.task-item:last-child {
    border-bottom: none;
}

.task-info h4 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 4px;
}

.task-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.task-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-green);
}

/* Table */
.table-card {
    padding: 0;
}

.table-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 24px;
    background: #FAFAFA;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid #F5F5F5;
    font-size: 14px;
    font-weight: 600;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.status-selesai { background: #E6F4EA; color: #1E8E3E; }
.status-diproses { background: #FFF3E0; color: #EF6C00; }
.status-batal { background: #FCE8E6; color: #D93025; }

.bar-wrapper {
    cursor: pointer;
}
.bar-wrapper:hover .bar:not(.highlight) {
    background: #CDD7CD;
}


/* Detail Pesanan Styles */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.btn-back {
    background: white;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.order-status-banner {
    background: #FFC107;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    color: #333;
}
.status-info h4 { font-size: 12px; text-transform: uppercase; margin-bottom: 4px; }
.status-info h2 { font-size: 24px; font-weight: 800; }

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

.timeline-lacak {
    padding-left: 20px;
    position: relative;
    margin-top: 20px;
}
.timeline-lacak::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #E0E0E0;
}
.step { position: relative; margin-bottom: 24px; padding-left: 30px; }
.step::after {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: 2px solid #CCC;
}
.step.active::after { background: var(--primary-green); border-color: var(--primary-green); }

.product-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
}
.product-img { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; }

.footer-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Updated Status Badges */
.status-badge {
    cursor: pointer;
    font-family: monospace;
    font-weight: 800;
}


/* Stok Page Specifics */
.filter-tag {
    padding: 6px 16px;
    background: #E0E0E0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
}
.filter-tag.active {
    background: var(--primary-green);
    color: white;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.status-pill.tersedia { background: #E6F4EA; color: #1E8E3E; }
.status-pill.rendah { background: #FFF3E0; color: #EF6C00; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.action-icon {
    font-size: 18px;
    margin: 0 8px;
    cursor: pointer;
    color: #888;
}
.action-icon.edit:hover { color: var(--primary-green); }
.action-icon.delete:hover { color: #D93025; }

.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 24px;
}
.page-num {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.page-num.active { background: var(--primary-green); color: white; }


/* Order Page Colorful Cards */
.card-green { background: var(--primary-green); color: white; border: none; }
.card-yellow { background: #FFC107; color: #333; border: none; }

.filter-box label { display: block; font-size: 11px; font-weight: 700; color: #888; margin-bottom: 6px; text-transform: uppercase; }
.filter-box select, .filter-box input { width: 100%; padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.btn-terapkan { width: 100%; background: var(--primary-green); color: white; border: none; padding: 10px; border-radius: 6px; font-weight: 700; cursor: pointer; }

.order-id-link { color: var(--primary-green); font-weight: 800; text-decoration: none; cursor: pointer; }
.order-id-link:hover { text-decoration: underline; }

.avatar-circle { width: 32px; height: 32px; border-radius: 50%; background: #E0E0E0; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #666; }


/* Fix Status Badge Wrapping */
.status-badge {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
}


/* Status Badge Colors */
.status-menunggu { background: #FFF3E0 !important; color: #EF6C00 !important; }
.status-diproses { background: #E3F2FD !important; color: #1976D2 !important; }
.status-dikirim { background: #F5F5F5 !important; color: #616161 !important; }
.status-selesai { background: #E8F5E9 !important; color: #2E7D32 !important; }
.status-dibatalkan { background: #FCE8E6 !important; color: #D93025 !important; }


/* Beautified Unduh Button */
.btn-unduh {
    background: #ffffff;
    color: #347433;
    border: 1.5px solid #e0e0e0;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn-unduh i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.btn-unduh:hover {
    background: #f8fcf8;
    border-color: #347433;
    color: #347433;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 116, 51, 0.15);
}

.btn-unduh:hover i {
    transform: translateY(2px);
}

.btn-unduh:active {
    transform: translateY(0);
}


/* Download Dropdown Menu */
.download-wrapper {
    position: relative;
    display: inline-block;
}

.download-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 240px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    margin-top: 8px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.download-dropdown.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #333;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f0f7f0;
    color: #347433;
}

.dropdown-item i {
    width: 20px;
    color: #666;
}

.dropdown-item:hover i {
    color: #347433;
}


/* Add Product Form */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--primary-green);
    outline: none;
}

/* Tugas View Styles */
.tugas-filter-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.tugas-card {
    background: #2D6A2D;
    color: white;
    padding: 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border: 3px solid transparent;
}

.tugas-card.active {
    background: #FFC107;
    color: #333;
    border-color: #333;
}

.tugas-card .icon-circle {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tugas-card.active .icon-circle {
    background: rgba(0,0,0,0.1);
}

.tugas-card .status-tag {
    font-size: 10px;
    font-weight: 900;
    background: #333;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 8px;
    display: inline-block;
}

.action-btn-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    margin-right: 8px;
}

.action-btn-circle.check { color: #1E8E3E; border-color: #1E8E3E; }
.action-btn-circle.cross { color: #D93025; border-color: #D93025; }


/* Enhanced Back Button */
.btn-back-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1.5px solid #eee;
    border-radius: 10px;
    font-weight: 700;
    color: #444;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back-premium:hover {
    background: #fff;
    border-color: var(--primary-green);
    color: var(--primary-green);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Enhanced Save Button */
.btn-save-premium {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #2D6A2D, #1E8E3E);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 6px 15px rgba(30, 142, 62, 0.3);
}

.btn-save-premium:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(30, 142, 62, 0.4);
    filter: brightness(1.1);
}

.btn-save-premium i {
    font-size: 18px;
}

/* Photo Upload Preview */
.photo-upload-box {
    width: 160px;
    height: 160px;
    border: 2px dashed #ddd;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: all 0.3s;
    background: #fafafa;
}

.photo-upload-box:hover {
    border-color: var(--primary-green);
    background: #f0fff0;
}

.photo-upload-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-upload-box .upload-placeholder {
    text-align: center;
    color: #888;
    font-size: 12px;
    font-weight: 700;
}

.photo-upload-box .upload-placeholder i {
    font-size: 32px;
    margin-bottom: 8px;
    color: #ccc;
}


/* Archive Button */
.btn-arsip {
    padding: 10px 24px;
    background: #795548;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-arsip:hover {
    background: #5D4037;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(121, 85, 72, 0.3);
}

/* Modal System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 800;
}

/* Action Icons */
.action-icons-group {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f5f5f5;
    border: none;
}

.icon-btn.edit { color: #1976D2; }
.icon-btn.archive { color: #795548; }
.icon-btn.delete { color: #D93025; }

.icon-btn:hover {
    transform: scale(1.1);
    background: #eee;
}

/* Custom Alert */
.custom-alert {
    background: white;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.alert-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
}

.btn-alert {
    padding: 8px 24px;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    cursor: pointer;
}

.btn-alert.yes { background: var(--primary-green); color: white; }
.btn-alert.no { background: #eee; color: #333; }


/* Enhanced Status Pills */
.status-pill {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    min-width: 100px;
}

.status-pill.status-tersedia {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.status-pill.status-stok-menipis {
    background: #FFF3E0;
    color: #EF6C00;
    border: 1px solid #FFE0B2;
}

.status-pill.status-habis {
    background: #FCE8E6;
    color: #D93025;
    border: 1px solid #FAD2CF;
}

/* Animal Status Badges */
.animal-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    text-align: center;
    min-width: 70px;
}

.animal-status-badge.status-sakit {
    background: #FFC107;
    color: #333;
}

.animal-status-badge.status-hilang {
    background: #FCE8E6;
    color: #D93025;
}

.animal-status-badge.status-md {
    background: #333;
    color: white;
}
/* Tool Status Badges */
.tool-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    text-align: center;
    min-width: 90px;
}

.tool-status-badge.status-normal {
    background: #E8F5E9;
    color: #2E7D32;
    border: 1px solid #C8E6C9;
}

.tool-status-badge.status-rusak {
    background: #FCE8E6;
    color: #D93025;
    border: 1px solid #FAD2CF;
}

.tool-status-badge.status-perlu-servis {
    background: #FFF5D1;
    color: #856404;
    border: 1px solid #FFEEBA;
}

/* Env Status Badges */
.env-status-badge {
    background: #FCE8E6;
    color: #D93025;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    display: inline-block;
    text-align: center;
    border: 1px solid #FAD2CF;
    white-space: nowrap;
}

/* Notification Dropdown */
.notif-dropdown {
    position: fixed;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 3000;
    border: 1px solid #eee;
    overflow: hidden;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h3 { font-size: 16px; font-weight: 800; }

.notif-list { max-height: 400px; overflow-y: auto; }

.notif-item {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
    position: relative;
}

.notif-item:hover { background: #f9f9f9; }
.notif-item.unread { background: #f0fff0; }

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.notif-desc { font-size: 12px; color: #666; line-height: 1.4; margin-bottom: 6px; }
.notif-time { font-size: 11px; color: #999; }

.unread-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.notif-footer {
    padding: 12px;
    text-align: center;
    background: #f8f9fa;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-green);
    cursor: pointer;
}

/* --- FINAL MOBILE RESPONSIVENESS (max-width: 768px) --- */
/* Optimized to ELIMINATE HORIZONTAL SCROLL and fix layout collisions */
@media (max-width: 768px) {
    /* 0. Prevent Global Horizontal Overflow */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }
    
    .app-container {
        overflow-x: hidden !important;
        display: block; /* Stacking layout */
        width: 100% !important;
    }

    /* 1. Sidebar Transformation */
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        z-index: 5000; /* Above everything */
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 15px 0 40px rgba(0,0,0,0.3);
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        min-width: 100% !important;
        transition: none;
    }

    /* 2. Header & Navbar Optimization */
    .header {
        padding: 0 18px; /* Matched with content-area padding */
        height: 60px;
        width: 100% !important;
    }

    .search-container {
        display: none !important; /* Remove fixed-width search on mobile */
    }

    .header-right {
        gap: 12px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    /* 3. Hero Section & Content Area */
    .content-area {
        padding: 20px 18px; /* Increased side padding for breathing room */
        width: 100% !important;
        max-width: 100% !important;
    }

    .hero-section {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 20px;
        margin-bottom: 24px;
    }

    .hero-text h2 {
        font-size: 24px;
        line-height: 1.2;
    }

    .hero-text p {
        font-size: 14px;
    }

    /* 4. Force Single Column on ALL Grids */
    .stats-grid, 
    .middle-grid, 
    .detail-grid, 
    .footer-cards, 
    .tugas-filter-grid,
    .form-container > div[style*="grid-template-columns"],
    .modal-content div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: grid !important;
        gap: 16px !important;
        width: 100% !important;
    }

    /* 5. Cards & Containers Responsive Width */
    .card, .stat-card, .form-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    /* 6. Internal Table Scrolling (Prevents Page Stretch) */
    .table-card {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        display: block !important;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
    }

    table {
        min-width: 650px; /* Horizontal scroll ONLY inside .table-card */
    }

    .table-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px;
    }

    .table-header div {
        width: 100% !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* 7. Buttons & Action Elements */
    .btn-save-premium, 
    .btn-laporan, 
    .btn-unduh, 
    .btn-arsip,
    .btn-alert {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px !important;
        font-size: 14px !important;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    /* 8. Modals & Popups Scaling */
    .modal-content {
        width: calc(100% - 24px) !important;
        max-width: 100% !important;
        margin: 12px !important;
        padding: 20px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        border-radius: 12px !important;
    }

    .notif-dropdown {
        width: calc(100% - 24px) !important;
        right: 12px !important;
        left: 12px !important;
        top: 65px !important;
    }

    /* 9. Misc Styling Fixes */
    .photo-upload-box {
        height: 180px !important;
        width: 100% !important;
    }

    .avatar-circle {
        width: 32px !important;
        height: 32px !important;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Shrink and Center specific dashboard sections */
    .middle-grid .card:first-child, 
    .quick-actions-card,
    .middle-grid > div:last-child > .card:last-child { /* Daftar Tugas card */
        width: 92% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .middle-grid .card:first-child {
        margin-bottom: 24px;
    }

    /* Rata Tengah (Internal Centering) */
    .middle-grid .card:first-child .card-header,
    .quick-actions-card .card-title,
    .middle-grid > div:last-child > .card:last-child .card-header {
        flex-direction: row !important; /* Keep icon on the right but with padding */
        justify-content: space-between !important;
        align-items: center !important;
        padding-right: 10px !important; /* Spacing for the right icon */
    }
    
    .quick-actions-card .card-title {
        justify-content: center !important;
        text-align: center !important;
    }

    .chart-container {
        justify-content: center !important;
        gap: 8px !important;
    }

    #chart-description-text {
        text-align: center !important;
    }

    .quick-grid {
        justify-items: center !important;
        justify-content: center !important;
    }

    .quick-item {
        text-align: center !important;
    }
}
