:root {
    --primary-color: #7b61ff;
    --primary-hover: #6949f5;
    --bg-gradient: linear-gradient(135deg, #7c7cdb, #ab77d5);
    --header-bg: #324054;
    --text-main: #2b364a;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.05);
    
    --icon-blue: #3b82f6;
    --icon-red: #ef4444;
    --icon-purple: #a855f7;
    --icon-green: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--text-main);
}

.main-container {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background-color: var(--header-bg);
    color: white;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
}

.header-icon {
    display: inline-flex;
    margin-right: 10px;
    vertical-align: middle;
}

.header h1 {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    vertical-align: middle;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Content Area */
.content {
    padding: 3rem 2rem;
    background: #fdfdfd;
}

/* Auth Form */
.auth-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    text-align: center;
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
}

.input-group input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    text-align: left;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.2);
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s, transform 0.1s;
    margin-top: 1rem;
}

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

.primary-btn:active {
    transform: scale(0.97);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.error-message {
    color: var(--icon-red);
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 15px;
    min-height: 20px;
}

/* Dashboard */
.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-main);
}

.highlight {
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.cards-grid.single {
    grid-template-columns: 1fr;
    max-width: 250px;
}

@media (max-width: 850px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.8rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid #f1f5f9;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.card-icon.blue { color: var(--icon-blue); }
.card-icon.red { color: var(--icon-red); }
.card-icon.purple { color: var(--icon-purple); font-weight: bold; font-family: sans-serif; }
.card-icon.green { color: var(--icon-green); }

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    min-height: 40px;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease-in-out forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
