/* Global Vars */
:root {
    --sp-black: #000000;
    --sp-dark-gray: #1a1a1a;
    --sp-white: #ffffff;
    --sp-light-gray: #f4f4f4;
    --sp-border: #ddd;
    --sp-accent: #000;
    /* Black accent */
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--sp-dark-gray);
    background-color: var(--sp-light-gray);
}

/* ================= LOGIN PAGE ================= */
body.sp-login-page {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--sp-white);
}

.sp-left-panel {
    flex: 1;
    background-color: var(--sp-black);
    color: var(--sp-white);
    display: none;
    /* Mobile hidden */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.sp-left-panel h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.sp-right-panel {
    flex: 1;
    background-color: var(--sp-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.sp-login-form {
    width: 100%;
    max-width: 350px;
}

.sp-login-form h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--sp-black);
}

.sp-input-group {
    margin-bottom: 20px;
}

.sp-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.sp-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--sp-black);
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}

.sp-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--sp-black);
    color: var(--sp-white);
    border: none;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    transition: opacity 0.3s;
}

.sp-btn:hover {
    opacity: 0.9;
}

.sp-error {
    color: red;
    margin-bottom: 15px;
}

@media (min-width: 768px) {
    .sp-left-panel {
        display: flex;
    }
}

/* ================= DASHBOARD ================= */
.sp-dashboard-body {
    background: var(--sp-light-gray);
}

.sp-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sp-sidebar {
    width: 250px;
    background: var(--sp-black);
    color: var(--sp-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    transition: transform 0.3s;
}

.sp-brand {
    padding: 20px;
    font-size: 1.5rem;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

.sp-nav {
    flex: 1;
    padding: 20px 0;
}

.sp-nav a {
    display: block;
    padding: 15px 20px;
    color: #ccc;
    text-decoration: none;
    transition: color 0.2s, background 0.2s;
}

.sp-nav a:hover,
.sp-nav a.active {
    color: var(--sp-white);
    background: #222;
}

.sp-nav-divider {
    padding: 10px 20px;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    margin-top: 10px;
}

.sp-logout-btn {
    margin-top: auto;
    border-top: 1px solid #333;
}

/* Main Content */
.sp-main {
    flex: 1;
    margin-left: 250px;
    /* Width of sidebar */
    display: flex;
    flex-direction: column;
}

.sp-header {
    background: var(--sp-white);
    padding: 20px 40px;
    border-bottom: 1px solid var(--sp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sp-content {
    padding: 40px;
    flex: 1;
}

/* Cards */
.sp-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.sp-card {
    background: var(--sp-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.sp-card h3 {
    margin-top: 0;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.sp-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--sp-black);
}

.error-text {
    color: #d32f2f;
}

/* Tables */
.sp-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--sp-white);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

.sp-table th,
.sp-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.sp-table th {
    background: #f9f9f9;
    font-weight: 600;
}

/* Mobile Responsive Dashboard */
@media (max-width: 768px) {
    .sp-sidebar {
        transform: translateX(-100%);
        z-index: 1000;
    }

    .sp-sidebar.open {
        transform: translateX(0);
    }

    .sp-main {
        margin-left: 0;
    }

    .sp-header {
        padding: 15px 20px;
    }

    .sp-content {
        padding: 20px;
    }
}