/* ========================================
   KAS PAIBON - Main Stylesheet
   Dukuh Ambengan Bantang
   ======================================== */

:root {
    --primary-color: #1a5f2a;
    --primary-light: #2d8a42;
    --primary-dark: #0d3d18;
    --secondary-color: #f39c12;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --text-white: #ffffff;
    
    --bg-white: #ffffff;
    --bg-light: #f8f9fa;
    --bg-gray: #ecf0f1;
    --bg-dark: #2c3e50;
    
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background: linear-gradient(180deg, #eef6ee 0%, #e2efe2 100%);
    line-height: 1.6;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    background: linear-gradient(135deg, rgba(16, 61, 27, 0.98), rgba(26, 95, 42, 0.98));
    box-shadow: 0 10px 30px rgba(13, 61, 24, 0.22);
    border-bottom: 1px solid rgba(214, 239, 217, 0.16);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-white);
    cursor: pointer;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.8;
}

.nav-logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255,255,255,0.88);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-white);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-white);
    transition: var(--transition);
}

.navbar .btn-primary {
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.22);
}

.navbar .btn-primary:hover {
    background: rgba(255,255,255,0.24);
}

/* ========================================
   Buttons
   ======================================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: var(--text-white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    border: 2px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background: var(--primary-light);
}

.btn-success {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/ambengan.png') center/contain no-repeat;
    opacity: 0.05;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero .description {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-buttons .btn-secondary {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.hero-buttons .btn-secondary:hover {
    background: var(--primary-light);
    color: var(--text-white);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 4rem;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 150px;
    border: 1px solid rgba(255,255,255,0.2);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========================================
   Sections
   ======================================== */
.section {
    padding: 5rem 2rem;
}

.section-gray {
    background: linear-gradient(180deg, #eff7ef 0%, #e6f1e6 100%);
}

#galeri.section {
    background: linear-gradient(180deg, #1c6a2d 0%, #155122 100%);
}

#galeri .section-title {
    color: #f4fbf4;
}

.section-full {
    padding-left: 0;
    padding-right: 0;
}

.section-full .section-title {
    padding: 0 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 3rem;
}

/* ========================================
   Gallery Carousel
   ======================================== */
.gallery-carousel {
    position: relative;
    min-height: 460px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, rgba(26,95,42,0.92), rgba(13,61,24,0.96));
    width: 100%;
    border-radius: 0;
}

#galeri .gallery-carousel {
    box-shadow: 0 18px 40px rgba(6, 33, 12, 0.24);
}

.gallery-track {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    min-height: 460px;
    transition: transform 0.55s ease;
    will-change: transform;
}

.gallery-slide {
    position: relative;
    flex: 0 0 calc((100% - 1.5rem) / 2);
    min-height: 460px;
    border-radius: 28px;
    overflow: hidden;
    opacity: 0.72;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-slide.active,
.gallery-carousel.empty .gallery-slide {
    opacity: 1;
    transform: translateY(0);
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-slide.active img {
    animation: galleryZoom 4s ease-in-out infinite alternate;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 2rem 1rem 1rem;
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.gallery-slide:hover .gallery-overlay,
.gallery-slide.active .gallery-overlay {
    transform: translateY(0);
}

.gallery-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 999px;
    background: rgba(16, 61, 27, 0.38);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    z-index: 2;
}

.gallery-control:hover {
    background: rgba(16, 61, 27, 0.58);
}

.gallery-control.prev {
    left: 1rem;
}

.gallery-control.next {
    right: 1rem;
}

.gallery-dots {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 2;
}

.gallery-dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 999px;
    background: rgba(214,239,217,0.45);
    cursor: pointer;
    transition: var(--transition);
}

.gallery-dot.active {
    width: 32px;
    background: var(--text-white);
}

.gallery-empty-state {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 0 100%;
}

.gallery-empty-copy {
    max-width: 520px;
    padding: 2rem;
    text-align: center;
    color: var(--text-white);
}

.gallery-empty-copy h3 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.gallery-empty-copy p {
    opacity: 0.9;
}

.gallery-carousel.empty .gallery-control,
.gallery-carousel.empty .gallery-dots {
    display: none;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.gallery-placeholder span {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

@keyframes galleryZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.06);
    }
}

/* ========================================
   Category Grid
   ======================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.category-card.pemasukan {
    border-left-color: var(--success-color);
}

.category-card.pengeluaran {
    border-left-color: var(--danger-color);
}

.category-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.category-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.category-card.pemasukan .badge {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.category-card.pengeluaran .badge {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: linear-gradient(160deg, #103d1b 0%, #1a5f2a 100%);
    color: var(--text-white);
    padding: 2rem 2rem 1rem;
    border-top: 1px solid rgba(214, 239, 217, 0.1);
}

.footer-compact {
    padding: 1.25rem 0 0;
    margin-top: 2.5rem;
    background: transparent;
    border-top: 1px solid rgba(44, 62, 80, 0.08);
}

.footer-compact .footer-bottom {
    border-bottom: none;
    padding: 0.25rem 0 0;
    opacity: 1;
}

.footer-compact .footer-bottom p {
    font-size: 0.8rem;
    color: rgba(44, 62, 80, 0.6);
    letter-spacing: 0.01em;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin: 0;
}

.footer-brand p {
    opacity: 0.8;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #d6efd9;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #d6efd9;
}

.footer-contact p {
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    opacity: 0.82;
    font-size: 0.9rem;
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-page .login-container {
    flex: none;
    display: block;
    width: 100%;
    max-width: 450px;
}

.login-page .footer {
    width: 100%;
    max-width: 450px;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 1.5rem;
    text-align: center;
    border-radius: 8px;
}

.login-page .footer-content {
    display: none;
}

.login-page .footer-bottom {
    border-bottom: none;
    padding: 0;
}

.login-page .footer-bottom p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.login-page .login-container {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
}

.login-page .footer {
    width: 100%;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 2rem;
    text-align: center;
}

.login-page .footer-content {
    display: none;
}

.login-page .footer-bottom {
    border-bottom: none;
    padding: 0;
}

.login-page .footer-bottom p {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

.login-page .login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.login-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition);
    font-family: var(--font-family);
}

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

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    opacity: 0.6;
    transition: var(--transition);
}

.toggle-password:hover {
    opacity: 1;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-light);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.login-footer {
    text-align: center;
}

.back-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-color);
}

/* ========================================
   Dashboard Layout - Horizontal Navbar
   ======================================== */
.dashboard-page {
    padding-top: 60px;
}

.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.top-navbar .nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: white;
}

.top-navbar .nav-logo {
    height: 40px;
    width: auto;
}

.top-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    cursor: pointer;
}

.top-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: #fff;
    border-radius: 999px;
    transition: var(--transition);
}

.top-nav-toggle.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.top-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.top-nav-toggle.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu .menu-item {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-menu .menu-item:hover,
.nav-menu .menu-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.user-role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 1rem;
}

.user-role-badge.pembaca {
    background: var(--info-color);
    color: white;
}

.user-role-badge.admin {
    background: var(--warning-color);
    color: white;
}

.nav-menu .logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin-left: 0.5rem;
}

.nav-menu .logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    padding-top: 70px;
}

.sidebar {
    width: 280px;
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-navbar {
    display: none;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
}

.sidebar-navbar .nav-brand {
    color: white;
}

.sidebar-navbar .menu-toggle {
    display: none;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 0.5rem;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
}

.sidebar-header p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.user-info {
    padding: 1rem 1.5rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.user-role {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.user-role.admin {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.user-role.pembaca {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info-color);
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(26, 95, 42, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.menu-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.logout-btn:hover {
    background: var(--danger-color);
    color: white;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-light);
}

.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.overview-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    border-top: 4px solid var(--primary-color);
}

.overview-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.overview-card p {
    color: var(--text-light);
    font-size: 0.92rem;
}

.transaksi-overview {
    margin-bottom: 1rem;
}

.transaksi-stats-grid,
.transaksi-summary-grid {
    margin-bottom: 1rem;
}

.content-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.content-section-header h2 {
    font-size: 1.3rem;
    color: var(--text-dark);
}

.content-section-header p {
    color: var(--text-light);
    max-width: 640px;
    font-size: 0.95rem;
}

/* ========================================
   Stats Cards
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stats-icon.blue {
    background: rgba(52, 152, 219, 0.1);
}

.stats-icon.green {
    background: rgba(39, 174, 96, 0.1);
}

.stats-icon.red {
    background: rgba(231, 76, 60, 0.1);
}

.stats-icon.orange {
    background: rgba(243, 156, 18, 0.1);
}

.stats-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stats-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.action-buttons {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========================================
   Tables
   ======================================== */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 2rem;
}

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

.table-header h3 {
    font-size: 1.1rem;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    min-width: 200px;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: white;
}

.table-responsive {
    overflow-x: auto;
}

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

thead {
    background: var(--bg-light);
}

th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

tbody tr:hover {
    background: rgba(26, 95, 42, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

.tukang-group-row td {
    background: #eef7ef;
    color: #1a5f2a;
    font-weight: 700;
    border-top: 2px solid rgba(26, 95, 42, 0.18);
    border-bottom: 1px solid rgba(26, 95, 42, 0.12);
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

.tukang-data-row td {
    background: #fff;
}

.tukang-group-row:hover td,
.tukang-data-row:hover td {
    background: inherit;
}

.text-right {
    text-align: right;
}

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

.badge-sm {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-income {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.badge-expense {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.badge-code {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.badge-kategori {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-kategori.pemasukan {
    background: #d4edda;
    color: #155724;
}

.badge-kategori.pengeluaran {
    background: #fff3cd;
    color: #856404;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.text-success {
    color: #1f8b4c;
}

.text-danger {
    color: #b42318;
}

.header-pemasukan {
    background: #d4edda !important;
    color: #155724;
}

.header-pengeluaran {
    background: #fff3cd !important;
    color: #856404;
}

.cell-pengeluaran {
    background: #fff9e6;
}

.table-footer-total {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.table-footer-total td {
    padding: 12px;
}

.table-opening-balance {
    background: #eef7ef;
}

.table-opening-balance td {
    border-bottom: 1px solid rgba(26, 95, 42, 0.12);
    color: #23412b;
}

.table-opening-balance small {
    color: #5a6d60;
}

.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.pemasukan {
    background: #d4edda;
    border: 1px solid #28a745;
}

.legend-color.pengeluaran {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.btn-info {
    background: #3498db;
    color: white;
}

.btn-info:hover {
    background: #2980b9;
}

.kategori-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.kategori-section {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-section {
    margin-top: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.summary-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

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

.summary-item .label {
    color: #666;
}

.summary-item .value {
    font-weight: 600;
}

.summary-item.pemasukan .value {
    color: #27ae60;
}

.summary-item.pengeluaran .value {
    color: #e74c3c;
}

.btn-soft-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.btn-soft-warning:hover {
    background: #ffe69c;
}

.btn-soft-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn-soft-danger:hover {
    background: #f1aeb5;
}

/* ========================================
   Cards & Panels
   ======================================== */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

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

.card-header h3 {
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   Modal
   ======================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 1.5rem;
}

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

/* ========================================
   Form Styles
   ======================================== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ========================================
   Alert/Notification
   ======================================== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border-left: 4px solid var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    border-left: 4px solid var(--warning-color);
    color: var(--warning-color);
}

/* ========================================
   Empty State
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .navbar,
    .sidebar,
    .btn-primary,
    .table-actions,
    .logout-btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Footer di halaman login */
.login-page .footer {
    padding: 1rem 2rem;
}

.login-page .footer-content {
    display: none;
}

.login-page .footer-bottom {
    text-align: center;
    padding: 0;
    border-bottom: none;
}

.login-page .footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Admin Edit Konten Button */
.edit-konten-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.edit-konten-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.login-page .footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}
