/* 
   SANTRA ADMIN PANEL - CLEAN SAAS THEME 
   Rebuilt from scratch.
*/

:root {
    --primary: #d4af37;
    /* Santra Gold */
    --primary-hover: #b5952f;
    --primary-text: #ffffff;

    --sidebar-bg: #1e293b;
    /* Dark Slate */
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: rgba(255, 255, 255, 0.1);

    --bg-body: #f1f5f9;
    /* Light Gray Background */
    --bg-card: #ffffff;
    /* White Cards */
    --text-main: #0f172a;
    /* Dark Text */
    --text-muted: #64748b;

    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.06);

    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll */
}

/* --- SIDEBAR --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    max-height: 40px;
    height: auto;
    object-fit: contain;
    /* Removed filter to show original logo colors */
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--sidebar-active);
    background-color: var(--sidebar-active-bg);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.spacer {
    flex: 1;
}

/* Pushes logout to bottom */

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.top-header {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
}

.top-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--bg-body);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

/* Content Container */
.content-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    width: 100%;
}

/* --- COMPONENTS --- */

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* Grid System */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.bg-blue {
    background-color: #3b82f6;
}

.bg-green {
    background-color: #10b981;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
}

.stat-card h3 {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Charts */
.chart-wrapper {
    height: 350px;
    width: 100%;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    max-width: 320px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* Tables */
.table-card {
    padding: 0;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8fafc;
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background-color: #f8fafc;
}

.text-right {
    text-align: right;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-text);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: white;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: #f1f5f9;
}

.btn-text {
    background: none;
    color: var(--text-muted);
    padding: 0.5rem;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.w-full {
    width: 100%;
}

/* Profile View */
.profile-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.badges {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-pill {
    background: #f1f5f9;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-blue {
    background: #e0e7ff;
    color: #3730a3;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* QR Result */
.qr-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.qr-code {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.url-text {
    word-break: break-all;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.qr-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.login-box {
    max-width: 350px;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Mobile */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow: auto;
        height: auto;
    }

    .sidebar {
        width: 100%;
        height: auto;
        padding-bottom: 0.5rem;
    }

    .sidebar-header {
        border: none;
        height: 50px;
    }

    .sidebar-nav {
        flex-direction: row;
        padding: 0.5rem;
        overflow-x: auto;
    }

    .nav-item span {
        display: none;
    }

    /* Icons only on mobile */
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 0 1rem;
    }

    .content-container {
        padding: 1rem;
    }
}