/* ==========================================================================
   Azel Farm - Premium Agriculture Management Theme
   ========================================================================== */

/* 1. VARIABEL & RESET */
:root {
    --bg-primary: #f0f9ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e0f2fe;
    --accent-emerald: #0284c7;
    --accent-emerald-hover: #0369a1;
    --accent-emerald-glow: rgba(2, 132, 199, 0.1);
    
    --accent-blue: #0ea5e9;
    --accent-blue-hover: #0284c7;
    --accent-blue-glow: rgba(14, 165, 233, 0.1);
    
    --accent-amber: #b45309;
    --accent-amber-hover: #92400e;
    --accent-amber-glow: rgba(180, 83, 9, 0.1);
    
    --accent-rose: #b91c1c;
    --accent-rose-hover: #991b1b;
    --accent-rose-glow: rgba(185, 28, 28, 0.1);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #bae6fd;
    --border-glow: rgba(2, 132, 199, 0.15);
    
    --sidebar-width: 260px;
    --header-height: 80px;
    --bottom-nav-height: 64px;
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-blur: blur(16px);
    --shadow-main: 0 8px 30px rgba(2, 132, 199, 0.04), 0 4px 10px rgba(0, 0, 0, 0.02);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

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

/* Sidebar (Desktop) */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--accent-emerald);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text span {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition-smooth);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(90deg, var(--accent-emerald-glow), transparent);
    border-left: 3px solid var(--accent-emerald);
    font-weight: 600;
}

.nav-item.active i {
    color: var(--accent-emerald);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* Area Konten Utama */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    min-height: 100vh;
    padding: 32px;
    padding-bottom: 60px;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.farm-badge {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

.farm-badge i {
    width: 16px;
    height: 16px;
    color: var(--accent-emerald);
}

/* Bottom Nav (Mobile) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}

.bottom-nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-grow: 1;
    height: 100%;
    cursor: pointer;
}

.bottom-nav-item i {
    width: 20px;
    height: 20px;
}

.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--accent-emerald);
}

/* Tab Panel Switcher */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 3. KOMPONEN UMUM */
.dashboard-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-main);
    margin-bottom: 24px;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.margin-top-md { margin-top: 16px; }
.margin-top-lg { margin-top: 32px; }
.hide { display: none !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-bold { font-weight: 600 !important; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--accent-emerald);
    color: white;
    box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

.btn-primary:hover {
    background-color: var(--accent-emerald-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background-color: var(--accent-rose);
    color: white;
}

.btn-danger:hover {
    background-color: var(--accent-rose-hover);
}

.btn-emerald {
    background-color: var(--accent-emerald);
    color: white;
}

.btn-icon-only {
    padding: 8px;
    border-radius: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-emerald { background-color: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-blue { background-color: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.badge-amber { background-color: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-rose { background-color: rgba(244, 63, 94, 0.15); color: #f87171; }
.badge-warning { background-color: rgba(245, 158, 11, 0.2); color: #f59e0b; }

/* 4. TAB 1: DASBOR (DASHBOARD) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-main);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stat-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stat-icon i {
    width: 24px;
    height: 24px;
}

.icon-emerald { background-color: var(--accent-emerald-glow); color: var(--accent-emerald); }
.icon-blue { background-color: var(--accent-blue-glow); color: var(--accent-blue); }
.icon-amber { background-color: var(--accent-amber-glow); color: var(--accent-amber); }
.icon-rose { background-color: var(--accent-rose-glow); color: var(--accent-rose); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin: 2px 0;
}

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

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

.dashboard-grid-wide {
    display: grid;
    grid-template-columns: 1fr;
}

.chart-card {
    min-height: 320px;
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

/* Timeline/Reminders */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 12px;
    border-radius: 12px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.timeline-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.ind-emerald { background-color: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }
.ind-amber { background-color: var(--accent-amber); box-shadow: 0 0 8px var(--accent-amber); }
.ind-blue { background-color: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }

.timeline-content {
    flex-grow: 1;
}

.timeline-title {
    font-size: 14px;
    font-weight: 600;
}

.timeline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.timeline-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* 5. DATA TABLES (TABEL DATA) */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 380px;
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px 12px 44px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 3px var(--accent-emerald-glow);
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent-emerald);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.goat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.goat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
    background-color: var(--bg-tertiary);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.goat-avatar:hover {
    transform: scale(1.25);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-blue);
}

.goat-meta .goat-id {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.goat-meta .goat-nickname {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
}

.table-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
}

/* 6. TAB 3: BREEDING & GESTATION */
.breeding-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

.mating-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    flex-grow: 1;
    flex-basis: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--accent-emerald);
    box-shadow: 0 0 0 2px var(--accent-emerald-glow);
}

.form-control.read-only {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 12.5px;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.alert-warning i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.info-box-glass {
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: 14px;
}

.info-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.calc-box {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border-color);
}

.calc-result {
    margin-top: 16px;
    background-color: rgba(16, 185, 129, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.calc-date-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calc-date-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-emerald);
    margin: 4px 0;
}

.calc-countdown {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Kartu Kehamilan Aktif */
.pregnancy-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.pregnancy-card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

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

.preg-goat-name {
    font-size: 14px;
    font-weight: 600;
}

.preg-dates {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.preg-dates span strong {
    color: var(--text-primary);
}

.progress-container {
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    width: 100%;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-amber), var(--accent-emerald));
    border-radius: 3px;
    width: 0%;
}

.pregnancy-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.preg-countdown-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-amber);
}

/* 7. TAB 5: KEUANGAN (FINANCES) */
.fin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.fin-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-main);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fin-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.fin-value {
    font-size: 26px;
    font-weight: 700;
}

.card-total {
    border-left: 4px solid var(--accent-blue);
}

.card-total .fin-value {
    color: #60a5fa;
}

.card-income {
    border-left: 4px solid var(--accent-emerald);
}

.card-income .fin-value {
    color: #34d399;
}

.card-expense {
    border-left: 4px solid var(--accent-rose);
}

.card-expense .fin-value {
    color: #f87171;
}

.ledger-amount-income {
    color: #34d399;
    font-weight: 600;
}

.ledger-amount-expense {
    color: #f87171;
    font-weight: 600;
}

/* 8. MODAL WINDOWS & POPUPS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-wide {
    max-width: 800px;
}

@keyframes modalScaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 3px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Detail Modal Grid Layout */
.detail-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
}

.qr-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* QR Tag Physical Card Aesthetic */
.qr-tag {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-emerald);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-main);
}

.qr-tag-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.qr-tag-header img.qr-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--accent-emerald);
}

.qr-tag-header span {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-emerald);
}

.qr-tag-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.qr-code-placeholder {
    background-color: white;
    padding: 6px;
    border-radius: 8px;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-details {
    text-align: center;
}

.qr-details h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.qr-details p {
    font-size: 12px;
    color: var(--text-secondary);
}

.qr-gender {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 6px;
    color: var(--text-secondary);
}

.qr-tag-footer {
    width: 100%;
    text-align: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 8px;
    margin-top: 12px;
    font-size: 8px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.detail-info-pane {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.info-table {
    width: 100%;
}

.info-table th {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 6px 0;
    text-align: left;
    width: 40%;
}

.info-table td {
    font-size: 13px;
    color: var(--text-primary);
    padding: 6px 0;
}

/* Pedigree Visual Tree */
.pedigree-tree {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pedigree-node {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
}

.pedigree-label {
    font-size: 10px;
    color: var(--text-muted);
}

.pedigree-val {
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
}

/* History tabs inside detail */
.detail-history-tabs {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

.history-tab-headers {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.history-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition-smooth);
}

.history-tab-btn.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.history-pane {
    display: none;
    padding-top: 16px;
}

.history-pane.active {
    display: block;
}

.table-sm th {
    padding: 10px;
}

.table-sm td {
    padding: 10px;
    font-size: 12.5px;
}

/* Dinamis Kid Form */
.kid-form-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    background-color: var(--bg-primary);
}

.kid-form-card h5 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--accent-emerald);
    margin-bottom: 10px;
}

/* 9. MEDIA QUERIES & RESPONSIVITAS */

/* Tampilan Desktop Sedang ke Bawah */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Tampilan Tablet / Mobile */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }
    
    .bottom-nav {
        display: flex;
    }
    
    .top-header {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .header-actions {
        align-self: stretch;
        display: flex;
        justify-content: flex-end;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 16px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .stat-icon i {
        width: 18px;
        height: 18px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .breeding-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .qr-card-container {
        max-width: 280px;
        margin: 0 auto;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .filter-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    
    .btn {
        width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 10. CETAK KARTU / PRINTING STYLES */
@media print {
    body * {
        visibility: hidden;
    }
    body:not(.printing-invoice) #modal-goat-detail, 
    body:not(.printing-invoice) #modal-goat-detail * {
        visibility: visible;
    }
    body.printing-invoice #print-invoice-area,
    body.printing-invoice #print-invoice-area * {
        visibility: visible;
    }
    #modal-goat-detail {
        position: absolute;
        left: 0;
        top: 0;
        background: none;
        box-shadow: none;
        width: 100%;
    }
    .btn-close-modal, .btn-secondary, .detail-info-pane, .detail-history-tabs, .modal-header {
        display: none !important;
    }
    .detail-grid {
        grid-template-columns: 1fr;
        justify-content: center;
        align-items: center;
    }
    .qr-card-container {
        width: 80mm;
        height: 110mm;
        margin: 0 auto;
        page-break-inside: avoid;
    }
    .qr-tag {
        width: 80mm;
        height: 110mm;
        border: 2px solid #000 !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    .qr-tag-header span, .qr-tag-header i {
        color: black !important;
    }
    .qr-details h4, .qr-details p, .qr-gender {
        color: black !important;
        border-color: #ccc !important;
    }
}

/* Sub-Tabs Navigation for Keuangan */
.sub-tab-container {
    display: flex;
    gap: 12px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 24px;
}

.sub-tab-btn {
    background: none;
    border: none;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}

.sub-tab-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.sub-tab-btn.active {
    background-color: var(--accent-emerald);
    color: white;
}

.sub-panel {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.sub-panel.hide {
    display: none !important;
}

/* Invoice Print Styles */
#print-invoice-area {
    display: none;
}

@media print {
    body.printing-invoice #print-invoice-area {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background-color: #fff !important;
        color: #000 !important;
        padding: 30px;
    }
    
    .invoice-box {
        max-width: 800px;
        margin: 0 auto;
        padding: 30px;
        background-color: #fff !important;
        color: #000 !important;
        font-family: 'Outfit', sans-serif;
    }
    
    .invoice-header {
        display: flex;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
        text-align: left;
    }
    
    .invoice-logo {
        width: 70px;
        height: 70px;
        border-radius: 50%;
        object-fit: cover;
        border: 2px solid #0f172a !important;
        flex-shrink: 0;
    }
    
    .invoice-header-text {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .invoice-header h2 {
        font-size: 24px;
        color: #0f172a !important;
        margin: 0 0 3px 0;
        font-weight: 700;
        line-height: 1.2;
    }
    
    .invoice-header p {
        margin: 1px 0;
        font-size: 13px;
        color: #475569 !important;
        line-height: 1.3;
    }
    
    .invoice-divider {
        border: 0;
        border-top: 2px solid #0f172a !important;
        margin: 20px 0;
    }
    
    .invoice-title {
        text-align: center;
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 30px;
        letter-spacing: 1px;
        color: #000 !important;
    }
    
    .invoice-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 40px;
    }
    
    .invoice-table th, .invoice-table td {
        padding: 12px;
        text-align: left;
        font-size: 15px;
    }
    
    .invoice-table th {
        width: 200px;
        font-weight: 600;
        color: #475569 !important;
    }
    
    .invoice-table td {
        color: #0f172a !important;
        border-bottom: 1px dashed #cbd5e1 !important;
    }
    
    .amount-row td {
        border-bottom: 2px solid #0f172a !important;
    }
    
    .invoice-amount {
        font-size: 20px;
        font-weight: 700;
        color: #0f172a !important;
    }
    
    .invoice-signatures {
        display: flex;
        justify-content: space-between;
        margin-top: 60px;
    }
    
    .sig-block {
        text-align: center;
        width: 250px;
        color: #000 !important;
    }
    
    .sig-block p {
        margin: 5px 0;
        font-size: 14px;
    }
}

/* Pedigree Tree Styles */
.pedigree-tree-container {
    overflow-x: auto;
    padding: 20px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.01);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.pedigree-tree-2level {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px 0;
}

.pedigree-root-col {
    flex-shrink: 0;
    width: 220px;
    z-index: 2;
}

.pedigree-parents-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 240px;
    width: 220px;
    flex-shrink: 0;
    z-index: 2;
}

.pedigree-connectors {
    position: relative;
    width: 50px;
    height: 240px;
    flex-shrink: 0;
}

.pedigree-connectors::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 25px;
    height: 2px;
    background-color: var(--accent-emerald);
    transform: translateY(-50%);
}

.pedigree-connectors::after {
    content: '';
    position: absolute;
    top: 52px;
    bottom: 52px;
    left: 25px;
    width: 2px;
    background-color: var(--accent-emerald);
}

.connector-line-top {
    position: absolute;
    top: 52px;
    left: 25px;
    width: 25px;
    height: 2px;
    background-color: var(--accent-emerald);
}

.connector-line-bottom {
    position: absolute;
    bottom: 52px;
    left: 25px;
    width: 25px;
    height: 2px;
    background-color: var(--accent-emerald);
}

.pedigree-card {
    background-color: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pedigree-card:hover {
    border-color: var(--accent-emerald);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: var(--bg-tertiary);
}

.pedigree-card.selected-root {
    border-color: var(--accent-emerald);
    background: var(--bg-secondary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.pedigree-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.pedigree-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.pedigree-card-sub {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.pedigree-card.empty-node {
    border-style: dashed;
    border-color: rgba(0, 0, 0, 0.15);
    background-color: rgba(255, 255, 255, 0.02);
    cursor: default;
}

.pedigree-card.empty-node:hover {
    border-color: rgba(0, 0, 0, 0.15);
    transform: none;
    background-color: rgba(255, 255, 255, 0.02);
}

.pedigree-card.empty-node .pedigree-card-title {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 12px;
}

.pedigree-card-role {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
}

.role-root { background-color: var(--bg-tertiary); color: var(--accent-emerald); }
.role-sire { background-color: var(--accent-blue-glow); color: var(--accent-blue); }
.role-dam { background-color: var(--accent-rose-glow); color: var(--accent-rose); }

/* Pedigree Avatar Styles */
.pedigree-card-body-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.pedigree-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
    flex-shrink: 0;
}

.pedigree-avatar-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

.pedigree-card-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* 12. LOGIN SCREEN STYLES */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    background-image: radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.05) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.05) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.4s ease-out;
}

.login-box-glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-emerald);
    box-shadow: 0 8px 20px rgba(2, 132, 199, 0.15);
    margin-bottom: 5px;
}

.login-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.login-header p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Form Styling inside Login */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-with-icon .form-control {
    padding-left: 42px;
}

.login-error-msg {
    color: var(--accent-rose);
    background-color: var(--accent-rose-glow);
    border: 1px solid rgba(185, 28, 28, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

/* Logout Button Hover Effect */
.btn-logout:hover {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--accent-emerald) !important;
}


