:root {
    --dsp-purple: #330066;
    --dsp-gold: #FFD700;
    --bg-color: #F8F9FA;
    --text-color: #333;
    --white: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* Header */
header {
    background-color: var(--dsp-purple);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--dsp-gold);
}
header h1 { margin: 0; font-size: 1.5rem; }
header a { color: var(--dsp-gold); text-decoration: none; font-weight: bold; margin-left: 15px;}

/* ADMIN GRID LAYOUT */
.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr; /* Fixed Sidebar, Flexible Main */
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 80px); /* Fill screen height minus header */
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr; /* Stack on mobile */
        height: auto;
    }
}

.admin-sidebar { display: flex; flex-direction: column; gap: 20px; }
.admin-main { display: flex; flex-direction: column; }

/* Cards */
.card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 0; /* Margin handled by grid gap */
}
h2 { color: var(--dsp-purple); border-bottom: 2px solid #eee; padding-bottom: 10px; margin-top:0; font-size: 1.2rem; }

/* Forms & Inputs */
input, select, button {
    width: 100%;
    padding: 10px;
    margin: 5px 0 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button { background-color: var(--dsp-purple); color: white; border: none; cursor: pointer; font-weight: bold; }
button:hover { background-color: #4b0096; }
.btn-secondary { background-color: #ddd; color: #333; }
.btn-approve { background-color: #28a745; }
.btn-archive { background-color: #dc3545; }

/* Date Controls */
.date-controls {
    display: flex;
    gap: 5px;
}
.date-controls button { width: 40px; background: #eee; color: #333; font-weight: bold;}
.date-controls input { flex: 1; }

/* CHIP SELECTOR (Gmail Style) */
.chip-container {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    background: white;
    position: relative;
    cursor: text;
}
.chip-container input { border: none; outline: none; margin: 0; width: auto; min-width: 100px; }
.chip {
    display: inline-flex;
    align-items: center;
    background: #e0e0e0;
    border-radius: 16px;
    padding: 4px 10px;
    margin: 2px;
    font-size: 0.9rem;
}
.chip span { margin-left: 8px; cursor: pointer; color: #666; font-weight: bold;}
.chip span:hover { color: red; }

.suggestions-list {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: white;
    border: 1px solid #ddd;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.suggestions-list div { padding: 10px; cursor: pointer; border-bottom: 1px solid #eee; }
.suggestions-list div:hover { background: #f0f0f0; }

/* Overview Table */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid #eee; }
th { color: var(--dsp-purple); position: sticky; top: 0; background: white; }
tr:hover { background: #f9f9f9; }

.compact-table td, .compact-table th { padding: 6px; font-size: 0.85rem; }

/* --- MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); /* Dim background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    height: 80vh; /* Fixed height relative to screen */
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #888;
}
.close-modal:hover { color: red; }

.modal-header {
    border-bottom: 4px solid var(--dsp-gold);
    
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.modal-header h1 { margin: 0; color: var(--dsp-purple); }
.modal-header p { margin: 5px 0 0; color: #666; }

.modal-body {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden; /* Contains scrollbars */
}

@media (max-width: 768px) {
    .modal-body { flex-direction: column; overflow-y: auto; }
}

.role-manager {
    margin-top: 10px;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.role-manager select { width: auto; margin: 0; }

/* --- LOGIN PAGE SPECIFIC STYLES --- */

/* Override body background for login only */
body.login-mode {
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 12px;
    /* The "Hovered" floating effect */
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); 
    text-align: center;
    position: relative;
    overflow: hidden;
}

.crest-img {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--dsp-purple);
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
}

/* Big Phone Input */
.phone-input {
    font-size: 1.2rem;
    text-align: center;
    letter-spacing: 1px;
    border: 2px solid #eee;
    transition: 0.3s;
    border-radius: 8px;
}
.phone-input:focus {
    border-color: var(--dsp-purple);
    outline: none;
}

/* OTP (One Time Password) Container */
.otp-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-box {
    width: 45px;
    height: 55px;
    border: 2px solid #eee;
    border-radius: 8px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dsp-purple);
    transition: 0.2s;
    padding: 0; /* Override default input padding */
}

.otp-box:focus {
    border-color: var(--dsp-purple);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(51, 0, 102, 0.1);
    outline: none;
}

/* Action Button */
.btn-login {
    background-color: var(--dsp-purple);
    height: 50px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

/* Slide Animation */
.slide-in {
    animation: slideUp 0.4s ease-out forwards;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LOADER ANIMATION --- */
.loader {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid var(--dsp-purple); /* Purple */
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 15px auto; /* Center horizontally */
    display: none; /* Hidden by default */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- PROGRESS BARS --- */
.progress-container {
    background-color: #eee;
    border-radius: 10px;
    height: 10px;
    width: 100%;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--dsp-purple);
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-bar.complete {
    background-color: #28a745; /* Green when done */
}

.req-text {
    font-size: 0.85rem;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}
.status-met { background: #d4edda; color: #155724; }
.status-pending { background: #f8d7da; color: #721c24; }

/* Burger Menu Styles */
.menu-container {
    position: relative;
}

.burger-menu {
    font-size: 2rem;
    cursor: pointer;
}

.side-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px; /* Position below the header */
    background-color: var(--dsp-purple);
    border: 1px solid var(--dsp-gold);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 100;
    width: 200px;
}

.side-menu.active {
    display: block;
}

.side-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--dsp-gold);
    text-decoration: none;
    border-bottom: 1px solid #4b0096; /* Darker purple for separator */
    margin-left: 0; /* Override general header a style */
}

.side-menu a:last-child {
    border-bottom: none;
}

.side-menu a:hover {
    background-color: #4b0096;
}

/* SMS Buttons */
.btn-subscribe {
    background-color: var(--dsp-purple);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    width: auto;
    font-size: 0.9rem;
}

.btn-unsubscribe {
    background-color: transparent;
    color: #666;
    border: 1px solid #ccc;
    padding: 8px 15px;
    border-radius: 20px;
    width: auto;
    font-size: 0.9rem;
}
.btn-unsubscribe:hover {
    background-color: #eee;
    color: #333;
}