/* ======================================================================
   styles.css – Semua CSS custom (non‑Tailwind) + ENHANCEMENTS
   ====================================================================== */

/* Animasi & efek */
.animate-toast {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Utility tambahan (dulu @apply di Tailwind) */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.table-modern {
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.table-modern > * + * {
    border-top-width: 1px;
    border-top-color: #e2e8f0;
}
html.dark .table-modern > * + * {
    border-top-color: #1e293b;
}
.table-modern thead {
    background-color: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
}
html.dark .table-modern thead {
    background-color: rgba(30, 41, 59, 0.5);
}
.table-modern th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    color: #64748b;
}
html.dark .table-modern th {
    color: #94a3b8;
}
.table-modern tbody {
    background-color: #ffffff;
    border-top-width: 1px;
    border-top-color: #f1f5f9;
}
html.dark .table-modern tbody {
    background-color: transparent;
    border-top-color: rgba(30, 41, 59, 0.5);
}
.table-modern tbody > * + * {
    border-top-width: 1px;
    border-top-color: #f1f5f9;
}
html.dark .table-modern tbody > * + * {
    border-top-color: rgba(30, 41, 59, 0.5);
}
.table-modern td {
    padding: 0.75rem 1rem;
    white-space: nowrap;
    color: #334155;
    transition: color 0.15s, background-color 0.15s;
}
html.dark .table-modern td {
    color: #cbd5e1;
}
.table-modern tbody tr:hover {
    background-color: rgba(241, 245, 249, 0.8);
}
html.dark .table-modern tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.4);
}

.input-modern {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    border-width: 1px;
    border-color: #e2e8f0;
    background-color: #ffffff;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #0f172a;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.input-modern::placeholder {
    color: #94a3b8;
}
.input-modern:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.input-modern:disabled {
    cursor: not-allowed;
    background-color: #f8fafc;
}
html.dark .input-modern {
    border-color: #334155;
    background-color: #0f172a;
    color: #f1f5f9;
}

.input-kirim {
    text-align: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: #047857;
    border-color: #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.15s;
    height: 3rem;
}
html.dark .input-kirim {
    color: #34d399;
}
.input-kirim:hover {
    background-color: #ffffff;
}
.input-kirim:focus {
    background-color: #ffffff;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}
@media (min-width: 768px) {
    .input-kirim {
        font-size: 1.25rem;
    }
}

.input-retur {
    text-align: center;
    font-weight: 700;
    font-size: 1.125rem;
    color: #b91c1c;
    border-color: #e2e8f0;
    background-color: #f8fafc;
    transition: all 0.15s;
    height: 3rem;
}
html.dark .input-retur {
    color: #f87171;
}
.input-retur:hover {
    background-color: #ffffff;
}
.input-retur:focus {
    background-color: #ffffff;
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}
@media (min-width: 768px) {
    .input-retur {
        font-size: 1.25rem;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(255, 255, 255, 0.2);
}
.btn:active {
    transform: scale(0.98);
}
html.dark .btn:focus {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: #0f172a;
    color: #ffffff;
}
.btn-primary:hover {
    background-color: #1e293b;
}
.btn-primary:focus {
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px rgba(15, 23, 42, 0.2);
}
html.dark .btn-primary {
    background-color: #ffffff;
    color: #0f172a;
}
html.dark .btn-primary:hover {
    background-color: #f1f5f9;
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
}
.btn-secondary:hover {
    background-color: #f8fafc;
}
.btn-secondary:focus {
    box-shadow: 0 0 0 2px #e2e8f0, 0 0 0 4px rgba(226, 232, 240, 0.2);
}
html.dark .btn-secondary {
    background-color: #1e293b;
    border-color: #334155;
    color: #cbd5e1;
}
html.dark .btn-secondary:hover {
    background-color: #334155;
}

.btn-success {
    background-color: #059669;
    color: #ffffff;
}
.btn-success:hover {
    background-color: #047857;
}
.btn-success:focus {
    box-shadow: 0 0 0 2px #059669, 0 0 0 4px rgba(5, 150, 105, 0.2);
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #b91c1c;
}
.btn-danger:focus {
    box-shadow: 0 0 0 2px #dc2626, 0 0 0 4px rgba(220, 38, 38, 0.2);
}

.btn-warning {
    background-color: #f59e0b;
    color: #ffffff;
}
.btn-warning:hover {
    background-color: #d97706;
}
.btn-warning:focus {
    box-shadow: 0 0 0 2px #f59e0b, 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.card-modern {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}
.card-modern:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}
html.dark .card-modern {
    background-color: #0f172a;
    border-color: #1e293b;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
html.dark .card-header {
    border-bottom-color: #1e293b;
}

.card-body {
    padding: 1.5rem;
}

/* Zebra untuk laporan */
.zebra tbody tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.5);
}
html.dark .zebra tbody tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.3);
}

/* Print Styles */
@media print {
    aside, header, footer, .no-print { display: none !important; }
    main { padding: 0 !important; margin: 0 !important; background: white !important; }
    .card-modern { border: none !important; box-shadow: none !important; }
    .table-modern { width: 100% !important; border-collapse: collapse !important; }
    .table-modern th, .table-modern td { border: 1px solid #e2e8f0 !important; padding: 6px !important; color: #000 !important; }
}

.sticky-header thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

/* ======================================================================
   ENHANCEMENTS – UI/UX Modern (ditambahkan)
   ====================================================================== */

/* ----- RIPPLE EFFECT ----- */
.ripple {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.ripple .ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-anim 0.6s linear;
    pointer-events: none;
}
@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
html.dark .ripple .ripple-effect {
    background: rgba(255, 255, 255, 0.2);
}

/* ----- FLOATING ACTION BUTTON (FAB) ----- */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background-color: #0f172a;
    color: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.fab:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.4);
}
.fab:active {
    transform: scale(0.94);
}
html.dark .fab {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}
html.dark .fab:hover {
    box-shadow: 0 8px 28px rgba(255, 255, 255, 0.2);
}

/* ----- MODAL ENHANCEMENT ----- */
.modal-overlay {
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
html.dark .modal-overlay {
    background-color: rgba(15, 23, 42, 0.7);
}
.modal-box {
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transform-origin: center;
}
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
.modal-box.closing {
    animation: modalOut 0.2s ease-in forwards;
}
@keyframes modalOut {
    to {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }
}

/* ----- TOAST ENHANCEMENT ----- */
.toast {
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.closing {
    animation: slideDown 0.25s ease-in forwards;
}
@keyframes slideDown {
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ----- CARD HOVER ----- */
.card-modern {
    transition: transform 0.2s ease, box-shadow 0.25s ease;
}
.card-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08), 0 4px 8px -2px rgba(0, 0, 0, 0.03);
}
html.dark .card-modern:hover {
    box-shadow: 0 12px 24px -8px rgba(255, 255, 255, 0.04), 0 4px 8px -2px rgba(0, 0, 0, 0.4);
}

/* ----- BUTTON HOVER & FOCUS ----- */
.btn {
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.btn:active:not(:disabled) {
    transform: scale(0.96);
}
.btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
html.dark .btn:focus-visible {
    outline-color: #60a5fa;
}

/* ----- INPUT FOCUS ----- */
.input-modern:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}
html.dark .input-modern:focus-visible {
    outline-color: #60a5fa;
}

/* ----- RESPONSIVE FAB ----- */
@media (max-width: 640px) {
    .fab {
        bottom: 20px;
        right: 20px;
        width: 52px;
        height: 52px;
        border-radius: 26px;
        font-size: 22px;
    }
    /* tambahkan safe area untuk notched phone */
    @supports (padding: max(0px)) {
        .fab {
            bottom: max(20px, env(safe-area-inset-bottom, 20px));
            right: max(20px, env(safe-area-inset-right, 20px));
        }
    }
}

/* ----- EMPTY STATE ----- */
.empty-state-icon {
    color: #94a3b8;
}
html.dark .empty-state-icon {
    color: #475569;
}