/* ===== AutoTemplate Custom Styles ===== */

:root {
    --primary: #0f766e;
    --primary-hover: #0b5f58;
    --primary-light: #ccfbf1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e2e8f0;
    --gradient: linear-gradient(135deg, #0f766e 0%, #0891b2 100%);
    --gradient-dark: linear-gradient(135deg, #115e59 0%, #0e7490 100%);
    --shadow: 0 10px 30px rgba(2, 44, 34, 0.08);
    --shadow-lg: 0 18px 52px rgba(2, 44, 34, 0.14);
    --radius: 1rem;
}

/* ===== Global ===== */
body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 5% 0%, rgba(15, 118, 110, 0.09), transparent 35%),
        radial-gradient(circle at 95% 10%, rgba(8, 145, 178, 0.08), transparent 30%),
        #f2f6f9;
    min-height: 100vh;
}

a { text-decoration: none; }

.app-body,
.guest-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    flex: 1;
}

.content-shell {
    border-radius: 1.25rem;
}

.guest-main {
    min-height: calc(100vh - 180px);
}

.auth-body {
    background:
        radial-gradient(circle at 0% 0%, rgba(15, 118, 110, 0.15), transparent 38%),
        radial-gradient(circle at 100% 0%, rgba(8, 145, 178, 0.12), transparent 40%),
        linear-gradient(180deg, #ecfeff 0%, #f8fafc 45%, #f8fafc 100%);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: clamp(1.4rem, 2.2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.panel {
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.metric-card {
    border-radius: 1rem;
    padding: 1.1rem;
    color: #fff;
    background: var(--gradient);
    box-shadow: var(--shadow);
    height: 100%;
}

.metric-card.soft {
    background: linear-gradient(135deg, #0f766e 0%, #0ea5a5 100%);
}

.metric-card.alt {
    background: linear-gradient(135deg, #0e7490 0%, #2563eb 100%);
}

.metric-card.warn {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
}

.metric-value {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
}

.metric-label {
    font-size: .86rem;
    opacity: .9;
}

.icon-badge {
    width: 46px;
    height: 46px;
    border-radius: .8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.28);
}

.action-tile {
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 1px solid rgba(226,232,240,.9);
    background: #fff;
    border-radius: .9rem;
    padding: .85rem 1rem;
    color: inherit;
    transition: all .2s ease;
}

.action-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(15,118,110,.25);
    color: var(--primary);
}

.action-tile .at-icon {
    width: 36px;
    height: 36px;
    border-radius: .6rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== Primary Color Overrides ===== */
.bg-primary-custom { background: var(--gradient) !important; }
.text-primary-custom { color: var(--primary) !important; }
.border-primary-custom { border-color: var(--primary) !important; }

.btn-primary-custom {
    background: var(--gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.56rem 1.3rem;
    transition: all 0.22s ease;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.28);
}
.btn-primary-custom:hover {
    background: var(--gradient-dark);
    color: #fff;
    box-shadow: 0 14px 30px rgba(15, 118, 110, 0.32);
    transform: translateY(-1px);
}
.btn-primary-custom:active {
    transform: translateY(0);
}

.btn-outline-primary-custom {
    color: var(--primary);
    border: 2px solid var(--primary);
    background: transparent;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}
.btn-outline-primary-custom:hover {
    background: var(--primary);
    color: #fff;
}

.btn {
    border-radius: 0.7rem;
}

/* ===== Navbar ===== */
.navbar-custom {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: all 0.3s;
}
.navbar-custom.scrolled {
    background: rgba(255,255,255,0.94);
    box-shadow: 0 8px 26px rgba(15, 23, 42, 0.1);
}
.navbar-custom .navbar-brand {
    font-weight: 700;
    color: #0f172a;
}
.navbar-custom .nav-link {
    font-weight: 600;
    color: #374151;
    border-radius: 0.7rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--primary);
    background: rgba(15, 118, 110, 0.12);
}

/* ===== Cards ===== */
.card {
    border: 1px solid rgba(203, 213, 225, 0.8);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(2px);
    border-radius: var(--radius);
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient);
}

/* ===== Table ===== */
.table > thead {
    background: #f8fafc;
}
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    white-space: nowrap;
}

.table {
    --bs-table-bg: transparent;
}

.table td,
.table th {
    border-color: rgba(226, 232, 240, 0.8);
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background: rgba(15, 118, 110, 0.05);
}

/* ===== Badges ===== */
.badge-admin {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    font-weight: 600;
}
.badge-user {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-weight: 600;
}

/* ===== Hero Section (Beranda) ===== */
.hero-section {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--gradient);
}
.hero-section .hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
}
.hero-section .hero-content {
    position: relative;
    z-index: 2;
}

/* ===== Stats Bar ===== */
.stats-bar {
    margin-top: -3rem;
    position: relative;
    z-index: 10;
}
.stats-bar .card {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ===== Feature Cards ===== */
.feature-card {
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #fff;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.feature-card .feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== Scroll Animations ===== */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.animate-on-scroll.animated {
    opacity: 1;
}

/* Fade In */
.fade-in { transform: translateY(30px); }
.fade-in.animated { transform: translateY(0); }

/* Slide Up */
.slide-up { transform: translateY(60px); }
.slide-up.animated { transform: translateY(0); }

/* Slide Left */
.slide-left { transform: translateX(-40px); }
.slide-left.animated { transform: translateX(0); }

/* Slide Right */
.slide-right { transform: translateX(40px); }
.slide-right.animated { transform: translateX(0); }

/* Zoom In */
.zoom-in { transform: scale(0.85); }
.zoom-in.animated { transform: scale(1); }

/* Staggered children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }

/* ===== Sidebar Active State ===== */
.sidebar .nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid var(--primary);
}

/* ===== Quick Action Cards ===== */
.quick-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s;
    color: inherit;
}
.quick-action:hover {
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    transform: translateX(4px);
    box-shadow: var(--shadow);
}
.quick-action .icon {
    width: 42px;
    height: 42px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary);
    flex-shrink: 0;
}

/* ===== Form Styles ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.form-control,
.form-select {
    border: 1px solid var(--border);
    border-radius: 0.7rem;
    min-height: 44px;
}

textarea.form-control {
    min-height: 120px;
}

/* ===== Password Toggle ===== */
.password-toggle {
    position: relative;
}
.password-toggle .toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    z-index: 5;
}

/* ===== Foto Gallery ===== */
.foto-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}
.foto-gallery .foto-item {
    position: relative;
    border-radius: 0.75rem;
    overflow: hidden;
    aspect-ratio: 1;
}
.foto-gallery .foto-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.foto-gallery .foto-item:hover img {
    transform: scale(1.05);
}
.foto-gallery .foto-item .foto-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.foto-gallery .foto-item:hover .foto-overlay {
    opacity: 1;
}

/* ===== Empty State ===== */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}
.empty-state .icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

/* ===== Footer ===== */
.footer-custom {
    background: #0f172a;
    color: #cbd5e1;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem 0;
    font-size: 0.875rem;
}

/* ===== Guest Navbar ===== */
.navbar-guest {
    background: rgba(15, 23, 42, 0.22) !important;
    backdrop-filter: blur(12px);
    transition: all 0.3s;
}
.navbar-guest.scrolled {
    background: rgba(255,255,255,0.93) !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.navbar-guest .nav-link {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}
.navbar-guest.scrolled .nav-link {
    color: #374151;
}
.navbar-guest .navbar-brand {
    color: #fff;
    font-weight: 700;
}
.navbar-guest.scrolled .navbar-brand {
    color: var(--primary);
}

/* ===== Drag & Drop Sortable ===== */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
}
.sortable-drag {
    box-shadow: var(--shadow-lg);
}
.drag-handle {
    cursor: grab;
    color: #94a3b8;
}
.drag-handle:active {
    cursor: grabbing;
}

/* ===== Alert Custom ===== */
.alert-dismissible {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.85rem;
    font-weight: 500;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.dropdown-menu {
    border-color: rgba(226, 232, 240, 0.9);
}

.dropdown-item {
    border-radius: 0.6rem;
    padding: 0.5rem 0.7rem;
}

.dropdown-item:hover {
    background: rgba(15, 118, 110, 0.1);
}

.hero-modern {
    position: relative;
    border-radius: 1.25rem;
    padding: clamp(1.5rem, 3vw, 2.3rem);
    background: linear-gradient(140deg, rgba(15,118,110,0.12), rgba(8,145,178,0.12));
    border: 1px solid rgba(15,118,110,.18);
    overflow: hidden;
}

.hero-modern::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    right: -90px;
    top: -140px;
    background: radial-gradient(circle, rgba(15,118,110,.2), transparent 70%);
    pointer-events: none;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section { min-height: 380px; }
    .hero-section h1 { font-size: 1.75rem; }
    .stats-bar { margin-top: -2rem; }
    .foto-gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 576px) {
    .btn-group-responsive {
        flex-direction: column;
    }
    .btn-group-responsive .btn {
        border-radius: 0.5rem !important;
        margin-bottom: 0.25rem;
    }
}

/* ===== Print ===== */
@media print {
    .navbar, .footer-custom, .btn, .no-print { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}
