@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
body, html { margin: 0; padding: 0; height: 100vh; width: 100vw; overflow: hidden; background: #000; color: white; font-family: 'Segoe UI', Arial, sans-serif; display: flex; flex-direction: column; }

/* --- MASTER TYPOGRAPHY (Fixes Point 7) --- */
.page-title { color: #fbbf24; text-align: center; margin-top: 10px; margin-bottom: 25px; font-size: 26px; border-bottom: 2px solid #333; padding-bottom: 10px;}
.section-title { color: #fbbf24; margin-top: 20px; font-size: 18px; border-bottom: 1px dashed #333; padding-bottom: 5px;}

/* --- HEADER & TOOLBAR --- */
.temple-top { height: 50px; background: linear-gradient(to right, #4a2c00, #fbbf24, #4a2c00); display: flex; justify-content: space-between; align-items: center; padding: 0 30px; border-bottom: 2px solid #fbbf24; flex-shrink: 0; z-index: 1000; width: 100%; box-sizing: border-box;}
.tool-bar { height: 50px; background: #111; padding: 0 20px; border-bottom: 1px solid #fbbf24; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; z-index: 1000;}
.toolbar-group { display: flex; gap: 8px; align-items: center; }

/* --- BUTTONS & INPUTS --- */
select, input, button, textarea { background: #000; color: #fbbf24; border: 1px solid #333; padding: 10px; border-radius: 4px; font-size: 13px; font-family: inherit; box-sizing: border-box;}
button { cursor: pointer; font-weight: bold; transition: 0.2s; border: 1px solid #fbbf24;} 
button:hover { background: #fbbf24; color: #000; }
.btn-act { padding: 4px 10px; border-radius: 15px; font-size: 11px; background: #fbbf24; color: #000; border: none; }
.btn-sm { padding: 4px 8px; font-size: 11px; width: auto; border:none; border-radius:3px; font-weight:bold; cursor:pointer;}

/* --- LAYOUTS --- */
.content-scroll { overflow-y: auto; flex-grow: 1; padding: 20px 40px; background: #050505; height: calc(100vh - 110px); }
.card { background: #111; padding: 20px; border-radius: 6px; margin-bottom: 20px; border: 1px solid #333;}
.container { max-width: 1000px; margin: 0 auto; padding: 10px;}

.scrollable { overflow-y: auto !important; padding-right: 5px;}
.scrollable::-webkit-scrollbar { width: 5px; } .scrollable::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 4px; } .scrollable::-webkit-scrollbar-track { background: #111; }

/* --- DASHBOARD BOXES (Fixes Points 3 & 6 - Forces Horizontal) --- */
/* --- DASHBOARD BOXES (Fixed: Single Row Carousel) --- */
.dash-row { 
    display: flex; 
    flex-wrap: nowrap; /* Forces everything onto ONE line */
    gap: 15px; 
    margin-bottom: 20px; 
    overflow-x: auto; /* Adds a scrollbar if boxes exceed screen width */
    padding-bottom: 10px; /* Space for the scrollbar */
    justify-content: flex-start;
}

/* Custom thin scrollbar for the dashboard row */
.dash-row::-webkit-scrollbar { height: 6px; }
.dash-row::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 10px; }
.dash-row::-webkit-scrollbar-track { background: #333; border-radius: 10px; }

.d-box { 
    background: #111; 
    border: 1px solid #fbbf24; 
    padding: 15px 20px; 
    text-align: center; 
    border-radius: 6px; 
    flex: 0 0 auto; /* Prevents boxes from stretching awkwardly */
    min-width: 120px; 
    cursor: pointer; 
    transition: 0.3s;
}
.d-box:hover { 
    background: #222; 
    transform: translateY(-3px);
}

/* --- GRID CARDS (For Latest 3) --- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px;}
.data-card { background: #111; border: 1px solid #333; padding: 20px; border-radius: 8px; transition: 0.3s; display: flex; flex-direction: column;}
.data-card:hover { border-color: #fbbf24; transform: translateY(-5px);}
.tag { font-size: 10px; background: #333; padding: 3px 8px; border-radius: 10px; color: #fbbf24; display: inline-block; margin-bottom:10px;}

/* --- MASTER TABLES --- */
.table-container { width: 100%; overflow-x: auto; background: #111; border: 1px solid #333; border-radius: 8px; padding: 10px; margin-top: 15px;}
table { width: 100%; border-collapse: collapse; font-size: 13px;}
th, td { border-bottom: 1px solid #222; padding: 10px; text-align: left; color: white; } th { background: #fbbf24; color: #000; font-weight: bold;}
tr:hover td { background: #222; }

/* --- MODALS --- */
.modal { display: none; position: fixed; top:0; left:0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 3000; justify-content: center; align-items: center;}
.modal-content { background: #111; border: 2px solid #fbbf24; padding: 20px; width: 450px; border-radius: 8px; display: flex; flex-direction: column; gap: 15px; max-height: 90vh; overflow-y: auto;}

/* --- std template table row clickable --- */
.row-link { cursor: pointer; transition: 0.2s; }
.row-link:hover { background: #222; }

/* --- Admin Table --- */
.truncate-title { max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

/* --- DASHBOARD BOXES --- */
.dash-row { 
    display: flex; 
    flex-wrap: nowrap; /* Forces everything onto ONE line */
    gap: 15px; 
    margin-bottom: 20px; 
    overflow-x: auto; /* Adds a scrollbar if boxes exceed screen width */
    padding-bottom: 10px; /* Space for the scrollbar */
    justify-content: flex-start;
}
.dash-row::-webkit-scrollbar { height: 6px; }
.dash-row::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 10px; }
.dash-row::-webkit-scrollbar-track { background: #333; border-radius: 10px; }

.d-box { background: #111; border: 1px solid #fbbf24; padding: 15px; text-align: center; border-radius: 6px; cursor: pointer; transition: 0.3s; flex: 0 0 auto; min-width: 130px; }
.d-box:hover { background: #222; transform: translateY(-3px);}

/* --- GRID CARDS --- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; margin-bottom: 30px;}
.card { background: #111; border: 1px solid #333; padding: 20px; border-radius: 8px; display: flex; flex-direction: column; transition: 0.3s;}
.card:hover { border-color: #fbbf24; transform: translateY(-5px);}
.tag { font-size: 10px; background: #333; padding: 3px 8px; border-radius: 10px; color: #fbbf24; display: inline-block; margin-bottom: 10px;}

/* --- MASTER TABLES --- */
.table-container { width: 100%; overflow-x: auto; background: #111; border: 1px solid #333; border-radius: 8px; padding: 10px; margin-top: 15px;}

/* FIXED: Forces tables in Admin.html to be strictly scrollable and caps their height! */
.admin-table-wrapper { width: 100%; max-height: 350px; overflow-y: auto; background: #111; border: 1px solid #333; border-radius: 6px; margin-top: 15px;}
.admin-table-wrapper::-webkit-scrollbar { width: 5px; } 
.admin-table-wrapper::-webkit-scrollbar-thumb { background: #fbbf24; border-radius: 4px; } 

table { width: 100%; border-collapse: collapse; font-size: 13px;}
th, td { border-bottom: 1px solid #222; padding: 10px; text-align: left; color: white; } 
th { background: #fbbf24; color: #000; font-weight: bold;}
tr:hover td { background: #222; }

/* Truncates long titles in the table so they don't stretch the screen */
.truncate-title { max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom;}

/* --- MODALS --- */
.modal { display: none; position: fixed; top:0; left:0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 3000; justify-content: center; align-items: center;}
.modal-content { background: #111; border: 2px solid #fbbf24; padding: 20px; width: 450px; border-radius: 8px; display: flex; flex-direction: column; gap: 15px; max-height: 90vh; overflow-y: auto;}

