*{
box-sizing:border-box;
margin:0;
padding:0;
font-family:Tahoma;
}

body{
background:linear-gradient(135deg,#eef4fb,#dfe9f7);
padding:20px;
color:#1455a0;
}

.container{
max-width:1050px;
margin:auto;
background:#fff;
border-radius:25px;
padding:28px;
box-shadow:0 15px 40px rgba(0,0,0,0.1);
}

h1{
margin-bottom:25px;
font-size:28px;
text-align:right;
color:#1455a0;
font-weight:800;
}

.form-grid{
display:grid;
grid-template-columns:1fr 1fr;
gap:18px;
grid-template-areas:
"username role"
"password confirm"
"active active";
}

.field{
display:flex;
flex-direction:column;
text-align:right;
}

.field:nth-child(1){grid-area:username;}
.field:nth-child(2){grid-area:role;}
.field:nth-child(3){grid-area:password;}
.field:nth-child(4){grid-area:confirm;}
.field:nth-child(5){grid-area:active;}

.field label{
margin-bottom:8px;
font-weight:700;
font-size:16px;
color:#1455a0;
}

.field input,
.field select{
width:100%;
height:52px;
min-height:52px;
padding:0 14px;
border-radius:12px;
border:1px solid #cfd8e6;
font-size:17px;
font-weight:600;
background:#fff;
color:#1455a0;
outline:none;
}

.field input:focus,
.field select:focus{
border-color:#1455a0;
box-shadow:0 0 0 3px rgba(20,85,160,0.15);
background:#fff;
}

.field input::placeholder{
color:#9aa9bd;
font-size:15px;
font-weight:400;
}

.active-field{
background:#f8fbff;
border:1px solid #dbe5f1;
border-radius:12px;
padding:14px;
}

.permissions-section{
margin-top:26px;
background:#fff;
border:1px solid #dbe5f1;
border-radius:16px;
padding:24px 26px 26px;
box-shadow:0 10px 28px rgba(20,85,160,0.08);
}

.permissions-section h2{
margin-bottom:20px;
font-size:34px;
text-align:center;
color:#1455a0;
font-weight:800;
}

.permissions-wrap{
width:100%;
overflow-x:auto;
border-radius:10px;
border:1px solid #cbd9ea;
background:#fff;
}

.permissions-wrap table{
width:100%;
border-collapse:collapse;
min-width:820px;
}

.permissions-wrap th,
.permissions-wrap td{
border:1px solid #d6e2f1;
padding:9px 12px;
text-align:center;
font-size:17px;
white-space:nowrap;
}

.permissions-wrap th{
background:linear-gradient(180deg,#1765bd,#0f4f9f);
color:#fff;
font-weight:800;
font-size:18px;
height:46px;
}

.permissions-wrap th:first-child{
background:linear-gradient(180deg,#1765bd,#0f4f9f);
}

.permissions-wrap td{
color:#3f4650;
font-weight:600;
height:42px;
}

.permissions-wrap td:not(:first-child){
background:#fff;
}

.permissions-wrap td:first-child{
text-align:right;
background:#fff;
border-left:1px solid #cbd9ea;
font-size:17px;
padding-right:24px;
}

.permissions-wrap tr:nth-child(even){
background:#f7fbff;
}

.permissions-wrap tr:nth-child(even) td,
.permissions-wrap tr:nth-child(even) td:first-child{
background:#f7fbff;
}

.permissions-wrap tr:hover td,
.permissions-wrap tr:hover td:first-child{
background:#eef6ff;
}

.permissions-wrap input[type="checkbox"]{
width:21px;
height:21px;
accent-color:#2d7fe0;
cursor:pointer;
}

.permissions-wrap .permission-disabled{
background:#eef2f6 !important;
color:#9aa7b7;
position:relative;
}

.permissions-wrap .permission-disabled span{
display:inline-flex;
align-items:center;
justify-content:center;
width:28px;
height:28px;
border-radius:8px;
background:#dbe3ed;
color:#7c8794;
font-weight:900;
}

@media (min-width:701px){
.permissions-wrap table{
table-layout:fixed;
}

.permissions-wrap th:first-child,
.permissions-wrap td:first-child{
width:34%;
border-left:2px solid #c4d4e8;
}

.permissions-wrap th:not(:first-child),
.permissions-wrap td:not(:first-child){
width:22%;
border-right:2px solid #d3dfef;
border-left:2px solid #d3dfef;
}

.permissions-wrap th + th,
.permissions-wrap td + td{
border-right:2px solid #c4d4e8;
}

.permissions-wrap tbody tr{
border-bottom:1px solid #d6e2f1;
}
}

@media (max-width:700px){
.permissions-section{
padding:16px;
}

.permissions-section h2{
font-size:24px;
text-align:right;
margin-bottom:14px;
}

.permissions-wrap th,
.permissions-wrap td{
font-size:15px;
padding:10px;
}
}

.toggle-row{
height:28px;
display:flex;
align-items:center;
gap:10px;
margin-bottom:0 !important;
cursor:pointer;
}

.toggle-row input{
width:20px;
height:20px;
min-height:20px;
accent-color:#2d7fe0;
}

.toggle-row span{
font-size:17px;
font-weight:700;
color:#1455a0;
}

.alert{
margin-bottom:15px;
padding:12px;
border-radius:12px;
font-weight:bold;
text-align:center;
}

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

.error{
background:#fee2e2;
color:#991b1b;
}

.actions{
margin-top:25px;
display:flex;
gap:12px;
justify-content:center;
flex-wrap:wrap;
}

.btn{
padding:13px 28px;
border:none;
border-radius:12px;
font-size:16px;
cursor:pointer;
min-width:130px;
font-weight:bold;
text-decoration:none;
display:inline-flex;
align-items:center;
justify-content:center;
}

.save{
background:#2d7fe0;
color:#fff;
}

.show{
background:#1455a0;
color:#fff;
}

.back{
background:#d8e0ea;
color:#1455a0;
}

.btn:hover{
opacity:.9;
}

@media (max-width:700px){

body{
padding:12px;
}

.container{
padding:20px;
border-radius:20px;
}

h1{
font-size:24px;
}

.form-grid{
grid-template-columns:1fr;
grid-template-areas:
"username"
"role"
"password"
"confirm"
"active";
gap:16px;
}

.field input,
.field select{
height:50px;
min-height:50px;
font-size:16px;
padding:0 12px;
}

.actions{
flex-direction:column;
}

.btn{
width:100%;
}
}