/* ============================================
   admin.css — Admin panel styles
   ============================================ */

/* ---- Main ---- */
.adm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1.25rem 3rem;
    min-height: calc(100vh - 68px);
}

/* ---- Login Card ---- */
.adm-login-card {
    background: rgba(255,255,255,0.97);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.09);
    padding: 3rem 2rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    margin-top: 2rem;
    animation: adm-fadeUp 0.4s ease both;
}

.adm-login-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(224,36,64,0.1), rgba(224,36,64,0.04));
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.adm-login-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-ink);
    margin: 0 0 0.5rem;
}

.adm-login-desc {
    font-size: 0.9rem;
    color: var(--color-ink-muted);
    margin: 0 0 1.75rem;
    line-height: 1.6;
}

.adm-login-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    border-radius: 12px;
}

.adm-login-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
}

/* ---- Dashboard Wrapper ---- */
.adm-dashboard {
    width: 100%;
    max-width: 1100px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    animation: adm-fadeUp 0.4s ease both;
}

/* ---- Stats Row ---- */
.adm-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.adm-stat-card {
    background: rgba(255,255,255,0.97);
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
}

.adm-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.adm-stat-pending .adm-stat-icon  { background: #fef9c3; color: #854d0e; }
.adm-stat-approved .adm-stat-icon { background: #dcfce7; color: #166534; }
.adm-stat-rejected .adm-stat-icon { background: #fee2e2; color: #991b1b; }

.adm-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-ink);
    line-height: 1;
}

.adm-stat-label {
    font-size: 0.78rem;
    color: var(--color-ink-muted);
    font-weight: 500;
    margin-top: 0.2rem;
}

/* ---- Panel ---- */
.adm-panel {
    background: rgba(255,255,255,0.97);
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
    border: 1px solid rgba(255,255,255,0.8);
    overflow: hidden;
}

.adm-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    gap: 0.75rem;
}

/* ---- Tabs ---- */
.adm-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.adm-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.adm-tab:hover {
    background: rgba(0,0,0,0.04);
    color: var(--color-ink);
}

.adm-tab.active {
    background: rgba(224,36,64,0.08);
    color: var(--color-primary);
}

.adm-tab-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.adm-dot-pending  { background: #eab308; }
.adm-dot-approved { background: #10b981; }
.adm-dot-rejected { background: #ef4444; }

/* ---- Refresh Button ---- */
.adm-refresh-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    background: #f8fafc;
    color: var(--color-ink-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.adm-refresh-btn:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ---- Loading ---- */
.adm-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    color: var(--color-ink-muted);
    font-size: 0.9rem;
}

.adm-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(224,36,64,0.15);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: adm-spin 0.7s linear infinite;
}

@keyframes adm-spin { to { transform: rotate(360deg); } }

/* ---- Mobile Card List ---- */
.adm-card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.adm-booking-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.15s;
    position: relative;
}

.adm-booking-card:last-child {
    border-bottom: none;
}

.adm-booking-card:hover {
    background: #fafafa;
}

.adm-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.adm-card-room {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-ink);
    flex: 1;
    min-width: 0;
}

.adm-card-purpose {
    font-size: 0.8rem;
    color: var(--color-ink-muted);
    margin-top: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.adm-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: var(--color-ink-muted);
}

.adm-card-meta-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.adm-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* ---- Badges ---- */
.adm-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.adm-badge-pending  { background: #fef9c3; color: #854d0e; }
.adm-badge-approved { background: #dcfce7; color: #166534; }
.adm-badge-rejected { background: #fee2e2; color: #991b1b; }

/* ---- Action Buttons ---- */
.adm-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.adm-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.85rem;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.adm-btn-approve { background: #dcfce7; color: #166534; }
.adm-btn-approve:hover { background: #10b981; color: white; }

.adm-btn-reject  { background: #fee2e2; color: #991b1b; }
.adm-btn-reject:hover  { background: #ef4444; color: white; }

.adm-btn-edit    { background: #dbeafe; color: #1e40af; }
.adm-btn-edit:hover    { background: #3b82f6; color: white; }

.adm-btn-cancel  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.adm-btn-cancel:hover  { background: #ef4444; color: white; border-color: #ef4444; }

/* ---- Empty State ---- */
.adm-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3.5rem 1rem;
    color: rgba(0,0,0,0.2);
    text-align: center;
}

.adm-empty p {
    font-size: 0.9rem;
    color: var(--color-ink-muted);
}

/* ---- Desktop Table (hidden on mobile) ---- */
.adm-table-wrap {
    overflow-x: auto;
}

.adm-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 0.875rem;
}

.adm-table-wrap th {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    color: var(--color-ink-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-align: left;
    white-space: nowrap;
}

.adm-table-wrap td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    vertical-align: middle;
    color: var(--color-ink);
}

.adm-table-wrap tr:last-child td { border-bottom: none; }
.adm-table-wrap tr:hover td { background: #fafafa; }

/* ---- Timestamp ---- */
.adm-ts {
    font-size: 0.78rem;
    color: var(--color-ink-muted);
}

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

/* ============================================
   Responsive
   ============================================ */
/* Mobile: show card list, hide table */
@media (max-width: 768px) {
    .adm-main {
        padding: 1rem 0.75rem 2.5rem;
    }

    .adm-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .adm-stat-card {
        padding: 0.85rem 0.75rem;
        gap: 0.6rem;
        border-radius: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .adm-stat-icon {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

    .adm-stat-num { font-size: 1.2rem; }
    .adm-stat-label { font-size: 0.7rem; }

    .adm-panel-top { padding: 0.6rem 1rem; }

    .adm-tab {
        padding: 0.4rem 0.7rem;
        font-size: 0.8rem;
    }

    .adm-table-wrap { display: none !important; }
    .adm-card-list  { display: flex !important; }
}

/* Desktop: show table, hide card list */
@media (min-width: 769px) {
    .adm-card-list  { display: none !important; }
    .adm-table-wrap { display: block !important; }
}
