/* DepEd Mathematics Instructional Supervision System
 * Official Stylesheet - DepEd Color Theme (Navy Blue, Gold, Slate)
 */

:root {
    --deped-blue: #0f2b5c;
    --deped-blue-light: #1e40af;
    --deped-gold: #f59e0b;
    --deped-gold-light: #fbbf24;
    --slate-bg: #f8fafc;
    --slate-border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--slate-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* HEADER & NAVBAR */
.main-header {
    background: linear-gradient(135deg, #091e42 0%, #0f2b5c 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.deped-seal {
    background: var(--deped-gold);
    color: var(--deped-blue);
    font-size: 1.5rem;
    padding: 0.6rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deped-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--deped-gold-light);
    font-weight: 700;
}

.system-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--deped-gold);
    color: var(--deped-blue);
    font-weight: 900;
    font-size: 0.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.user-role {
    font-size: 0.7rem;
    color: #94a3b8;
}

/* FLOATED MODERN NAVIGATION BAR */
.main-nav {
    background: transparent;
    padding: 0.75rem 0 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
}

.nav-floating-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 10px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
    overflow-x: auto;
}

.nav-item {
    color: #cbd5e1;
    text-decoration: none;
    padding: 0.55rem 1.1rem;
    font-size: 0.825rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 30px;
    border-bottom: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.nav-item.active {
    color: #0f2b5c;
    background: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
    font-weight: 800;
}

/* LAYOUT & CONTAINERS */
.page-container {
    max-width: 1200px;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--slate-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 700;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--deped-blue);
    margin: 0.25rem 0;
}

.stat-max {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-sub {
    font-size: 0.75rem;
}

/* CARDS & TABLES */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--slate-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--slate-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--deped-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.25rem;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-2-col { grid-template-columns: 1fr; }
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem;
}

.table th, .table td {
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--slate-border);
}

.table th {
    background: #f1f5f9;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    font-size: 0.7rem;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group.full-width {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-group.full-width { grid-column: span 1; }
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-control {
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.825rem;
    outline: none;
    transition: border 0.2s;
}

.form-control:focus {
    border-color: var(--deped-blue-light);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.rubric-header {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--deped-blue);
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--deped-gold);
}

/* BUTTONS & BADGES */
.btn {
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-block { width: 100%; display: flex; }
.btn-primary { background: var(--deped-blue); color: white; }
.btn-primary:hover { background: #0a1e42; }
.btn-secondary { background: var(--deped-gold); color: var(--deped-blue); }
.btn-secondary:hover { background: var(--deped-gold-light); }
.btn-outline { background: transparent; border: 1px solid #cbd5e1; color: var(--text-main); }
.btn-outline:hover { background: #f1f5f9; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.75rem; }

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #dbeafe; color: #1e40af; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.825rem;
    margin-bottom: 1rem;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }

.text-red { color: var(--danger); }
.text-blue { color: var(--deped-blue-light); }
.text-gold { color: var(--deped-gold); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.775rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.space-y > * + * { margin-top: 0.75rem; }
.mt-20 { margin-top: 1.25rem; }
.text-right { text-align: right; }

/* UNIVERSAL MODERN POPUP MODAL SYSTEM */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 30, 66, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease-in-out;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    transform: scale(0.92);
    transition: transform 0.25s ease-in-out;
    overflow: hidden;
    border: 1px solid var(--slate-border);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.1rem 1.5rem;
    background: var(--deped-blue);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header .card-title {
    color: #ffffff;
    margin: 0;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 1.35rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #ffffff;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* FOOTER */
.main-footer {
    background: #091e42;
    color: #94a3b8;
    padding: 1.25rem 0;
    font-size: 0.75rem;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-subtext { font-size: 0.7rem; color: #64748b; }
/* DIGITAL ON-SCREEN SIGNATURE CANVAS */
.sig-canvas-wrapper {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    touch-action: none;
    margin-top: 0.35rem;
}

.sig-canvas {
    width: 100%;
    height: 140px;
    border-radius: 6px;
    cursor: crosshair;
}

.sig-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
}