:root{
  --green:#346739;
  --green-soft:#e8f5f0;
  --text:#1f2937;
  --muted:#6b7280;
  --bg: linear-gradient(135deg,#f8fffc,#eefaf3);
  --card:#ffffff;
  --border:#e5e7eb;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:'Roboto',Segoe UI,Arial;
  background: var(--bg);
  color:var(--text);

  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* ===== TOPBAR ===== */
.topbar{
  background:var(--green);
  color:#fff;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 22px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand .logo{
  width:34px;height:34px;
  border-radius:8px;
  background:#ffffff20;
  display:flex;align-items:center;justify-content:center;
}
.brand .title{
  font-weight:700;
}
.brand .sub{
  font-size:12px;opacity:.85;
}

.top-right{
  display:flex;align-items:center;gap:20px;
}
.badge{
  background:#ffffff20;
  padding:6px 12px;
  border-radius:20px;
  font-size:13px;
}
.user{
  display:flex;align-items:center;gap:10px;
}
.avatar{
  width:34px;height:34px;border-radius:50%;
  background:#22c55e;
  display:flex;align-items:center;justify-content:center;
  font-weight:bold;
}

/* ===== CONTENT ===== */
.container{
  padding:20px 28px;
}
.page-title{
  font-size:18px;
  font-weight:500;
  margin-bottom:20px;
  color:#374151;
}

/* ===== GRID ===== */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(320px,1fr));
  gap:22px;
}

/* ===== CARD ===== */
.card {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 16px;
    padding: 18px;
    border: 1px solid #a7f3d0;
    border-left: 8px solid #16a34a;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.08);
    transition: 0.25s;
}

/* hover xịn hơn */
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(22, 163, 74, 0.18);
    border-color: #22c55e;
}

/* HEADER (icon + title) */
.card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}


.card-icon img {
    width: 60px;
    height: 60px;
}

/* TITLE */
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #14532d; /* xanh đậm ESG */
}

/* DESCRIPTION */
.card-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 10px 0 14px;
}

/* FOOTER */
.card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.card-footer div {
    background:#f0fdf4;
    color:#166534;
    padding:2px 8px;
    border-radius:6px;
    font-size:12px;
}

.card-footer span {
    color: #0f6d4d;
    font-weight: 600;
}

/* footer */
.footer{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  color:#9ca3af;
}
.footer span{
  color:var(--green);
  font-weight:600;
}

/* button link style */
.link{
  color:#fff;
  text-decoration:none;
  font-size:13px;
}
/* ===== ADMIN PAGE ===== */

.admin-container{
    padding:20px 28px;
}

.admin-header{
    font-size:20px;
    margin-bottom:20px;
    font-weight:600;
}

/* form create */
.form-card{
    background:#fff;
    padding:20px;
    border-radius:12px;
    border:1px solid #e5e7eb;
    margin-bottom:25px;
}

.form-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.form-row input,
.form-row textarea{
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
    flex:1;
}

.form-row textarea{
    min-height:60px;
}

.btn{
    background:#0f6d4d;
    color:#fff;
    border:none;
    padding:10px 16px;
    border-radius:8px;
    cursor:pointer;
}

.btn-danger{
    background:#ef4444;
}

/* list app */
.app-admin-card{
    background:#fff;
    border-radius:12px;
    border:1px solid #e5e7eb;
    padding:15px;
    margin-bottom:15px;
}

.app-admin-card img{
    width:40px;
    margin-bottom:10px;
}
.icon img{
    width:24px;
    height:24px;
}
  
/* ===== PERMISSION PAGE ===== */

.permission-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
    gap:18px;
}

.permission-card{
    border:2px solid #e5e7eb;
    border-radius:14px;
    padding:16px;
    cursor:pointer;
    transition:0.2s;
    background:#fff;
}

.permission-card:hover{
    border-color:var(--green);
    box-shadow:0 8px 20px rgba(0,0,0,0.08);
}

/* khi được chọn */
.permission-card.active{
    border-color:var(--green);
    background:#e8f5f0;
}

/* ẩn checkbox */
.permission-card input{
    display:none;
}
.btn-logout{
    background:#ef4444;
    color:#fff;
    padding:8px 14px;
    border-radius:8px;
    text-decoration:none;
    font-size:13px;
    font-weight:500;
}

.btn-logout:hover{
    background:#dc2626;
}
.card:hover span{
    text-decoration:underline;
}
/* ===== HEADER SECTION ===== */

.section-header{
    background: linear-gradient(135deg,#f0fdf4,#dcfce7);
    border:1px solid #bbf7d0;
    padding:18px 22px;
    border-radius:14px;
    margin-bottom:20px;
}

.section-left{
    display:flex;
    align-items:center;
    gap:14px;
}

.section-icon{
    width:46px;
    height:46px;
    border-radius:12px;
    background: linear-gradient(135deg,#16a34a,#22c55e);
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:20px;
}

.section-title{
    font-size:16px;
    font-weight:700;
    color:#14532d;
}

.section-sub{
    font-size:13px;
    color:#6b7280;
}
/* ===== MOBILE RESPONSIVE ===== */

@media (max-width: 768px){

    /* TOPBAR xuống dòng */
    .topbar{
        flex-direction: column;
        align-items: flex-start;
        gap:10px;
    }

    .top-right{
        flex-wrap: wrap;
        gap:10px;
        width:100%;
    }

    .badge{
        font-size:12px;
    }

    /* USER nhỏ lại */
    .user{
        gap:6px;
    }

    .avatar{
        width:28px;
        height:28px;
        font-size:12px;
    }

    /* HEADER SECTION */
    .section-header{
        padding:14px;
    }

    .section-title{
        font-size:14px;
    }

    /* GRID 1 CỘT */
    .grid{
        grid-template-columns: 1fr;
        gap:16px;
    }

    /* CARD */
    .card{
        padding:14px;
    }

    .card-header{
        gap:10px;
    }

    /* ICON nhỏ lại */
    .card-icon img{
        width:40px;
        height:40px;
    }

    /* TITLE */
    .card-title{
        font-size:14px;
    }

    /* DESC */
    .card-desc{
        font-size:13px;
    }

    /* FOOTER */
    .card-footer{
        font-size:12px;
    }

    /* BUTTON LOGOUT */
    .btn-logout{
        padding:6px 10px;
        font-size:12px;
    }
}
/* ===== FOOTER ===== */

.footer-main{
    margin-top:30px;
    padding:16px 20px;
    text-align:center;
    margin-top:0; /* bỏ margin */
    background:#f0fdf4;
    border-top:1px solid #bbf7d0;
}

.footer-content{
    display:flex;
    font-size:12px;
    opacity:0.85;
    justify-content:center;
    align-items:center;
    gap:6px;
}

.footer-content span{
    color:#166534;
    font-weight:600;
}
@media (max-width:768px){
    .footer-content{
        flex-direction:column;
        gap:6px;
        text-align:center;
    }
}
.main-content{
    flex:1;
    padding:20px 28px;
}

/* ===== USER MENU ===== */
.user-menu{
    position: relative;
}

/* dropdown animation */
.dropdown{
    position: absolute;
    right: 0;
    top: 60px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    min-width: 220px;
    overflow: hidden;
    z-index: 999;

    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    pointer-events: none;
    transition: all 0.25s ease;
}

.dropdown.show{
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* item */
.dropdown a{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s;
}

.dropdown a:hover{
    background: #f3f4f6;
    padding-left: 20px;
}

/* logout */
.dropdown a.logout{
    color: #ef4444;
    font-weight: 600;
}

/* ===== MOBILE ===== */
@media (max-width: 768px){

    .topbar{
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .top-right{
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 10px;
    }

    .dropdown{
        right: 10px;
        top: 55px;
        width: 90vw;
        border-radius: 14px;
    }

    .dropdown a{
        padding: 14px;
        font-size: 15px;
    }
}