/* Navigation links keep their href while sharing the application's button design. */
body a[href],body a[href]:visited,body a[href].outline,body a[href].download,body .password-bar a[href],body .header-actions a[href]{display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;max-width:100%;min-height:40px;margin:4px 3px 4px 0;padding:10px 15px;border:1px solid var(--wine,#a9003d);border-radius:9px;background:var(--wine,#a9003d);color:#fff;font:inherit;font-weight:700;line-height:1.3;text-align:center;text-decoration:none;white-space:normal;overflow-wrap:anywhere;vertical-align:middle;cursor:pointer;transition:background-color .15s,border-color .15s,box-shadow .15s}
body a[href]:hover,body a[href].outline:hover,body a[href].download:hover,body .password-bar a[href]:hover,body .header-actions a[href]:hover{background:var(--wine2,#8f0034);border-color:var(--wine2,#8f0034);color:#fff;text-decoration:none;box-shadow:0 3px 9px #500d241a}
body a[href]:focus-visible{outline:3px solid #c99b28;outline-offset:3px}
body a[href]:active{box-shadow:inset 0 2px 4px #0002}
body .sidebar nav a[href],body .sidebar nav a[href]:visited{display:flex;justify-content:flex-start;width:100%;margin:0;min-height:42px;padding:10px 12px;background:transparent;border-color:#ffffff35;color:#fff;text-align:left;box-shadow:none}
body .sidebar nav a[href]:hover,body .sidebar nav a[href].active{background:#fff;border-color:#fff;color:var(--wine,#a9003d)}
body td a[href],body .user-actions a[href]{min-height:34px;padding:7px 10px;font-size:12px}
body .user-actions a[href]{display:flex;width:max-content;min-width:135px;margin:4px auto}
body .file-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
body .file-row a[href]{justify-content:flex-start;min-width:0;max-width:100%;overflow-wrap:anywhere}
@media(max-width:700px){body a[href]{max-width:100%}body .header-actions{gap:6px;flex-wrap:wrap}body .password-bar a[href]{margin-right:0}}
@media print{body a[href]{min-height:0;margin:0;padding:0;border:0;background:transparent!important;color:inherit!important;box-shadow:none!important;font-weight:inherit;text-decoration:none}}

.record-actions{min-width:145px}.record-actions>a,.record-actions>button,.record-actions>form{display:flex!important;width:140px!important;box-sizing:border-box;margin:4px 0!important}.record-actions>a,.record-actions>button,.record-actions>form>button{min-height:35px!important;width:140px!important;box-sizing:border-box;justify-content:center;align-items:center;padding:7px 10px!important;font-size:12px!important;line-height:1.3!important;border:1px solid transparent!important}.record-actions form{padding:0!important}.nav-icon{width:20px;height:20px;display:inline-flex;flex-shrink:0;vertical-align:middle}.nav-icon svg{width:20px;height:20px}.sidebar nav a,.side .nav a{display:flex;align-items:center;gap:10px}

/* Keep icon and label on one aligned row in both menus. */
.side .nav button,.sidebar nav a{display:flex!important;align-items:center!important;gap:12px!important;justify-content:flex-start}.nav-icon{align-items:center;justify-content:center;line-height:1}.nav-icon svg{display:block}.template-buttons{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;max-width:100%;overflow-x:auto;padding:2px 0}body .template-buttons a[href]{flex:0 0 auto;white-space:nowrap;padding:8px 6px!important;min-width:0!important;margin:0!important}

/* v1.06: compact record controls, preserving cell/table semantics. */
.class-action-grid,.user-action-grid{display:grid;grid-template-columns:repeat(2,120px);gap:4px;min-width:244px;align-items:start}.class-action-grid>a,.class-action-grid>form,.class-action-grid>form>button,body .student-actions>a,body .student-actions>button{width:120px!important;min-width:0!important;margin:0!important}.class-action-grid>form{display:block!important}.class-action-grid>form>button{margin:0!important}.user-action-grid{grid-template-columns:repeat(2,130px);min-width:264px}.user-action-grid>a,.user-action-grid>button{width:130px!important;min-width:0!important;margin:0!important}.user-action-grid>button[data-reset-password]{white-space:normal}.record-actions.student-actions{min-width:120px}.student-actions>a,.student-actions>button{margin:4px 0!important}
#userContent .table th,#userContent .table td{padding:8px 7px;font-size:13px}#userContent .table{min-width:900px}#userContent{overflow-x:auto}
.class-form{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.class-form label{min-width:0;font-size:13px}.class-form input,.class-form select{width:100%;min-width:0;padding:8px}.class-form .class-save-actions{grid-column:2/4;display:flex;justify-content:flex-end;align-items:end;gap:8px}.classes-table{max-height:calc(70vh + 300px)}.classes-table th,.classes-table td{text-align:left;padding:8px}
.admin-main{max-width:none;padding:0;margin:0 0 24px}.admin-main .forms{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-main .forms>.entry{min-width:0}
#delete-data-panel>.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}#delete-data-panel .delete-school-card{min-width:0}#delete-data-panel .delete-absences-row{display:flex;flex-wrap:nowrap;align-items:end;gap:12px}#delete-data-panel .delete-absences-row>.field{min-width:0;margin:0}#delete-data-panel .delete-absences-row>.field:first-child{flex:0 1 32%;width:32%}#delete-data-panel .delete-absences-row>.field:nth-child(2),#delete-data-panel .delete-absences-row>.field:nth-child(3){flex:0 1 14%;width:14%}#delete-data-panel select,#delete-data-panel input{width:100%;min-width:0}#delete-data-panel .delete-absences-row>button{margin-left:auto;flex-shrink:0}.delete-school-row{display:flex;gap:12px;align-items:end;justify-content:space-between}.delete-school-row>.field{width:25%;min-width:100px;margin:0}.delete-school-row>button{margin-left:auto}
.side{display:flex;flex-direction:column;min-height:100vh}.side>.brand,.side>.nav,.side>.side-note,.side>.collapse-side{flex-shrink:0}.side>.side-note{order:2;margin-bottom:12px}.side>.collapse-side{order:3;margin-top:auto;min-height:40px}
@media(max-width:900px){.admin-main .forms{grid-template-columns:1fr}.class-form{grid-template-columns:1fr 1fr}.class-form .class-save-actions{grid-column:auto}#delete-data-panel>.grid{grid-template-columns:1fr}}
@media(max-width:700px){.class-form{grid-template-columns:1fr}.class-form .class-save-actions{grid-column:1}.side{min-height:100dvh}.delete-school-row>.field{width:55%}#delete-data-panel .delete-absences-row{flex-wrap:wrap}#delete-data-panel .delete-absences-row>.field:first-child{flex-basis:100%;width:100%}#delete-data-panel .delete-absences-row>.field:nth-child(2),#delete-data-panel .delete-absences-row>.field:nth-child(3){flex:1 1 30%;width:30%}.classes-table{overflow-x:auto}}
.user-action-grid>a,.user-action-grid>button{height:46px!important;min-height:46px!important}
#delete-data-panel .delete-school-card{grid-column:auto}

/* v1.08: database download shares the JSON export column. */
.admin-main .backup-panel .backup-actions form:first-child{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:12px}.admin-main .backup-panel .backup-actions form:first-child::before{display:none}.admin-main .backup-panel .backup-actions form:first-child>a[href]{align-self:center;justify-content:center;margin:0;text-align:center;max-width:100%}
#delete-data-panel{container-type:inline-size}#delete-data-panel .delete-absences-row>.field:first-child,#delete-data-panel .delete-school-row>.field{width:calc(32cqw - 12.8px);flex:0 1 calc(32cqw - 12.8px);min-width:0}
@media(max-width:700px){#delete-data-panel .delete-absences-row>.field:first-child{width:100%;flex-basis:100%}#delete-data-panel .delete-school-row>.field{width:calc(100% - 100px);flex-basis:calc(100% - 100px)}}
.admin-main .backup-panel .backup-actions form:first-child>button[type="submit"]{align-self:center;justify-self:center;margin:0}

/* Equal compact action heights and matching pupil/class spacing. */
body .student-actions>a,body .student-actions>button{margin:0!important}body .student-actions>:not(:last-child){margin-bottom:4px!important}
body .user-action-grid>a,body .user-action-grid>button{height:35px!important;min-height:35px!important;padding:7px 6px!important;white-space:nowrap!important}

.management-links{margin-bottom:24px}.management-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.management-grid a[href]{display:flex;align-items:center;justify-content:center;gap:10px;min-height:54px;margin:0}.management-grid svg{flex-shrink:0}
@media(max-width:850px){.management-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.management-grid{grid-template-columns:1fr}}

.user-action-grid > .current-account {
    align-self: center;
    justify-self: center;
    grid-column: 2;
    text-align: center;
}

.page-title-row:has(.management-back),
.aligned-page-actions,
.class-form .class-save-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-title-row:has(.management-back) {
    justify-content: space-between;
}

body .aligned-page-actions > a[href],
body .class-save-actions > a[href],
body .page-title-row > .management-back[href],
body .top .management-back[href] {
    margin: 0;
}
