/* =========================
   1. IMPORT FONT AWESOME
   (Agar icon di JS berfungsi)
   ========================= */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* =========================
   RESET & BASE
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background: #f4f6f9;
    color: #333;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   LAYOUT
   ========================= */
.container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}

/* =========================
   HERO / HEADER
   ========================= */
.hero {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    padding: 45px 30px;
    border-radius: 14px;
    margin-bottom: 35px;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.text-muted {
    color: #dbeafe;
    font-size: 14px;
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.service-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.service-card h3 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #0f172a;
}

.service-card ul {
    list-style: none;
}

.service-card ul li {
    margin-bottom: 8px;
}

.service-card ul li a {
    font-size: 14px;
    color: #2563eb;
}

.service-card ul li a:hover {
    text-decoration: underline;
}

.login-link {
    margin-top: 40px;
    text-align: center;
}

.login-link a {
    font-size: 14px;
    color: #475569;
}

.login-link a:hover {
    color: #0f172a;
}

/* =========================
   STATUS BADGE
   ========================= */
.header-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Pulse Online */
.pulse-login {
    background: #f0fdf4;
    color: #166534;
    animation: pulseLogin 2.2s ease-in-out infinite;
}

@keyframes pulseLogin {
    0% {
        box-shadow: 0 0 0 0 rgba(34,197,94,0.5);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(34,197,94,0);
        opacity: 0.85;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34,197,94,0);
        opacity: 1;
    }
}

/* =========================
   MODULE GRID
   ========================= */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.module-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: inherit;
    transition: all 0.25s ease;
}

.module-card:hover {
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.module-title {
    font-weight: 700;
    font-size: 16px;
}

.module-desc {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.module-arrow {
    font-size: 18px;
    color: #9ca3af;
}

/* =========================
   ADMIN GRID
   ========================= */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.admin-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: inherit;
    transition: all 0.25s ease;
}

.admin-card:hover {
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.admin-title {
    font-weight: 600;
}

.admin-desc {
    font-size: 13px;
    color: #6b7280;
}

/* =========================
   MODULE NAV (PER MODULE)
   ========================= */
.module-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e5e7eb;
}

.module-nav a {
    padding: 10px 15px;
    font-size: 14px;
    color: #475569;
    border-bottom: 3px solid transparent;
}

.module-nav a.active,
.module-nav a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 600;
}

/* =========================
   WIDGET (DASHBOARD)
   ========================= */
.widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.widget {
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.widget h3 {
    font-size: 14px;
    color: #64748b;
}

.widget .value {
    font-size: 28px;
    margin-top: 8px;
    color: #0f172a;
}

/* =========================
   TABLE (SAFE GLOBAL)
   ========================= */
  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;   /* slate-200 */
    border-radius: 0.5rem;      /* rounded-lg */
    background: #ffffff;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    color: #0f172a; /* slate-900 */
}

.table th,
.table td {
    padding: 0.75rem 1rem;      /* py-3 px-4 */
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    vertical-align: middle;
}

.table th {
    background: #f8fafc;        /* slate-50 */
    font-weight: 600;
    text-align: left;           /* Tailwind default */
    color: #334155;             /* slate-700 */
}

.table td {
    color: #0f172a;
}

.table tbody tr:hover {
    background: #f1f5f9;        /* slate-100 */
}

/* Hilangkan border bawah baris terakhir */
.table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================
   FORM
   ========================= */
input,
select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5f5;
    margin-bottom: 12px;
}

button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
}

button:hover {
    background: #1d4ed8;
}

/* =========================
   BADGE
   ========================= */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================
   TOAST
   ========================= */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 260px;
    padding: 14px 18px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    z-index: 9999;
    animation: slideIn 0.4s ease;
}

.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info    { background: #2563eb; }

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

/* =========================
   LOGOUT
   ========================= */
.logout-wrap {
    text-align: center;
    margin-top: 25px;
}

.logout-link {
    color: #dc2626;
    font-weight: 600;
}

.logout-link:hover {
    text-decoration: underline;
}
/* =========================
   QR CODE (PUBLIC REQUEST)
   ========================= */
.qr-code {
    width: 28px;
    height: 28px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border-radius: 0px;
    cursor: pointer;
}

.qr-code:hover {
    transform: scale(2.2);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    z-index: 20;
    position: relative;
}
/* =========================
   REQUEST PREVIEW TOOLTIP
   ========================= */
.req-preview {
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
}

.req-tooltip {
    position: absolute;
    background: #ffffff;
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 220px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.18);
    font-size: 13px;
    z-index: 999;
    animation: fadeIn 0.15s ease;
}

.req-tooltip strong {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
}

.req-tooltip .row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #475569;
}

.req-tooltip .status {
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* =========================
   STATUS BADGE (GLOBAL)
   ========================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

/* DOT */
.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* STATUS VARIANT */
.status-new {
    background: #eff6ff;
    color: #1d4ed8;
}
.status-new::before {
    background: #2563eb;
}

.status-approved {
    background: #f0fdf4;
    color: #166534;
}
.status-approved::before {
    background: #22c55e;
}

.status-rejected {
    background: #fef2f2;
    color: #991b1b;
}
.status-rejected::before {
    background: #ef4444;
}

/* OPTIONAL: subtle pulse for NEW */
.status-new.pulse {
    animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
    0%   { box-shadow: 0 0 0 0 rgba(37,99,235,0.35); }
    70%  { box-shadow: 0 0 0 6px rgba(37,99,235,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
/* =========================
   BUTTON SYSTEM (GLOBAL)
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

/* PRIMARY */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(37,99,235,0.45);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(37,99,235,0.35);
}

/* SECONDARY */
.btn-secondary {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* SUCCESS */
.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(22,163,74,0.35);
}

/* DANGER */
.btn-danger {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #ffffff;
}

/* ICON STYLE */
.btn-icon {
    font-size: 18px;
    line-height: 1;
}

/* CENTER WRAP */
.btn-center {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}
/* =========================
   BUTTON SIZE VARIANT
   ========================= */

/* SMALL */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* NORMAL (DEFAULT) */
.btn-md {
    padding: 10px 18px;
    font-size: 14px;
    border-radius: 10px;
}

/* LARGE */
.btn-lg {
    padding: 14px 26px;
    font-size: 16px;
    border-radius: 14px;
}

/* FULL WIDTH (MOBILE / CTA) */
.btn-block {
    width: 100%;
    justify-content: center;
}
