/* Admin Premium Design - AgendStore */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    /* Colors */
    --bg-body: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --border-color: rgba(148, 163, 184, 0.1);

    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --primary-solid: #6366f1;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    z-index: 100;
}

.sidebar h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    font-weight: 500;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(99, 102, 241, 0.1);
    color: white;
}

.sidebar a i {
    width: 25px;
    text-align: center;
    margin-right: 0.5rem;
}

.sidebar .logout {
    margin-top: auto;
    position: absolute;
    bottom: 2rem;
    left: 1.5rem;
    right: 1.5rem;
    width: auto;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.sidebar .logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Main Content */
.main {
    margin-left: 260px;
    padding: 2.5rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Cards (Premium 3D Glass) */
.card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    opacity: 0.5;
    transition: opacity 0.3s, height 0.3s;
}

.card:hover::before {
    opacity: 1;
    height: 3px;
}

.card h3 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: white;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: rgba(148, 163, 184, 0.6);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.btn-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background: rgba(15, 23, 42, 0.5);
    padding: 1rem;
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Grid & Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Modals (Premium Logic) */
.modal {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex !important;
    opacity: 1;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile & Responsive Tweaks */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
    }

    .sidebar h2 {
        margin-bottom: 1rem;
        justify-content: center;
    }

    /* Make sidebar links a horizontal scrollable menu on mobile */
    .sidebar {
        /* Optional: Change sidebar to a grid or flex wrap if many items */
        overflow-x: auto;
        white-space: nowrap;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .sidebar a {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color);
        margin: 0;
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
        display: inline-flex;
    }

    .sidebar .logout {
        position: static;
        width: 100%;
        margin-top: 1rem;
        text-align: center;
        justify-content: center;
    }

    .main {
        margin-left: 0;
        padding: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 1rem;
    }

    /* Responsive Tables */
    .card {
        padding: 1rem;
        overflow-x: auto;
        /* Enable horizontal scroll for huge tables */
    }

    .table {
        min-width: 600px;
        /* Force scroll if too small */
    }

    /* Modals mobile */
    .modal-content {
        padding: 1.5rem;
        width: 95%;
        margin: 1rem;
        max-height: 85vh;
    }

    .stat-card {
        margin-bottom: 1rem;
    }
}

/* Login Page Specifics */
body.login-page {
    justify-content: center;
    align-items: center;
    display: flex;
    background-image: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
        radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%);
}

.login-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-card h1 {
    color: white;
    text-align: center;
    margin-bottom: 2rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}