/* SKLPIX Admin UI — Superadmin area */




/* Ensure all headings use Raleway consistently */
h1, h2, h3, h4, h5, h6, .brand-name {
	font-family: 'Raleway', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
}
:root {

	--black: #0f172a;

	--white: #ffffff;

	--bg: #f6f7fb;

	--border: #e5e7eb;

	--muted: #6b7280;

	--red: #ef4444;

	--blue: #3b82f6;

	--blue-700: #1d4ed8;

	--green: #10b981;

}



/* Dark theme variables */

[data-theme="dark"] {

	--black: #e5e7eb;

	--white: #0b1220;

	--bg: #0b1220;

	--border: #1f2937;

	--muted: #9ca3af;

	--red: #f87171;

	--blue: #60a5fa;

	--blue-700: #3b82f6;

	--green: #34d399;

}



* { box-sizing: border-box; }

html, body { height: 100%; }

body {

	margin: 0;

	font-family: 'Raleway', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';

	color: var(--black);

	background: var(--bg);

}



a { color: var(--blue-700); text-decoration: none; }

a:hover { text-decoration: underline; }



.muted { color: var(--muted); }



/* Layout */

.admin-layout { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {

	height: 56px;

	background: #1f2937; /* dark grey */

	border-bottom: 1px solid #111827;

	display: flex; align-items: center; justify-content: space-between;

	padding: 0 16px;

	position: sticky; top: 0; z-index: 10;

	color: #f3f4f6;

}

.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }

.topbar .brand .logo {

	width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;

	background: var(--red); color: var(--white);

}

.topbar .right { color: #e5e7eb; font-size: 14px; }



.mainwrap { flex: 1; display: flex; align-items: stretch; gap: 0; }



/* Sidebar */

.sidebar {

	width: 240px;

	background: #1f2937; /* dark grey */

	border-right: 1px solid #111827;

	padding: 10px 10px 16px;

	position: sticky; top: 56px; /* below topbar */

	height: calc(100vh - 56px);

	overflow: auto;

}

.sidebar .section { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9ca3af; margin: 8px 10px; }

.navlist { list-style: none; margin: 0; padding: 0; }

.navlist li { margin: 4px 0; }

.navlist a {

	display: flex; align-items: center; gap: 10px;

	padding: 10px 12px;

	border-radius: 0;

	color: #e5e7eb;

	background: transparent;

	text-decoration: none;

}

.navlist a:hover { background: var(--red); color: #ffffff; text-decoration: none; }

.navlist a.active { background: var(--red); color: #ffffff; font-weight: 600; }

.navlist i { width: 18px; text-align: center; color: #cbd5e1; }



/* Content */

.content { flex: 1; padding: 20px; }
[data-theme="dark"] .content h1 { color: #ffffff; }
[data-theme="dark"] .content { background: #0a1e3a; }

.content h1 { margin: 10px 0 4px; font-size: 28px; }



/* Cards and grids */

.grid { display: grid; gap: 16px; }

.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.grid.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 10px; }



.card {

	background: var(--white);

	border: 1px solid var(--border);

	border-radius: 12px;

	padding: 14px;

	box-shadow: 0 1px 0 rgba(0,0,0,0.02);

}

[data-theme="dark"] .card { background: #0f172a; border-color: #1f2937; }

.card h3 { margin: 0 0 8px; font-size: 16px; }
[data-theme="dark"] .card h3 { color: #ffffff; }



/* Buttons */

.btn {

	display: inline-flex; align-items: center; gap: 8px;

	padding: 10px; border: 1px solid var(--red);

	background: var(--red); color: var(--white); text-decoration: none; cursor: pointer;

	font-family: 'Raleway', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

	font-weight: 300; font-size: 1.3em; line-height: 1.1;

	border-radius: 0;

}

.btn:hover { background: #dc2626; border-color: #dc2626; text-decoration: none; }

.btn-primary, .btn-secondary {

	background: var(--red) !important; color: var(--white) !important; border-color: var(--red) !important;

}

.btn-primary:hover, .btn-secondary:hover { background: #dc2626 !important; border-color: #dc2626 !important; }

[data-theme="dark"] .btn-secondary { background: #111827; color: #e5e7eb; border-color: #374151; }



/* Dark mode: enforce white button text */

[data-theme="dark"] .btn,

[data-theme="dark"] .btn-primary,

[data-theme="dark"] .btn-secondary { color: #ffffff !important; }
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-secondary:hover { color: #ffffff !important; }



/* Remove rounded corners across admin UI */

.admin-layout * { border-radius: 0 !important; }



/* Alerts */

.alert { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #fff; }

[data-theme="dark"] .alert { background: #111827; }

.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }

.alert.success { border-color: #bbf7d0; background: #f0fdf4; color: #065f46; }



/* Forms */

.form { display: grid; gap: 12px; }

.form .row { display: grid; gap: 6px; }

.form label { font-weight: 600; font-size: 14px; }

.form .input { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #f9fafb; }

[data-theme="dark"] .form .input { background: #ffffff; }

[data-theme="dark"] .form .input input,

[data-theme="dark"] .form .input select,

[data-theme="dark"] .form .input textarea { color: #111827; }

[data-theme="dark"] .form .input input::placeholder,

[data-theme="dark"] .form .input textarea::placeholder { color: #6b7280; }

.form .input i { color: var(--muted); }

.form input, .form select { border: none; outline: none; background: transparent; width: 100%; font-size: 14px; }



/* Dropdown refinements: remove wrapper border, add padding to select */

.form .input:has(> select) { border: none; padding: 0; background: transparent; }

.form .input:has(> select) select { padding: 10px; border: 0; background: #ffffff; color: #111827; border-radius: 10px; }



/* Dark mode: keep select readable on white background */

[data-theme="dark"] .form .input:has(> select) { background: transparent; }

[data-theme="dark"] .form .input:has(> select) select { background: #ffffff; color: #111827; }



/* Login page (superadmin/index.php) */

body.no-auth { background: linear-gradient(180deg, #f8fafc 0%, #f3f4f6 100%); }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--black); }

.login-brand .brand-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }

.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.06); }

.login-card .head { height: 6px; background: var(--black); }

.login-card .body { padding: 18px 16px 20px; }



/* Utility */

.logo { display: grid; place-items: center; }



@media (max-width: 900px) {

	.sidebar { width: 200px; }

}



/* Tables */

.table { width: 100%; border-collapse: collapse; font-size: 14px; }

.table thead th { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 700; }

.table tbody td { padding: 10px 8px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }



/* Modals */

.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.4); z-index: 1000; }

.modal.open { display: flex; }

.modal-dialog { width: 100%; max-width: 620px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden; }

[data-theme="dark"] .modal-dialog { background: #0f172a; }

.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f9fafb; }

.modal-body { padding: 14px; }



/* Normalize form controls */

.form input, .form select, .form textarea {

	border: none; outline: none; background: transparent; width: 100%;

	font-family: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;

	font-weight: 300; font-size: 1em; line-height: 1.2;

	height: 42px; /* unified control height */

}

.form textarea { min-height: 110px; height: auto; line-height: 1.4; }

/* Larger modal variant: 70% of viewport */

.modal-dialog.modal-70 { width: 70vw; max-width: none; height: 70vh; display: flex; flex-direction: column; }

.modal-dialog.modal-70 .modal-body { flex: 1; overflow: auto; }

.form .input:has(> select) select { padding: 10px; border: 0; background: #ffffff; color: #111827; border-radius: 10px; height: 42px; }

@media (max-width: 900px) {

	.modal-dialog.modal-70 { width: 94vw; height: 80vh; }

}



/* Responsive adjustments for 4-col grids */

@media (max-width: 1200px) {

	.grid.cols-4 { grid-template-columns: repeat(3, 1fr); }

}

@media (max-width: 900px) {

	.grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

}

@media (max-width: 600px) {

	.grid.cols-4 { grid-template-columns: 1fr; }

}



/* Ensure the View modal uses 70% viewport even if other rules interfere */

#viewSchoolModal .modal-dialog { width: 70vw; max-width: none; height: 70vh; display: flex; flex-direction: column; }

#viewSchoolModal .modal-body { flex: 1; overflow: auto; }

@media (max-width: 900px) {

	#viewSchoolModal .modal-dialog { width: 94vw; height: 80vh; }

}


/* ============================ */
/* Compatibility: dashboard UI  */
/* ============================ */

.dashboard-header {
    background: #1f2937;
    color: var(--white);
    padding: 20px 0;
}

.nav-card {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.nav-card:hover { transform: translateY(-2px); }

.nav-icon { color: var(--blue-700); font-size: 2rem; }

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    border-left: 3px solid var(--blue-700);
}

.server-info {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 16px;
}

.status-indicator { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-online { background: #10b981; }
.status-offline { background: #ef4444; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,185,129,.6);} 70% { box-shadow: 0 0 0 10px rgba(16,185,129,0);} 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0);} }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6);} 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0);} 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0);} }
.status-online { animation: pulse 2s infinite; }
.status-offline { animation: pulse-red 2s infinite; }

/* Dark theme overrides — 2025-10-20 */
[data-theme="dark"] {
	/* Deep blue background */
	--bg: #0a1e3a;
	/* Use lilac accents instead of red */
	--red: #a78bfa;
	--blue: #a78bfa;
	--blue-700: #8b5cf6;
	/* Softer muted and lilac border */
	--muted: #c7c9d1;
	--border: #7c3aed;
}

[data-theme="dark"] .card { background: #0d2a57; border-color: var(--border); color: #ffffff; }
[data-theme="dark"] .btn,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-secondary { background: var(--red) !important; border-color: var(--red) !important; color: #ffffff !important; }
[data-theme="dark"] .btn:hover,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-secondary:hover { background: #8b5cf6 !important; border-color: #8b5cf6 !important; }
[data-theme="dark"] .modal-dialog { background: #0a1e3a; border-color: var(--border); color: #ffffff; }
/* Keep form components readable in dark mode */
[data-theme="dark"] .form .input { background: #ffffff; }
[data-theme="dark"] .form .input input,
[data-theme="dark"] .form .input select,
[data-theme="dark"] .form .input textarea { color: #111827; }
[data-theme="dark"] .table tbody td { border-bottom-color: rgba(124, 58, 237, 0.2); }

/* ============================ */
/* Mobile nav / burger sidebar  */
/* ============================ */

/* Burger button (hidden by default, visible on small screens) */
.nav-toggle { display: none; background: transparent; border: 0; color: #f3f4f6; cursor: pointer; font-size: 20px; padding: 6px; margin-right: 8px; }
.nav-toggle:focus { outline: 2px solid var(--red); outline-offset: 2px; }

/* Backdrop for mobile sidebar */
.sidebar-backdrop[hidden] { display: none !important; }
.sidebar-backdrop { position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,0.45); z-index: 1000; }

/* Prevent background scroll when nav is open */
body.nav-open { overflow: hidden; }

@media (max-width: 900px) {
	/* Show burger button on small screens */
	.nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

	/* Convert sidebar to off-canvas drawer */
	.sidebar {
		position: fixed;
		top: 56px; /* below topbar */
		left: 0;
		height: calc(100vh - 56px);
		width: 260px;
		transform: translateX(-100%);
		transition: transform 0.25s ease-in-out;
		z-index: 1001;
	}
	.sidebar.open { transform: translateX(0); }

	/* Content takes full width under topbar */
	.mainwrap { position: relative; }
}

/* Force card grids to stack on mobile */
@media (max-width: 900px) {
	.grid { grid-template-columns: 1fr !important; }
	.grid.cols-2,
	.grid.cols-3,
	.grid.cols-4,
	.grid.cols-5 { grid-template-columns: 1fr !important; }
}
