/* --- Admin Base Styles --- */
body { 
    background-color: #f4f7f6; 
    font-family: 'Open Sans', sans-serif;
}
:root {
    --primary: #0f5132; 
    --secondary: #198754;
    --accent: #ffc107; 
    --dark: #1a1a1a;
    --white: #fff;
    --shadow: 0 5px 15px rgba(0,0,0,0.08);
}
.admin-container { 
    padding: 2rem 3%; 
    max-width: 1300px; 
    margin: auto; 
}
h1 { color: var(--dark); font-weight: 800; font-size: 2.2rem; margin-bottom: 5px; }
h2 { color: var(--primary); font-size: 1.5rem; margin-top: 20px; margin-bottom: 15px; border-bottom: 2px solid #eee; padding-bottom: 5px; }

/* --- Navigation Bar (Overlap Fix Applied) --- */
.admin-nav { 
    background: #2c3e50; 
    padding: 1rem 3%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    color: var(--white); 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    /* FIX: LOCKS NAV TO TOP & ENSURES HIGH PRIORITY OVER PAGE CONTENT */
    position: sticky; 
    top: 0;
    z-index: 10000; 
}
.admin-nav a { 
    color: #bdc3c7; 
    text-decoration: none; 
    margin-left: 25px; 
    font-weight: 600; 
    transition: 0.3s;
    padding: 5px 0;
}
.admin-nav a.active { 
    color: var(--white); 
    border-bottom: 3px solid var(--accent); 
}
.admin-nav a:hover { 
    color: var(--white); 
}
.admin-nav .logo-text { 
    font-size: 1.2rem; 
    font-weight: bold; 
    color: var(--accent);
}

/* --- Tables and Data Views (Content Overlap Fix Applied) --- */
.admin-table { 
    width: 100%; 
    background: var(--white); 
    border-collapse: separate; 
    border-spacing: 0;
    box-shadow: var(--shadow); 
    border-radius: 8px; 
    overflow: hidden; 
    margin-bottom: 30px;
    /* FIX: Prevents layout shifts when content is too wide */
    table-layout: fixed; 
}
.admin-table th { 
    background: var(--primary); 
    color: var(--white); 
    padding: 15px; 
    text-align: left; 
    font-weight: 600;
}
.admin-table td { 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
    vertical-align: middle;
    /* FIX: Ensures cell content does not escape and overlap other elements */
    overflow: hidden; 
    white-space: nowrap; 
    text-overflow: ellipsis; 
}
.admin-table tr:last-child td {
    border-bottom: none;
}
.admin-table tr:hover {
    background-color: #fcfcfc;
}

/* --- UI Components --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}
.stat-card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--primary);
}
.stat-card .number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
}
.stat-card .label {
    font-size: 0.9rem;
    color: #666;
}
.stat-card i {
    font-size: 2rem;
    color: var(--accent);
}

/* --- Form and Upload Styles (Refined for Add Activity) --- */
.form-box {
    background: var(--white);
    padding: 2.5rem; /* Increased padding for better visual separation */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-box label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}
/* NEW: Standardized input/select/textarea styles */
.form-box input[type="text"], 
.form-box input[type="number"], 
.form-box textarea, 
.form-box select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    transition: border-color 0.2s;
    margin: 0; /* Ensures no unintended margin from generic styles */
}
.form-box input:focus, .form-box select:focus, .form-box textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(15, 81, 50, 0.2);
}
/* END FORM FIELD STYLES */


.form-upload { 
    display: flex; 
    gap: 15px; 
    align-items: center; 
    padding: 25px; 
    border: 2px dashed #ddd; 
    border-radius: 8px; 
    margin-bottom: 30px;
}
.form-upload label {
    font-weight: 600;
    color: var(--dark);
    flex-shrink: 0;
}
.form-upload input[type="file"] { 
    flex-grow: 1; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
}

/* --- Progress Bar --- */
.progress-bar-container { 
    background: #e0e0e0; 
    border-radius: 5px; 
    margin-top: 5px; 
    overflow: hidden;
    height: 20px;
}
.progress-bar { 
    height: 100%; 
    background: var(--secondary); 
    text-align: right; 
    padding-right: 8px; 
    color: white; 
    font-size: 0.8rem; 
    line-height: 20px; 
    transition: width 0.5s ease; 
    font-weight: 600;
}

/* --- Messages Inbox Specific --- */
.message-row {
    transition: background-color 0.2s;
}
.message-row:nth-child(even) {
    background-color: #f7f7f7;
}
.message-details { 
    max-width: 300px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    display: block; 
    font-size: 0.95rem;
    color: #666;
}

/* --- Utility/Alerts --- */
.btn { 
    padding: 8px 15px; 
    border-radius: 5px; 
    text-decoration: none; 
    font-weight: 600; 
    transition: 0.3s; 
    display: inline-block; 
    border: none; 
    cursor: pointer;
}
.btn-primary { 
    background: var(--accent); 
    color: var(--dark); 
}
.btn-primary:hover { 
    background: #e0a800; 
    transform: translateY(-1px); 
}
.btn-secondary {
    background: var(--secondary);
    color: white;
}
.btn-secondary:hover {
    background: #157347;
}

/* Status Badges (copied from client styles) */
.status-badge { 
    display: inline-block; 
    padding: 5px 12px; 
    border-radius: 20px; 
    font-size: 0.75rem; 
    color: #fff; 
    font-weight: bold; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}
.status-upcoming { background: #3498db; }
.status-in_progress { background: #e67e22; }

/* Alert Styles */
.alert-success { color: #0f5132; background: #d1e7dd; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #badbcc; }
.alert-error { color: #842029; background: #f8d7da; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #f5c2c7; }
.alert-info { color: #055160; background: #cff4fc; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #b6effb; }

/* ===============================
   ADD ACTIVITY MODAL (Beautiful UI)
================================*/

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: #ffffffee;
    backdrop-filter: blur(12px);
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    padding: 30px 40px;
    position: relative;
    box-shadow: 0 12px 35px rgba(0,0,0,0.25);
    animation: slideUp 0.4s ease;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    color: #2b4eff;
    margin-bottom: 15px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 18px; right: 22px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: 0.3s;
}
.close-btn:hover { color: #2b4eff; }

.form-box {
    margin-top: 10px;
}

.form-box label {
    font-weight: 600;
    margin-top: 12px;
    display: block;
    color: #1a1a1a;
}

.form-box input, .form-box select, .form-box textarea {
    width: 100%;
    padding: 12px 15px;
    margin-top: 6px;
    border: 1px solid #dcdcdc;
    border-radius: 12px;
    outline: none;
    font-size: 15px;
    background: #f4f7fb;
    transition: all 0.3s ease;
}
.form-box input:focus, .form-box select:focus, .form-box textarea:focus {
    border-color: #2b4eff;
    box-shadow: 0 0 0 4px rgba(43,78,255,0.15);
    background: #fff;
}
textarea { resize: vertical; min-height: 80px; }

.btn-submit {
    width: 100%;
    padding: 15px 0;
    margin-top: 20px;
    font-size: 17px;
    border-radius: 12px;
    font-weight: 700;
    background: linear-gradient(135deg,#2b4eff,#4f8afd);
    color: #fff;
    transition: all 0.3s ease;
}
.btn-submit:hover {
    background: linear-gradient(135deg,#1e3bcc,#356fe0);
    transform: translateY(-2px);
    box-shadow: 0px 4px 12px rgba(43,78,255,0.3);
}

/* Alerts inside modal */
.alert {
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border-left: 5px solid #28a745; }
.alert-danger  { background: #f8d7da; color: #721c24; border-left: 5px solid #e3342f; }

/* Animations */
@keyframes slideUp { from {opacity:0; transform:translateY(30px);} to {opacity:1; transform:translateY(0);} }
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }

/* Responsive modal */
@media (max-width: 600px) {
    .modal-content { padding: 20px; margin: 50px 15px; }
    .modal-title { font-size: 24px; }
    .btn-submit { font-size: 16px; padding: 12px 0; }
}

