@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Soft & Elegant Color Palette - Admin Edition */
    --primary: #FF6B8A;
    --primary-hover: #E84A6F;
    --primary-light: #FFF0F3;
    --primary-dark: #D62D55;
    --primary-gradient: linear-gradient(135deg, #FF6B8A 0%, #FF8FAA 100%);
    --accent-gradient: linear-gradient(135deg, #6366F1 0%, #A855F7 100%);

    /* Backgrounds */
    --bg-body: #F1F5F9;
    --bg-sidebar: linear-gradient(180deg, #1E1E2F 0%, #11111D 100%);
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-hover: #FFF5F7;

    /* Text */
    --text-main: #1E293B;
    --text-light: #64748B;
    --text-white: #FFFFFF;
    --text-pink: #FF6B8A;
    --text-pink-light: #FFB3C2;

    /* Status Colors */
    --border: #E2E8F0;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Glassmorphism & Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 50px rgba(0, 0, 0, 0.08);
    --shadow-pink: 0 10px 25px rgba(255, 107, 138, 0.25);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

    /* Border Radius */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-xl: 40px;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Sidebar Width */
    --sidebar-width: 280px;
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    font-size: 0.95rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

/* ============================================
   ADMIN LAYOUT
============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR - Premium Dark Theme
============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 3.5rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-logo::before {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    background: var(--primary-gradient);
    border-radius: 4px;
    transform: rotate(45deg);
    box-shadow: 0 0 20px rgba(255, 107, 138, 0.6);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-bounce);
    position: relative;
}

.nav-link i {
    width: 24px;
    margin-right: 15px;
    font-size: 1.1rem;
    color: var(--text-pink-light);
    opacity: 0.7;
    transition: var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    transform: translateX(8px);
}

.nav-link:hover i {
    opacity: 1;
    color: var(--text-pink);
    transform: scale(1.1);
}

.nav-link.active {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-pink);
    font-weight: 600;
}

.nav-link.active i {
    color: var(--text-white);
    opacity: 1;
}

.nav-link[href="logout.php"] {
    margin-top: auto;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

.nav-link[href="logout.php"]:hover {
    background: var(--danger);
    color: var(--text-white);
    border-color: transparent;
}

.nav-link[href="logout.php"] i {
    color: inherit;
}

/* ============================================
   MAIN CONTENT AREA
============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header h2 {
    font-size: 1.75rem;
    color: var(--text-main);
    font-weight: 600;
}

.header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem 0.5rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    transition: var(--transition-fast);
}

.user-profile:hover {
    box-shadow: var(--shadow-card);
}

.user-profile span {
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================
   CARDS & STATS
============================================ */
.card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Stats Cards Specific */
.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--primary-light);
    color: var(--primary);
    transition: var(--transition-bounce);
}

.card:hover .stat-icon {
    transform: rotate(-10deg) scale(1.1);
}

.card:nth-child(1) .stat-icon {
    background: rgba(255, 107, 138, 0.1);
    color: var(--primary);
}

.card:nth-child(2) .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.card:nth-child(3) .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.card:nth-child(4) .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* ============================================
   TABLES
============================================ */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    text-align: left;
    padding: 1rem 1.25rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    background: var(--bg-body);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.95rem;
}

.table tbody tr {
    transition: var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES - Soft color variants
============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pending {
    background: var(--warning-light);
    color: #B45309;
}

.badge-confirmed {
    background: var(--success-light);
    color: #047857;
}

.badge-cancelled {
    background: var(--danger-light);
    color: #B91C1C;
}

.badge-completed {
    background: var(--info-light);
    color: #1D4ED8;
}

.badge-paid {
    background: var(--success-light);
    color: #047857;
}

.badge-unpaid {
    background: var(--danger-light);
    color: #B91C1C;
}

.badge-active {
    background: var(--success-light);
    color: #047857;
}

.badge-inactive {
    background: var(--soft-purple);
    color: #6B21A8;
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-white);
    box-shadow: var(--shadow-pink);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 107, 138, 0.3);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: var(--text-white);
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-success {
    background: var(--success);
    color: var(--text-white);
}

.btn-success:hover {
    background: #059669;
}

/* Action Buttons Group */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-btn:hover {
    background: var(--bg-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.edit:hover {
    color: var(--info);
    border-color: var(--info);
    background: var(--info-light);
}

.action-btn.delete:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-light);
}

/* ============================================
   FORMS
============================================ */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.form-control::placeholder {
    color: var(--text-light);
}

.form-control:focus {
    outline: none;
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 138, 0.1);
}

.form-control:disabled {
    background: var(--border);
    cursor: not-allowed;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ============================================
   MODALS
============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    border: none;
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* ============================================
   AVATAR
============================================ */
.avatar {
    width: 42px;
    height: 42px;
    background: var(--primary-gradient);
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

/* ============================================
   ALERTS
============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid #A7F3D0;
    color: #047857;
}

.alert-danger {
    background: var(--danger-light);
    border: 1px solid #FECACA;
    color: #B91C1C;
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid #FDE68A;
    color: #B45309;
}

.alert-info {
    background: var(--info-light);
    border: 1px solid #93C5FD;
    color: #1D4ED8;
}

/* ============================================
   EMPTY STATE
============================================ */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* ============================================
   PAGE HEADER WITH ACTIONS
============================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h3 {
    font-size: 1.25rem;
    color: var(--text-main);
}

/* ============================================
   SEARCH & FILTERS
============================================ */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-box input {
    padding-left: 3rem;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* ============================================
   PAGINATION
============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.pagination a {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination span.active {
    background: var(--primary-gradient);
    color: var(--text-white);
    border: none;
}

/* ============================================
   ANIMATIONS
============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.card {
    animation: fadeIn 0.5s ease forwards;
}

.card:nth-child(2) {
    animation-delay: 0.1s;
}

.card:nth-child(3) {
    animation-delay: 0.2s;
}

.card:nth-child(4) {
    animation-delay: 0.3s;
}

.nav-link {
    animation: slideInLeft 0.4s ease forwards;
}

.nav-link:nth-child(2) {
    animation-delay: 0.05s;
}

.nav-link:nth-child(3) {
    animation-delay: 0.1s;
}

.nav-link:nth-child(4) {
    animation-delay: 0.15s;
}

.nav-link:nth-child(5) {
    animation-delay: 0.2s;
}

.nav-link:nth-child(6) {
    animation-delay: 0.25s;
}

.nav-link:nth-child(7) {
    animation-delay: 0.3s;
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.75rem;
    }

    .sidebar-logo {
        justify-content: center;
        font-size: 0;
        padding: 0;
    }

    .sidebar-logo::before {
        width: 40px;
        height: 40px;
    }

    .nav-link {
        justify-content: center;
        padding: 1rem;
    }

    .nav-link i {
        margin-right: 0;
        font-size: 1.25rem;
    }

    .nav-link span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 0.75rem;
        justify-content: space-around;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-right: none;
    }

    .sidebar nav {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
    }

    .sidebar-logo {
        display: none;
    }

    .nav-link {
        padding: 0.75rem;
        margin-bottom: 0;
    }

    .nav-link::before {
        display: none;
    }

    .nav-link[href="../index.php"],
    .nav-link[href="logout.php"] {
        display: none;
    }

    .main-content {
        margin-left: 0;
        margin-bottom: 80px;
        padding: 1rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* Sidebar scrollbar */
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}