/* Buku Tamu — Design System */
:root {
    --color-primary: #065f46;
    --color-primary-light: #047857;
    --color-primary-dark: #064e3b;
    --color-accent: #d97706;
    --color-accent-light: #fbbf24;
    --color-surface: #ffffff;
    --color-bg: #f0fdf4;
    --shadow-card: 0 4px 24px -4px rgba(6, 95, 70, 0.12), 0 2px 8px -2px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 50px -12px rgba(6, 95, 70, 0.2);
}

* { -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--color-bg);
}

.font-display { font-family: 'Playfair Display', serif; }

/* Islamic geometric pattern background */
.bg-pattern {
    background-color: #ecfdf5;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(6, 95, 70, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(217, 119, 6, 0.05) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23047857' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.bg-hero {
    background: linear-gradient(135deg, #064e3b 0%, #047857 40%, #065f46 100%);
    position: relative;
    overflow: hidden;
}

.bg-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40z'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.8;
}

.bg-hero::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60'%3E%3Cpath fill='%23ecfdf5' d='M0,32 C360,60 720,0 1080,32 C1260,48 1380,40 1440,32 L1440,60 L0,60 Z'/%3E%3C/svg%3E") bottom center / cover no-repeat;
}

/* Cards */
.card {
    background: var(--color-surface);
    border-radius: 1.25rem;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(6, 95, 70, 0.08);
}

.card-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* Form inputs */
.input-field {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.875rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    background: #fafafa;
}

.input-field:focus {
    outline: none;
    border-color: var(--color-primary-light);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}

.input-wrap { position: relative; }
.input-wrap .input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.input-field.no-icon { padding-left: 1rem; }

/* Purpose cards */
.purpose-card {
    position: relative;
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    transition: all 0.2s ease;
    background: #fff;
}

.purpose-card:hover:not(.disabled) {
    border-color: #a7f3d0;
    background: #f0fdf4;
    transform: translateY(-1px);
}

.purpose-card.selected {
    border-color: var(--color-primary-light);
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.15);
}

.purpose-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.purpose-card input { position: absolute; opacity: 0; pointer-events: none; }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #047857, #065f46);
    color: white;
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.4);
}

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

.btn-gold {
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

/* Status pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Ticket */
.ticket-card {
    background: #fff;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.ticket-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #047857, #d97706, #047857);
}

.ticket-perforation {
    position: relative;
    margin: 1.5rem 0;
}

.ticket-perforation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -12px;
    width: 24px;
    height: 24px;
    background: #ecfdf5;
    border-radius: 50%;
    transform: translateY(-50%);
}

.ticket-perforation::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -12px;
    width: 24px;
    height: 24px;
    background: #ecfdf5;
    border-radius: 50%;
    transform: translateY(-50%);
}

.ticket-perforation-line {
    border-top: 2px dashed #d1d5db;
    margin: 0 1rem;
}

/* Admin sidebar */
.sidebar {
    background: linear-gradient(180deg, #064e3b 0%, #065f46 100%);
    min-height: 100vh;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.stat-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(6,95,70,0.08);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.animate-fade-up { animation: fadeUp 0.4s ease forwards; }
.animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.1s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.15s; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
    .animate-fade-up, .animate-delay-1, .animate-delay-2, .animate-delay-3 {
        animation: none !important;
        opacity: 1 !important;
    }
    .live-dot { animation: none; }
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 3s ease-in-out infinite;
}

/* Section header */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.section-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #047857, #065f46);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Table */
.table-modern thead th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.875rem 1rem;
    background: #f9fafb;
}

.table-modern tbody td {
    padding: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.table-modern tbody tr:hover { background: #f0fdf4; }

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    font-weight: 700;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Login split */
.login-brand {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #065f46 100%);
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 0 L100 50 L50 100 L0 50 Z' fill='none' stroke='%23ffffff' stroke-opacity='0.06' stroke-width='1'/%3E%3C/svg%3E");
}

/* Queue card ndalem */
.queue-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s;
}

.queue-card:hover {
    border-color: #a7f3d0;
    box-shadow: var(--shadow-card);
}

.queue-number {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #047857, #065f46);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.125rem;
    box-shadow: 0 4px 12px rgba(4,120,87,0.3);
}

/* Status control buttons */
.status-btn {
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.25rem;
    text-align: left;
    transition: all 0.2s;
    cursor: pointer;
    background: #fff;
}

.status-btn:hover { border-color: #d1d5db; transform: translateY(-2px); }
.status-btn.active-available { border-color: #22c55e; background: #f0fdf4; }
.status-btn.active-busy { border-color: #eab308; background: #fefce8; }
.status-btn.active-closed { border-color: #ef4444; background: #fef2f2; }

@media print { .no-print { display: none !important; } }

/* Logo pesantren — tampil penuh, proporsi asli */
.pesantren-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
}
.pesantren-logo--sm { max-height: 2.25rem; max-width: 4rem; }
.pesantren-logo--md { max-height: 3rem; max-width: 5.5rem; }
.pesantren-logo--lg { max-height: 3.5rem; max-width: 6.5rem; }
.pesantren-logo--xl { max-height: 3.25rem; max-width: 6rem; }
.pesantren-logo--hero { max-height: 3.75rem; max-width: 7.5rem; }

/* Logo di poster / cetak QR */
.qr-poster-brand .pesantren-logo {
    max-height: 3rem;
    max-width: 5.5rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
