:root{
  --blue:#1f5f99;
  --blue-light:#2f7dc4;
  --blue-soft:#edf5ff;
  --green:#137333;
  --green-soft:#e8f8ef;
  --white:#ffffff;
  --text:#1e293b;
  --muted:#64748b;
  --border:#dbe5f1;
  --red:#d94b4b;
  --red-soft:#fff0f0;
  --shadow:0 6px 18px rgba(15, 23, 42, .08);
}

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

body{
  font-family:Arial, Helvetica, sans-serif;
  background:#f4f8fc;
  color:var(--text);
  min-height:100vh;
  line-height:1.5;
}

a{
  color:var(--blue);
}

a:hover{
  color:var(--blue-light);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible{
  outline:3px solid rgba(47, 125, 196, .35);
  outline-offset:2px;
}

/* HEADER */

.site-header,
header{
  background:#fff;
  border-bottom:1px solid var(--border);
}

.header-inner{
  max-width:1400px;
  margin:auto;
  padding:12px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.logo-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.logo{
  width:58px;
  height:58px;
  border-radius:14px;
  overflow:hidden;
  background:var(--blue-soft);
  flex-shrink:0;
}

.logo img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.site-title{
  font-size:28px;
  font-weight:800;
  color:var(--blue);
  white-space:nowrap;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

.top-icon{
  text-decoration:none;
  color:var(--blue);
  font-size:16px;
  font-weight:800;
  white-space:nowrap;
  padding:8px 10px;
  border-radius:8px;
}

.top-icon:hover{
  background:var(--blue-soft);
  text-decoration:none;
}

.menu-btn{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-width:52px;
  height:42px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  color:var(--blue);
  font-size:15px;
  font-weight:800;
  cursor:pointer;
  line-height:1;
}

/* NAV */

.main-nav{
  display:none !important;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:14px;
  background:#fff;
  border-bottom:1px solid var(--border);
}

.main-nav.nav-open{
  display:flex !important;
}

.main-nav a{
  color:var(--blue);
  text-decoration:none;
  font-size:20px;
  font-weight:800;
  padding:10px 14px;
  border-radius:8px;
  width:min(100%, 420px);
  text-align:center;
}

.main-nav a:hover{
  background:var(--blue-soft);
}

/* CARDS */

.card{
  background:#fff;
  border-radius:8px;
  padding:24px;
  box-shadow:var(--shadow);
}

/* BUTTONS */

.btn{
  display:inline-block;
  padding:12px 18px;
  border:none;
  border-radius:8px;
  background:var(--blue);
  color:#fff;
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  text-align:center;
}

.btn:hover{
  background:var(--blue-light);
  color:#fff;
}

.btn:disabled{
  cursor:not-allowed;
  opacity:.65;
}

.btn-small{
  padding:10px 14px;
}

/* FORMS */

.form-group{
  margin-bottom:14px;
}

.form-group label{
  display:block;
  margin-bottom:6px;
}

.form-group input,
.form-group textarea{
  width:100%;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  font-family:inherit;
  font-size:1rem;
}

.form-group textarea{
  resize:vertical;
}

.check-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin:0 0 18px;
}

.check-row input{
  margin-top:4px;
}

.status-message,
.request-alert{
  margin:14px 0;
  padding:12px 14px;
  border-radius:8px;
  font-weight:700;
}

.status-message:empty,
.request-alert:empty{
  display:none;
}

.status-info{
  background:var(--blue-soft);
  color:var(--blue);
  border:1px solid #cfe4fb;
}

.status-success,
.request-alert.success{
  background:var(--green-soft);
  color:var(--green);
  border:1px solid #b7e4c7;
}

.status-error,
.request-alert.error{
  background:var(--red-soft);
  color:#b42318;
  border:1px solid #f3b5b5;
}

/* INDEX */

.page{
  max-width:1400px;
  margin:30px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:320px 1fr 320px;
  gap:24px;
}

.page-intro{
  max-width:1400px;
  margin:30px auto 0;
  padding:24px 18px;
}

.page-intro p{
  margin:6px 0 16px;
}

.login-links{
  margin-top:20px;
  text-align:center;
}

.login-links a{
  display:block;
  margin-top:10px;
  text-decoration:none;
  color:var(--blue);
}

.announcement{
  padding:12px;
  background:#fff4f4;
  border-left:4px solid var(--red);
  border-radius:8px;
  margin-bottom:12px;
}

/* DASHBOARD */

.dashboard-shell{
  max-width:1400px;
  margin:30px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
}

.dashboard-profile{
  text-align:center;
}

.avatar-circle{
  width:140px;
  height:140px;
  border-radius:50%;
  overflow:hidden;
  margin:0 auto 16px;
  border:4px solid var(--blue-soft);
}

.avatar-circle img{
  width:100%;
  height:100%;
  object-fit:cover;
}

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

.profile-mini{
  margin:18px 0;
  text-align:left;
}

.manage-card{
  margin-bottom:24px;
}

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

.manage-box{
  text-decoration:none;
  color:inherit;
  background:var(--blue-soft);
  border-radius:8px;
  padding:18px;
  border:1px solid transparent;
}

.manage-box:hover,
.request-box:hover,
.community-card:hover{
  border-color:#bfd9f5;
  transform:translateY(-1px);
}

.manage-box strong{
  display:block;
  margin-bottom:8px;
}

.requests-card{
  grid-column:2;
}

.request-links{
  display:grid;
  gap:16px;
}

.request-box{
  text-decoration:none;
  background:var(--blue-soft);
  padding:18px;
  border-radius:8px;
  color:var(--text);
  font-weight:600;
  border:1px solid transparent;
}

/* NOTIFICATIONS */

.notification-card{
  padding:16px;
  border:1px solid var(--border);
  border-left:4px solid var(--blue);
  border-radius:8px;
  margin-bottom:14px;
  background:#fff;
}

.notification-card.is-read{
  opacity:.7;
}

.notification-card h3{
  color:var(--blue);
  margin-bottom:8px;
}

/* FOOTER */

footer{
  margin-top:40px;
  text-align:center;
  padding:20px;
  background:#fff;
  border-top:1px solid var(--border);
}

footer a{
  text-decoration:none;
  color:var(--blue);
  margin:0 10px;
}

/* RESPONSIVE */

@media(max-width:1000px){
  .page,
  .dashboard-shell{
    grid-template-columns:1fr;
  }

  .requests-card{
    grid-column:auto;
  }
}

@media(max-width:600px){
  .header-inner{
    padding:10px;
    gap:8px;
  }

  .logo{
    width:48px;
    height:48px;
    border-radius:12px;
  }

  .site-title{
    font-size:22px;
  }

  .top-actions{
    gap:6px;
  }

  .top-icon{
    font-size:15px;
  }

  .bell-link{
    font-size:19px;
  }

  .menu-btn{
    min-width:50px;
    height:38px;
    font-size:14px;
  }

  .main-nav a{
    font-size:18px;
  }

  .card{
    padding:18px;
  }
}

.community-layout{
  max-width:1400px;
  margin:30px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:24px;
}

.community-side{
  display:grid;
  gap:16px;
}

.info-block h3{
  color:var(--blue);
  margin-bottom:10px;
}

.community-grid{
  max-width:1400px;
  margin:30px auto;
  padding:0 16px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:22px;
}

.community-card{
  background:#fff;
  border-radius:8px;
  overflow:hidden;
  box-shadow:var(--shadow);
  text-decoration:none;
  color:inherit;
  border:1px solid transparent;
  transition:border-color .15s ease, transform .15s ease;
}

.community-banner{
  height:120px;
  background:#dbeafe;
}

.community-banner img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.community-card-body{
  padding:18px;
}

.community-photo{
  width:72px;
  height:72px;
  border-radius:50%;
  overflow:hidden;
  border:4px solid #fff;
  margin-top:-54px;
  background:#edf5ff;
}

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

.community-hero{
  max-width:1400px;
  margin:30px auto 0;
  padding:0 16px;
}

.community-hero-banner{
  height:260px;
  border-radius:8px;
  overflow:hidden;
  background:#dbeafe;
}

.community-hero-banner img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.community-hero-info{
  background:#fff;
  margin:-48px 24px 0;
  position:relative;
  border-radius:8px;
  padding:20px;
  box-shadow:var(--shadow);
}

.community-hero-photo{
  width:96px;
  height:96px;
  border-radius:50%;
  overflow:hidden;
  border:5px solid #fff;
  background:#edf5ff;
}

.community-hero-photo img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.post-box textarea{
  min-height:120px;
}

.post-box + .feed-title,
.feed-title{
  margin:24px 0 14px;
}

.post-card{
  background:#fff;
  border-radius:8px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 4px 14px rgba(15,23,42,.06);
}

.manage-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:16px;
}

.manage-tile{
  background:var(--blue-soft);
  border-radius:8px;
  padding:18px;
}

.manage-tile h3{
  color:var(--blue);
  margin-bottom:8px;
}

@media(max-width:900px){
  .community-layout{
    grid-template-columns:1fr;
  }

  .community-hero-banner{
    height:190px;
  }

  .community-hero-info{
    margin:-35px 12px 0;
  }
}

.settings-avatar{
  width:100px;
  height:100px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  margin:15px auto;
  border:4px solid #2f6fa3;
  box-shadow:0 4px 12px rgba(0,0,0,.15);
}
