* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

body {
    background: #f3f6fb;
    color: #172033;
}

a {
    text-decoration: none;
}

/* Shared clickable elements */
.btn-primary,
.header-btn,
.toolbar-btn,
.panel-btn,
.table-btn,
.dashboard-dark-btn,
.photo-upload-label,
.print-btn {
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.header-btn:hover,
.toolbar-btn:hover,
.panel-btn:hover,
.table-btn:hover,
.dashboard-dark-btn:hover,
.photo-upload-label:hover,
.print-btn:hover {
    transform: translateY(-1px);
}

/* Login */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
}

.login-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.login-card h1 {
    font-size: 34px;
    margin-bottom: 6px;
    color: #0f172a;
    text-align: center;
    font-weight: 800;
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 24px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: #334155;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d8e1ec;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background: #fff;
    color: #172033;
}

.form-group input,
.form-group select {
    height: 40px;
}

.form-group textarea {
    min-height: 70px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.toolbar-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.btn-primary {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-note {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}

.alert.error {
    background: #fee2e2;
    color: #b91c1c;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.info {
    background: #e0f2fe;
    color: #075985;
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 245px;
    background: linear-gradient(180deg, #03112b 0%, #041737 100%);
    color: #fff;
    padding: 18px 16px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    box-shadow: 8px 0 24px rgba(2, 6, 23, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.16);
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-brand-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo-mark {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 14px;
    background: linear-gradient(135deg, #b91c1c, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand-text {
    min-width: 0;
    flex: 1;
}

.sidebar-brand-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-bottom: 2px;
}

.sidebar-brand-subtitle {
    font-size: 12px;
    color: #1d4ed8;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}

.sidebar-brand-small {
    font-size: 10px;
    color: #64748b;
    line-height: 1.35;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    flex: 1 1 auto;
    padding-bottom: calc(var(--portal-footer-height, 110px) + 34px);
}

.sidebar-link {
    color: #ffffff;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 13px 14px;
    border-radius: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.sidebar-link.active {
    background: #dff4ff;
    color: #0f172a;
    border-color: #7dd3fc;
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.18);
}

.sidebar-link.disabled {
    opacity: 0.5;
    cursor: default;
}

.sidebar-icon {
    width: 22px;
    text-align: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: 22px;
    padding: 14px 12px;
    border-top: 1px solid rgba(255,255,255,0.10);
    color: rgba(255,255,255,0.78);
    font-size: 12px;
}

.sidebar-footer small {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,0.58);
}

/* Main Area */
.main-area {
    margin-left: 245px;
    width: calc(100% - 245px);
    min-height: 100vh;
}

.main-header {
    background: #ffffff;
    padding: 18px 24px;
    border-bottom: 1px solid #e5edf7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.main-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.main-subtitle {
    color: #64748b;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-btn {
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.header-btn.primary {
    background: #2563eb;
    color: #fff;
}

.header-btn.danger {
    background: #ef4444;
    color: #fff;
}

.header-btn.light {
    background: #e2e8f0;
    color: #0f172a;
}

.content-area {
    padding: 18px 18px 24px;
    background: #f3f6fb;
}

/* Generic Cards and Headings */
.page-head {
    margin-bottom: 16px;
}

.page-head h2 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.page-head p {
    color: #64748b;
    font-size: 14px;
}

.content-card {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    border: 1px solid #ebf0f7;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 18px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.card-title-row h3 {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

/* Toolbar */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.toggle-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #334155;
}

.toolbar-search {
    flex: 1;
    min-width: 260px;
    height: 40px;
    border: 1px solid #d8e1ec;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    background: #fff;
    outline: none;
}

.toolbar-btn {
    min-height: 40px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 14px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
}

.toolbar-btn.primary {
    background: #2563eb;
    color: #fff;
    cursor: pointer;
}

.toolbar-btn.light {
    background: #e2e8f0;
    color: #0f172a;
}

.toolbar-btn.dark {
    background: #0f172a;
    color: #fff;
}

.toolbar-btn.info {
    background: #e0f2fe;
    color: #075985;
}

.table-count {
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

/* Tables */
.table-shell {
    width: 100%;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
}

.modern-table thead th {
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.modern-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #edf2f7;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background: #f9fbff;
}

.table-photo {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    display: block;
}

.table-photo.noimg {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.badge.success {
    background: #dcfce7;
    color: #166534;
}

.badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.info {
    background: #e0f2fe;
    color: #075985;
}

.action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table-btn {
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    white-space: nowrap;
}

.table-btn.edit {
    background: #dbeafe;
    color: #1d4ed8;
}

.table-btn.delete {
    background: #fee2e2;
    color: #dc2626;
}

.table-btn.warn {
    background: #fef3c7;
    color: #92400e;
}

.table-btn.activate {
    background: #dcfce7;
    color: #166534;
}

.table-btn.info {
    background: #e0f2fe;
    color: #075985;
}

.empty-state {
    text-align: center;
    color: #64748b;
    font-weight: 700;
    padding: 24px !important;
}

/* Student Form */
.student-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 16px;
    align-items: start;
}

.student-main {
    width: 100%;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 12px 14px;
}

.student-grid .full-width {
    grid-column: 1 / -1;
}

.student-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.panel-btn {
    min-width: 110px;
    min-height: 38px;
    border: none;
    border-radius: 7px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    white-space: nowrap;
    line-height: 1;
}

.panel-btn.primary {
    background: #2563eb;
    color: #fff;
}

.panel-btn.warn {
    background: #fef3c7;
    color: #92400e;
}

.panel-btn.info {
    background: #e0f2fe;
    color: #075985;
}

.panel-btn.success {
    background: #dcfce7;
    color: #166534;
}

.panel-btn.light {
    background: #e5e7eb;
    color: #111827;
}

.panel-tip {
    margin-top: 10px;
    color: #64748b;
    font-size: 12px;
}

.student-photo-card {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 14px;
    padding: 12px;
}

.student-photo-card h4 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #0f172a;
}

.photo-preview-box {
    width: 100%;
    height: 210px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.photo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-box span {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.photo-action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.photo-upload-label {
    min-width: 84px;
    min-height: 34px;
    border-radius: 7px;
    background: #e5e7eb;
    color: #111827;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 8px 10px;
    white-space: nowrap;
    line-height: 1;
}

.photo-remove-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #334155;
    margin-top: 10px;
}

.hidden-file {
    display: none;
}

/* PDF / Print */
.pdf-page {
    background: #fff;
    color: #111827;
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
}

.pdf-card {
    border: 2px solid #111827;
    border-radius: 12px;
    padding: 20px;
}

.pdf-title {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.pdf-subtitle {
    text-align: center;
    font-size: 15px;
    margin-bottom: 20px;
    color: #334155;
}

.id-card-box {
    width: 430px;
    border: 2px solid #0f172a;
    border-radius: 14px;
    padding: 18px;
    margin: 20px auto;
}

.id-card-header {
    text-align: center;
    margin-bottom: 14px;
}

.id-card-header h2 {
    font-size: 24px;
    font-weight: 800;
}

.id-card-header p {
    font-size: 13px;
    color: #475569;
}

.id-card-photo {
    width: 120px;
    height: 140px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 auto 16px auto;
}

.id-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.id-card-table {
    width: 100%;
    border-collapse: collapse;
}

.id-card-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.print-btn-wrap {
    text-align: center;
    margin: 15px 0 25px;
}

.print-btn {
    padding: 10px 16px;
    border-radius: 10px;
    background: #2563eb;
    color: #fff;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doc-logo-wrap {
    text-align: center;
    margin-bottom: 10px;
}

.doc-logo {
    max-width: 90px;
    max-height: 90px;
    object-fit: contain;
}

.doc-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    gap: 14px;
}

.doc-footer-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    flex-shrink: 0;
}

.doc-footer-text {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.developer-line {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.enhanced-id-card {
    width: 430px;
    margin: 0 auto;
}

.id-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    background: #f8fafc;
}

.enhanced-certificate {
    max-width: 900px;
    margin: 0 auto;
}

.certificate-header {
    text-align: center;
    margin-bottom: 24px;
}

.certificate-school-line {
    font-size: 14px;
    color: #475569;
    margin-top: 6px;
}

.certificate-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.certificate-info-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 15px;
}

.certificate-info-table td:first-child {
    width: 220px;
}

.certificate-paragraph {
    margin-top: 18px;
    margin-bottom: 34px;
    line-height: 1.8;
    font-size: 16px;
    color: #1f2937;
}

.certificate-sign-row {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.certificate-footer {
    margin-top: 30px;
}

/* Dashboard */
.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.dashboard-page-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
}

.dashboard-page-subtitle {
    color: #64748b;
    font-size: 14px;
}

.dashboard-date-chip {
    background: #ffffff;
    border: 1px solid #e5edf7;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
}

.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.dashboard-stat-card {
    background: #ffffff;
    border: 1px solid #e9eef6;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    padding: 16px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 98px;
}

.dashboard-stat-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    border-bottom: 4px solid rgba(15, 23, 42, 0.12);
}

.dashboard-stat-icon.blue {
    background: #e0f2fe;
    color: #0284c7;
}

.dashboard-stat-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.dashboard-stat-icon.orange {
    background: #fef3c7;
    color: #d97706;
}

.dashboard-stat-icon.pink {
    background: #fce7f3;
    color: #db2777;
}

.dashboard-stat-icon.purple {
    background: #ede9fe;
    color: #7c3aed;
}

.dashboard-stat-icon.red {
    background: #ffe4e6;
    color: #e11d48;
}

.dashboard-stat-icon.indigo {
    background: #e0e7ff;
    color: #4f46e5;
}

.dashboard-stat-content {
    min-width: 0;
}

.dashboard-stat-title {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 700;
}

.dashboard-stat-number {
    font-size: 20px;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 4px;
}

.dashboard-stat-meta {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.dashboard-panels-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.2fr;
    gap: 16px;
    align-items: start;
}

.dashboard-panel-card {
    background: #ffffff;
    border: 1px solid #e9eef6;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    padding: 16px;
}

.dashboard-panel-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.dashboard-panel-subtitle {
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 12px;
}

.dashboard-panel-text {
    color: #475569;
    line-height: 1.7;
    font-size: 14px;
    margin-bottom: 14px;
}

.dashboard-tip-box {
    background: #f8fafc;
    border: 1px solid #e5edf7;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 13px;
}

.dashboard-tip-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e7eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.dashboard-inline-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.dashboard-dark-btn {
    background: #111827;
    color: #ffffff !important;
    border: none;
    border-radius: 10px;
    min-height: 38px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(17, 24, 39, 0.12);
}

.dashboard-dark-btn:hover {
    background: #0b1220;
}

.dashboard-table-compact {
    min-width: 100%;
}

.dashboard-table-compact thead th,
.dashboard-table-compact tbody td {
    text-align: center;
}

/* Attendance submenu */
.sidebar-dropdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    flex-shrink: 0;
}

.sidebar-toggle-btn {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.08);
    outline: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.sidebar-submenu {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding-left: 16px;
    margin-top: 2px;
    width: 100%;
    position: relative;
    z-index: 10;
}

.sidebar-dropdown.open .sidebar-submenu {
    display: flex;
}

.sidebar-sublink {
    color: #ffffff;
    background: transparent;
    padding: 11px 14px;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    width: 100%;
    position: relative;
    z-index: 11;
    pointer-events: auto;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-sublink:hover {
    background: rgba(255,255,255,0.10);
}

.sidebar-sublink.active {
    background: rgba(223, 244, 255, 0.16);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(14, 165, 233, 0.12);
}

.sidebar-subicon {
    width: 18px;
    min-width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-caret {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.sidebar-dropdown.open .sidebar-caret {
    transform: rotate(180deg);
}

/* Reports / Letterhead */
.report-letterhead {
    padding: 10px 14px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.report-letterhead-top {
    display: flex;
    gap: 14px;
    align-items: center;
}

.report-letterhead-logo {
    width: 64px;
    height: 64px;
    min-width: 64px;
    background: #ffffff;
    border: 1px solid #dbe4ef;
    border-radius: 12px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.report-letterhead-logo img {
    max-width: 56px;
    max-height: 56px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.report-letterhead-fallback {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7a1f65 0%, #3450ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    font-weight: 800;
}

.report-letterhead-text {
    min-width: 0;
    flex: 1;
}

.report-letterhead-text h1 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 2px;
    color: #0f172a;
    line-height: 1.2;
}

.report-letterhead-text .portal-name,
.report-letterhead-text .report-name,
.print-contact-line,
.print-address-line {
    color: #475569;
    margin-bottom: 2px;
    line-height: 1.3;
    font-size: 13px;
}

.report-name {
    font-weight: 700;
}

.due-report-body,
.collection-report-body {
    padding: 12px 14px 8px;
}

.due-report-stats-grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.report-final-footer {
    border-top: 1px solid #e2e8f0;
    margin-top: 14px;
    padding: 10px 6px 2px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    color: #334155;
    font-size: 12px;
    line-height: 1.2;
}

.report-final-footer .brand-strong {
    font-weight: 800;
    color: #0f172a;
}

.report-final-footer .brand-sep {
    color: #94a3b8;
}

.report-final-footer a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 700;
}

.single-report-footer {
    page-break-inside: avoid;
    break-inside: avoid;
}

.print-hide {
    display: block;
}

/* Fees Phase 2 */
.fee-report-landscape .modern-table {
    min-width: 1000px;
}

.print-landscape {
    overflow: visible;
}

.print-landscape code {
    font-family: Consolas, monospace;
}

/* Print */
@media print {
    .print-btn-wrap {
        display: none;
    }

    body {
        background: #fff !important;
    }

    .pdf-page {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
}

@media (max-width: 1300px) {
    .dashboard-cards-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .dashboard-panels-grid {
        grid-template-columns: 1fr;
    }

    .due-report-stats-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }
}

@media (max-width: 1200px) {
    .student-panel {
        grid-template-columns: 1fr;
    }

    .student-grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
    }

    .main-area {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .content-area {
        padding: 18px;
    }

    .report-letterhead-logo {
        width: 58px;
        height: 58px;
        min-width: 58px;
    }

    .report-letterhead-logo img {
        max-width: 50px;
        max-height: 50px;
    }

    .report-letterhead-text h1 {
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .report-letterhead-top {
        flex-direction: column;
        text-align: center;
    }

    .report-letterhead-logo {
        width: 56px;
        height: 56px;
        min-width: 56px;
    }

    .report-letterhead-logo img {
        max-width: 48px;
        max-height: 48px;
    }

    .report-letterhead-text h1 {
        font-size: 18px;
    }

    .report-letterhead-text .portal-name,
    .report-letterhead-text .report-name,
    .print-contact-line,
    .print-address-line {
        font-size: 12px;
    }
}

@media (max-width: 700px) {
    .admin-layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        padding-bottom: 18px;
    }

    .sidebar-menu {
        padding-bottom: 12px;
    }

    .main-area {
        margin-left: 0;
        width: 100%;
    }

    .main-header {
        display: block;
    }

    .header-actions {
        margin-top: 14px;
    }

    .student-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-search {
        min-width: auto;
        width: 100%;
    }

    .dashboard-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-cards-grid,
    .due-report-stats-grid {
        grid-template-columns: 1fr;
    }

    .header-btn,
    .toolbar-btn,
    .panel-btn,
    .dashboard-dark-btn {
        width: 100%;
        justify-content: center;
    }
}

@media print {
    body {
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    aside,
    .main-header,
    .header-actions,
    .dashboard-topbar,
    .content-card:first-of-type,
    .toolbar,
    .dashboard-date-chip,
    .sidebar-footer,
    .sidebar-brand-card,
    .no-print,
    .print-hide,
    .mobile-menu-btn,
    .mobile-actions-btn,
    .mobile-sidebar-overlay {
        display: none !important;
    }

    .admin-layout {
        display: block !important;
    }

    .main-area {
        margin-left: 0 !important;
        width: 100% !important;
        min-height: auto !important;
    }

    .content-area {
        padding: 0 !important;
        background: #ffffff !important;
    }

    .content-card,
    .dashboard-stat-card,
    .dashboard-panel-card {
        box-shadow: none !important;
        border: 1px solid #d1d5db !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .dashboard-cards-grid,
    .due-report-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .modern-table {
        min-width: 100% !important;
    }

    .table-shell {
        overflow: visible !important;
    }

    .toolbar-btn,
    button,
    .header-btn {
        display: none !important;
    }

    a {
        text-decoration: none !important;
        color: #000 !important;
    }

    .print-landscape {
        width: 100% !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
    }

    .print-landscape .modern-table {
        min-width: 100% !important;
        font-size: 11px;
    }

    .print-landscape .modern-table thead th,
    .print-landscape .modern-table tbody td {
        padding: 6px 5px !important;
    }

    .report-letterhead {
        margin-bottom: 8px;
        padding: 0 0 8px !important;
    }

    .report-letterhead-logo {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        padding: 3px !important;
        border-radius: 10px !important;
    }

    .report-letterhead-logo img {
        max-width: 44px !important;
        max-height: 44px !important;
    }

    .report-letterhead-fallback {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }

    .report-letterhead-text h1 {
        font-size: 17px !important;
        margin-bottom: 1px !important;
    }

    .report-letterhead-text .portal-name,
    .report-letterhead-text .report-name,
    .print-contact-line,
    .print-address-line {
        font-size: 11px !important;
        margin-bottom: 1px !important;
        line-height: 1.2 !important;
    }

    .report-summary-cards {
        display: none !important;
    }

    .single-report-footer,
    .report-final-footer {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .report-final-footer {
        margin-top: 10px !important;
        padding-top: 8px !important;
        font-size: 10.5px !important;
    }

    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}

/* Exam & Result Module */
.exam-helper-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.exam-helper-strip > div {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
    color: #334155;
    font-weight: 700;
}

.exam-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 10px;
}

.exam-summary-box {
    border: 1px solid #dbe5f1;
    border-radius: 14px;
    background: #f8fbff;
    padding: 14px;
    text-align: center;
}

.exam-summary-title {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 6px;
}

.exam-summary-number {
    font-size: 22px;
    color: #0f172a;
    font-weight: 800;
}

.exam-result-card-page .modern-table {
    min-width: 100%;
}

@media (max-width: 700px) {
    .exam-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .exam-helper-strip > div {
        width: 100%;
    }
}
/* Portal Split Login */
.portal-login-body {
    min-height: 100vh;
    background: #eef3fb;
}
.portal-login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.12fr 0.88fr;
}
.portal-login-brand {
    background: linear-gradient(135deg, #07142d 0%, #102b66 55%, #2144a3 100%);
    color: #fff;
    padding: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-login-brand-inner { max-width: 620px; }
.portal-login-logo-wrap { width: 108px; height: 108px; background: #fff; border-radius: 22px; display:flex; align-items:center; justify-content:center; overflow:hidden; margin-bottom:24px; box-shadow:0 18px 44px rgba(0,0,0,.22); }
.portal-login-logo-wrap img { max-width:90px; max-height:90px; object-fit:contain; }
.portal-login-logo-fallback { width:84px; height:84px; border-radius:20px; background:linear-gradient(135deg,#7a1f65 0%,#3450ff 100%); color:#fff; display:flex; align-items:center; justify-content:center; font-size:26px; font-weight:800; }
.portal-login-kicker { display:inline-flex; min-height:34px; align-items:center; padding:0 14px; border-radius:999px; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.18); margin-bottom:14px; font-size:13px; font-weight:800; }
.portal-login-brand h1 { font-size:42px; line-height:1.1; margin-bottom:10px; font-weight:800; }
.portal-login-bigline { font-size:30px; font-weight:800; margin-bottom:8px; }
.portal-login-subline { font-size:21px; font-weight:700; color:#dbeafe; margin-bottom:18px; }
.portal-login-brand p { font-size:16px; line-height:1.85; color:rgba(255,255,255,.92); margin-bottom:18px; }
.portal-login-points { list-style:none; display:grid; gap:12px; }
.portal-login-points li { display:flex; gap:10px; align-items:flex-start; line-height:1.6; font-size:15px; }
.portal-login-points li::before { content:"✓"; width:22px; min-width:22px; height:22px; border-radius:999px; display:inline-flex; align-items:center; justify-content:center; background:rgba(255,255,255,.16); font-size:12px; font-weight:800; margin-top:2px; }
.portal-login-footer-note { display:flex; flex-wrap:wrap; gap:10px; margin-top:24px; color:rgba(255,255,255,.82); font-size:13px; line-height:1.7; }
.portal-login-panel { padding:28px; display:flex; align-items:center; justify-content:center; }
.portal-login-card { width:100%; max-width:460px; background:#fff; border:1px solid #e5edf7; border-radius:24px; padding:30px; box-shadow:0 16px 40px rgba(15,23,42,.09); }
.portal-login-card-head { margin-bottom:20px; }
.portal-login-card-head h2 { font-size:30px; font-weight:800; color:#0f172a; margin-bottom:4px; }
.portal-login-card-head p { font-size:14px; color:#64748b; }
.portal-login-switch { margin-top:18px; text-align:center; }
.portal-login-switch a { color:#1d4ed8; font-weight:700; }

/* Teacher Portal */
.teacher-portal-page { background:#f3f6fb; }
.teacher-portal-shell { min-height:100vh; display:flex; }
.teacher-portal-sidebar { width:270px; min-width:270px; background:linear-gradient(180deg,#07142d 0%,#0f2556 100%); color:#fff; padding:18px 16px; display:flex; flex-direction:column; position:fixed; left:0; top:0; bottom:0; overflow-y:auto; }
.teacher-portal-brand { display:flex; align-items:center; gap:12px; background:rgba(255,255,255,.08); border-radius:18px; padding:12px; margin-bottom:16px; }
.teacher-portal-logo { width:58px; height:58px; border-radius:14px; background:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.teacher-portal-logo img { max-width:46px; max-height:46px; object-fit:contain; }
.teacher-portal-brand-title { font-size:15px; font-weight:800; }
.teacher-portal-brand-subtitle { font-size:12px; color:#c7d2fe; }
.teacher-portal-nav { display:flex; flex-direction:column; gap:8px; flex:1 1 auto; }
.teacher-portal-nav a { display:flex; align-items:center; min-height:46px; padding:0 14px; border-radius:12px; color:#fff; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08); font-weight:700; }
.teacher-portal-nav a.active { background:#dff4ff; color:#0f172a; }
.teacher-portal-sidefoot { margin-top:16px; border-top:1px solid rgba(255,255,255,.12); padding-top:14px; color:rgba(255,255,255,.88); }
.teacher-portal-sidefoot small { display:block; margin-top:6px; color:rgba(255,255,255,.62); }
.teacher-portal-main { margin-left:270px; width:calc(100% - 270px); min-height:100vh; display:flex; flex-direction:column; }
.teacher-portal-topbar { background:#fff; border-bottom:1px solid #e5edf7; padding:14px 18px; display:flex; gap:16px; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:20; }
.teacher-portal-titlebox { display:flex; align-items:center; gap:12px; }
.teacher-portal-titlebox h1 { font-size:24px; margin-bottom:3px; color:#0f172a; }
.teacher-portal-titlebox p { color:#64748b; font-size:14px; }
.teacher-portal-topactions { display:flex; gap:10px; flex-wrap:wrap; }
.teacher-portal-topactions a { min-height:40px; padding:0 14px; display:inline-flex; align-items:center; justify-content:center; border-radius:10px; background:#0f172a; color:#fff; font-weight:700; }
.teacher-portal-topactions a.danger { background:#ef4444; }
.teacher-portal-content { padding:18px; padding-bottom:100px; }
.teacher-portal-footer { margin-top:auto; border-top:1px solid #dbe5f1; background:#fff; padding:12px 16px; display:flex; flex-wrap:wrap; justify-content:center; gap:10px; color:#334155; font-size:13px; }
.teacher-portal-menu-btn { display:none; min-height:42px; min-width:42px; padding:0 12px; border-radius:12px; border:none; background:#0f172a; color:#fff; font-weight:800; cursor:pointer; }

@media (max-width: 980px) {
    .portal-login-shell { grid-template-columns:1fr; }
    .portal-login-brand { padding:26px 20px; }
    .portal-login-panel { padding:18px; }
    .portal-login-brand h1 { font-size:34px; }
    .portal-login-bigline { font-size:24px; }
}
@media (max-width: 900px) {
    .teacher-portal-menu-btn { display:inline-flex; align-items:center; justify-content:center; }
    .teacher-portal-sidebar { transform:translateX(-100%); transition:transform .25s ease; z-index:1200; }
    .teacher-portal-main { margin-left:0; width:100%; }
    body.teacher-portal-nav-open .teacher-portal-sidebar { transform:translateX(0); }
}
@media (max-width: 640px) {
    .portal-login-brand { padding:22px 16px; }
    .portal-login-panel { padding:14px; }
    .portal-login-card { padding:22px 18px; border-radius:18px; }
    .portal-login-brand h1 { font-size:28px; }
    .portal-login-bigline { font-size:21px; }
    .portal-login-subline { font-size:17px; }
    .teacher-portal-topbar { flex-direction:column; align-items:stretch; }
    .teacher-portal-topactions { width:100%; }
    .teacher-portal-topactions a { flex:1 1 calc(50% - 5px); }
}

/* Salary module additions */
.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    font-size: 14px;
    color: #1f2937;
}

.salary-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.salary-analytics-card {
    border-radius: 18px;
    padding: 18px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.salary-analytics-card span {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 10px;
}

.salary-analytics-card strong {
    display: block;
    font-size: 26px;
    line-height: 1.2;
    color: #0f172a;
    margin-bottom: 6px;
}

.salary-analytics-card small {
    display: block;
    color: #475569;
    font-size: 13px;
}

.salary-analytics-card.positive {
    border-color: rgba(16, 185, 129, 0.18);
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.salary-analytics-card.warning {
    border-color: rgba(245, 158, 11, 0.18);
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.salary-analytics-card.danger {
    border-color: rgba(239, 68, 68, 0.18);
    background: linear-gradient(180deg, #fef2f2 0%, #ffffff 100%);
}

.salary-analytics-card.info {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.salary-note-box {
    border: 1px solid #dbe2ea;
    border-radius: 16px;
    padding: 16px 18px;
    background: #f8fafc;
    color: #334155;
}

.salary-note-box p {
    margin: 0 0 8px;
}

.salary-note-box p:last-child {
    margin-bottom: 0;
}

.salary-item-wrap {
    margin-top: 18px;
}

.salary-progress-blocks {
    display: grid;
    gap: 12px;
}

.salary-progress-row {
    display: grid;
    grid-template-columns: 120px 1fr 90px;
    gap: 12px;
    align-items: center;
}

.salary-progress-label,
.salary-progress-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.salary-progress-track {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.salary-progress-fill {
    height: 100%;
    border-radius: 999px;
}

.salary-progress-fill.positive { background: linear-gradient(90deg, #16a34a, #22c55e); }
.salary-progress-fill.warning { background: linear-gradient(90deg, #d97706, #f59e0b); }
.salary-progress-fill.danger { background: linear-gradient(90deg, #dc2626, #ef4444); }
.salary-progress-fill.info { background: linear-gradient(90deg, #2563eb, #3b82f6); }

.salary-slip-section-title {
    margin: 18px 0 10px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

@media (max-width: 768px) {
    .salary-progress-row {
        grid-template-columns: 1fr;
    }

    .checkbox-inline {
        width: 100%;
    }
}

.toolbar-btn.success {
    background: #16a34a;
    color: #ffffff;
}

.salary-bulk-form {
    padding-top: 12px;
    border-top: 1px dashed #dbe2ea;
}

.salary-template-picker {
    min-width: 150px;
}

@media (max-width: 768px) {
    .salary-bulk-form {
        align-items: stretch;
    }

    .salary-bulk-form > * {
        width: 100%;
    }

    .salary-slip-page {
        margin: 10px;
        padding: 16px 14px 120px;
    }

    .salary-slip-footer-fixed {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }
}


/* PWA Install Prompt */
.pwa-install-sheet {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 10050;
    max-width: 460px;
    margin: 0 auto;
    background: linear-gradient(135deg, #07152f 0%, #0f274d 55%, #17386a 100%);
    color: #ffffff;
    border-radius: 24px;
    box-shadow: 0 22px 48px rgba(2, 6, 23, 0.42);
    border: 1px solid rgba(255,255,255,0.14);
    overflow: hidden;
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
    transition: transform .28s ease, opacity .28s ease;
}

.pwa-install-sheet.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-install-sheet-inner {
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
}

.pwa-install-sheet-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pwa-install-sheet-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255,255,255,0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pwa-install-sheet-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-install-sheet-title-wrap {
    flex: 1;
    min-width: 0;
}

.pwa-install-sheet-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.95);
    margin-bottom: 4px;
}

.pwa-install-sheet-title {
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 4px;
    color: #ffffff;
}

.pwa-install-sheet-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(226, 232, 240, 0.94);
    margin: 0;
}

.pwa-install-sheet-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.10);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.pwa-install-sheet-points {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.pwa-install-sheet-point {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 12px 12px;
}

.pwa-install-sheet-point strong {
    display: block;
    font-size: 13px;
    line-height: 1.3;
    color: #ffffff;
    margin-bottom: 4px;
}

.pwa-install-sheet-point span {
    display: block;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(226, 232, 240, 0.92);
}

.pwa-install-sheet-help {
    margin-top: 14px;
    background: rgba(15, 23, 42, 0.34);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 12px 13px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.96);
    display: none;
}

.pwa-install-sheet-help.is-visible {
    display: block;
}

.pwa-install-sheet-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.pwa-install-sheet-btn {
    flex: 1;
    min-height: 48px;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pwa-install-sheet-btn.secondary {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.pwa-install-sheet-btn.primary {
    background: #93c5fd;
    color: #0f172a;
}

.pwa-install-sheet-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.16);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 768px) {
    .pwa-install-sheet {
        left: 10px;
        right: 10px;
        bottom: 10px;
        border-radius: 20px;
        max-width: none;
    }

    .pwa-install-sheet-inner {
        padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .pwa-install-sheet-title {
        font-size: 20px;
    }

    .pwa-install-sheet-subtitle {
        font-size: 13px;
    }

    .pwa-install-sheet-points {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .pwa-install-sheet-actions {
        flex-direction: column-reverse;
    }

    .pwa-install-sheet-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .pwa-install-sheet-top {
        gap: 10px;
    }

    .pwa-install-sheet-logo {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .pwa-install-sheet-title {
        font-size: 18px;
    }

    .pwa-install-sheet-points {
        grid-template-columns: 1fr;
    }

    .pwa-install-sheet-point {
        padding: 11px 11px;
    }
}


/* Parent portal and camera capture additions */
.photo-upload-label.alt { background:#0f766e; color:#fff; border:none; cursor:pointer; }
.camera-capture-wrap { margin-top:12px; background:#eff6ff; border:1px solid #bfdbfe; border-radius:16px; padding:12px; }
.camera-capture-wrap video { width:100%; max-height:280px; border-radius:12px; background:#0f172a; object-fit:cover; }
.camera-capture-actions { margin-top:10px; display:flex; gap:10px; flex-wrap:wrap; }
.portal-login-switch { display:flex; gap:10px; flex-wrap:wrap; justify-content:center; }
.portal-login-switch a { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:10px 14px; border-radius:12px; background:#eff6ff; color:#1d4ed8; text-decoration:none; font-weight:700; }
.parent-admin-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:16px; }
.parent-admin-stat { background:linear-gradient(135deg,#0f172a,#1d4ed8); color:#fff; padding:18px; border-radius:18px; box-shadow:0 12px 26px rgba(15,23,42,.15); }
.parent-admin-stat h4 { margin:0 0 8px; font-size:14px; opacity:.9; }
.parent-admin-stat .value { font-size:28px; font-weight:800; }
.parent-link-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:14px; }
.parent-student-chip { display:inline-flex; align-items:center; gap:8px; padding:7px 10px; border-radius:999px; background:#f1f5f9; margin:4px 6px 0 0; font-size:13px; }
@media (max-width:768px){ .camera-capture-wrap video{max-height:220px;} }


/* Parent Portal Phase 2 */
.parent-page-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.parent-module-grid{grid-template-columns:minmax(360px,1.05fr) minmax(420px,1fr)}
.parent-list-badge{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:700;margin-top:8px}
.parent-list-badge.active{background:#dcfce7;color:#166534}
.parent-list-badge.inactive{background:#fee2e2;color:#991b1b}
.parent-list-badge.important{background:#fef3c7;color:#92400e}
.pp-notice-card{border:1px solid #dbe7ff;border-radius:18px;padding:16px;background:#fbfdff;margin-bottom:14px}
.pp-notice-card.important{border-color:#fbbf24;background:linear-gradient(135deg,#fff9e6,#ffffff)}
.pp-notice-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex-wrap:wrap}
.pp-notice-meta{display:flex;gap:8px;flex-wrap:wrap;color:#64748b;font-size:12px;margin-top:6px}
.pp-badge-important{background:#f59e0b;color:#fff;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
.parent-dashboard-notice{border-left:4px solid #2563eb;background:#f8fbff}
@media (max-width: 900px){.parent-module-grid{grid-template-columns:1fr}}



/* CMG Teacher Portal Mobile Polish v44 */
.teacher-dashboard-two-grid{display:grid;grid-template-columns:1.2fr .8fr;gap:16px;margin-top:16px;align-items:start}
.teacher-dashboard-even-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px;align-items:start}
@media (max-width: 1100px){.teacher-dashboard-two-grid,.teacher-dashboard-even-grid{grid-template-columns:1fr!important}}
@media (max-width: 760px){
  .teacher-portal-page{overflow-x:hidden}
  .teacher-portal-content{padding:14px 12px!important}
  .teacher-portal-titlebox{align-items:flex-start!important}
  .teacher-portal-titlebox h1{font-size:21px!important;line-height:1.2}
  .teacher-portal-titlebox p{font-size:12px!important;line-height:1.45}
  .teacher-portal-topbar{gap:10px!important;padding:12px!important}
  .dashboard-cards-grid{grid-template-columns:1fr!important;gap:12px!important}
  .dashboard-stat-card{min-height:auto!important;padding:13px!important;border-radius:16px!important}
  .dashboard-stat-icon{width:48px!important;height:48px!important;font-size:22px!important;border-radius:14px!important}
  .dashboard-stat-title{font-size:13px!important}
  .dashboard-stat-number{font-size:24px!important}
  .dashboard-stat-meta{font-size:12px!important}
  .dashboard-inline-actions{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  .dashboard-dark-btn{width:100%!important;justify-content:center!important;min-height:42px!important}
  .content-card{border-radius:18px!important;padding:14px!important}
  .card-title-row h3{font-size:18px!important}
  .table-shell{overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .modern-table{min-width:680px!important}
}

/* CMG Teacher Dashboard Visual Upgrade v45 */
.teacher-dash-hero{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:16px;margin-bottom:18px;align-items:stretch}
.teacher-dash-hero-main{background:linear-gradient(135deg,#0f3c8a 0%,#1d4ed8 34%,#0ea5e9 100%);border-radius:24px;padding:22px;box-shadow:0 20px 46px rgba(14,52,136,.22);color:#fff;position:relative;overflow:hidden}
.teacher-dash-hero-main:before,.teacher-dash-hero-main:after{content:"";position:absolute;border-radius:999px;background:rgba(255,255,255,.12)}
.teacher-dash-hero-main:before{width:220px;height:220px;right:-70px;top:-70px}
.teacher-dash-hero-main:after{width:120px;height:120px;right:120px;bottom:-40px}
.teacher-dash-hero-badge{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.18);font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;margin-bottom:10px}
.teacher-dash-hero-main h2{margin:0;font-size:28px;line-height:1.2;color:#fff;font-weight:900;position:relative;z-index:1}
.teacher-dash-hero-main p{margin:10px 0 0;color:rgba(255,255,255,.88);font-size:14px;line-height:1.65;max-width:760px;position:relative;z-index:1}
.teacher-dash-chip-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:18px;position:relative;z-index:1}
.teacher-dash-chip{display:flex;align-items:flex-start;gap:12px;background:rgba(255,255,255,.14);backdrop-filter:blur(6px);border:1px solid rgba(255,255,255,.18);border-radius:18px;padding:14px 15px;min-height:78px}
.teacher-dash-chip .chip-icon{width:42px;height:42px;border-radius:14px;background:rgba(255,255,255,.22);display:flex;align-items:center;justify-content:center;font-size:20px;flex:0 0 auto}
.teacher-dash-chip strong{display:block;font-size:18px;font-weight:900;color:#fff;line-height:1.2}
.teacher-dash-chip small{display:block;margin-top:4px;color:rgba(255,255,255,.82);font-size:12px;line-height:1.35}
.teacher-dash-hero-side{display:flex;align-items:stretch}
.teacher-dash-side-card{background:linear-gradient(180deg,#ffffff 0%,#eff6ff 100%);border:1px solid #dbeafe;border-radius:24px;padding:18px;box-shadow:0 16px 38px rgba(15,23,42,.08);width:100%}
.teacher-dash-side-title{font-size:18px;font-weight:900;color:#0f172a;margin-bottom:14px}
.teacher-focus-points{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.teacher-focus-points li{display:grid;grid-template-columns:48px minmax(0,1fr);gap:12px;align-items:center;background:#fff;border:1px solid #e5eefb;border-radius:18px;padding:12px}
.teacher-focus-points li>span{width:48px;height:48px;border-radius:16px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#dbeafe,#eef2ff);font-size:22px}
.teacher-focus-points strong{display:block;font-size:20px;color:#0f172a;line-height:1.05}
.teacher-focus-points small{display:block;color:#64748b;font-size:12px;line-height:1.45;margin-top:4px}
.teacher-dashboard-card-grid{display:grid;grid-template-columns:repeat(4,minmax(210px,1fr));gap:14px;margin-bottom:18px}
.teacher-dashboard-metric{border-radius:22px;padding:16px;box-shadow:0 14px 34px rgba(15,23,42,.08);position:relative;overflow:hidden;color:#fff;min-height:132px}
.teacher-dashboard-metric:before{content:"";position:absolute;right:-16px;top:-16px;width:96px;height:96px;border-radius:999px;background:rgba(255,255,255,.14)}
.teacher-dashboard-metric:after{content:"";position:absolute;right:38px;top:18px;width:48px;height:48px;border-radius:999px;background:rgba(255,255,255,.08)}
.teacher-dashboard-metric-top{display:flex;align-items:center;justify-content:space-between;gap:10px;position:relative;z-index:1}
.teacher-dashboard-metric-icon{width:54px;height:54px;border-radius:18px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:26px;box-shadow:inset 0 1px 0 rgba(255,255,255,.14)}
.teacher-dashboard-metric-value{font-size:36px;line-height:1;font-weight:900;letter-spacing:-.03em;color:#fff;text-align:right}
.teacher-dashboard-metric-title{margin-top:16px;font-size:18px;font-weight:900;color:#fff;position:relative;z-index:1}
.teacher-dashboard-metric-meta{margin-top:6px;font-size:12px;line-height:1.5;color:rgba(255,255,255,.88);position:relative;z-index:1}
.teacher-dashboard-metric.theme-blue{background:linear-gradient(135deg,#2563eb,#1e3a8a)}
.teacher-dashboard-metric.theme-green{background:linear-gradient(135deg,#16a34a,#047857)}
.teacher-dashboard-metric.theme-violet{background:linear-gradient(135deg,#7c3aed,#4c1d95)}
.teacher-dashboard-metric.theme-orange{background:linear-gradient(135deg,#f59e0b,#b45309)}
.teacher-dashboard-metric.theme-pink{background:linear-gradient(135deg,#ef4444,#be185d)}
.teacher-dashboard-metric.theme-teal{background:linear-gradient(135deg,#0ea5e9,#0f766e)}
.teacher-dashboard-metric.theme-sky{background:linear-gradient(135deg,#06b6d4,#2563eb)}
.teacher-dashboard-metric.theme-amber{background:linear-gradient(135deg,#f59e0b,#d97706)}
.teacher-dashboard-metric.theme-emerald{background:linear-gradient(135deg,#22c55e,#059669)}
.teacher-dashboard-metric.theme-red{background:linear-gradient(135deg,#f43f5e,#b91c1c)}
.teacher-dashboard-metric.theme-lime{background:linear-gradient(135deg,#22c55e,#15803d)}
.teacher-dashboard-metric.theme-rose{background:linear-gradient(135deg,#fb7185,#e11d48)}
.teacher-quick-actions-card{padding:18px 18px 20px;border-radius:22px;background:linear-gradient(180deg,#fff,#f8fbff)}
.teacher-quick-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.teacher-quick-link{display:flex;align-items:center;gap:12px;border-radius:18px;padding:14px;background:#fff;border:1px solid #dbe7ff;box-shadow:0 8px 20px rgba(37,99,235,.08);text-decoration:none;transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
.teacher-quick-link:hover{transform:translateY(-2px);border-color:#93c5fd;box-shadow:0 14px 24px rgba(37,99,235,.14)}
.teacher-quick-icon{width:46px;height:46px;border-radius:15px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);color:#fff;font-size:22px;flex:0 0 auto}
.teacher-quick-text strong{display:block;font-size:15px;font-weight:900;color:#0f172a;line-height:1.3}
.teacher-quick-text small{display:block;margin-top:4px;font-size:12px;line-height:1.45;color:#64748b}
.teacher-dashboard-table{min-width:760px!important}
.table-student-meta strong{display:block;color:#0f172a}
.table-student-meta small{display:block;font-size:12px;color:#64748b;margin-top:3px}
.teacher-inline-progress{display:flex;align-items:center;gap:12px;min-width:180px}
.teacher-inline-progress strong{font-size:13px;color:#0f172a;min-width:58px}
.teacher-inline-progress span{display:block;height:10px;flex:1;background:#e2e8f0;border-radius:999px;overflow:hidden}
.teacher-inline-progress span i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#2563eb,#10b981)}
.teacher-notice-list{display:grid;gap:12px}
.teacher-notice-card{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;padding:14px;border-radius:18px;background:linear-gradient(180deg,#f8fbff,#ffffff);border:1px solid #dbeafe}
.teacher-notice-icon{width:52px;height:52px;border-radius:18px;background:linear-gradient(135deg,#1d4ed8,#0ea5e9);display:flex;align-items:center;justify-content:center;color:#fff;font-size:24px}
.teacher-notice-card strong{display:block;color:#0f172a}
.teacher-notice-card small{display:block;color:#64748b;font-size:12px;margin-top:4px}
.teacher-notice-body{margin-top:8px;color:#475569;font-size:13px;line-height:1.6}
.teacher-mini-badge{display:inline-flex;align-items:center;justify-content:center;padding:6px 10px;border-radius:999px;background:#e0f2fe;color:#075985;font-size:12px;font-weight:800}
.teacher-mini-badge.dark{background:#dbeafe;color:#1e3a8a}
@media (max-width: 1320px){.teacher-dashboard-card-grid{grid-template-columns:repeat(3,minmax(200px,1fr))}.teacher-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 1100px){.teacher-dash-hero{grid-template-columns:1fr}.teacher-dashboard-card-grid{grid-template-columns:repeat(2,minmax(200px,1fr))}}
@media (max-width: 760px){.teacher-dash-hero-main{padding:18px;border-radius:20px}.teacher-dash-hero-main h2{font-size:22px}.teacher-dash-chip-grid{grid-template-columns:1fr}.teacher-dash-side-card{border-radius:20px}.teacher-dashboard-card-grid{grid-template-columns:1fr}.teacher-dashboard-metric{min-height:auto}.teacher-dashboard-metric-value{font-size:30px}.teacher-quick-grid{grid-template-columns:1fr}.teacher-quick-link{padding:12px}.teacher-notice-card{grid-template-columns:46px minmax(0,1fr)}.teacher-notice-icon{width:46px;height:46px;border-radius:14px}.teacher-dashboard-table{min-width:680px!important}}
@media (max-width: 560px){.teacher-dash-hero-main p{font-size:13px}.teacher-focus-points li{grid-template-columns:42px minmax(0,1fr)}.teacher-focus-points li>span{width:42px;height:42px;border-radius:14px;font-size:20px}.teacher-dashboard-metric{padding:14px;border-radius:18px}.teacher-dashboard-metric-title{font-size:17px}.teacher-dashboard-metric-meta{font-size:11px}.teacher-inline-progress{min-width:160px}.teacher-dashboard-table{min-width:620px!important}}
