/* ================= ROOT THEME ================= */
:root{

    /* Brand */
    --primary:#2563eb;
    --primary-dark:#0f172a;
    --accent:#f59e0b;

    /* Text */
    --text:#1e293b;
    --text-light:#64748b;

    /* Backgrounds */
    --bg:#f8fafc;
    --white:#ffffff;

    /* Borders */
    --border:#e2e8f0;
    --border-light:#cbd5e1;

    /* Soft Colors */
    --primary-soft:#eff6ff;
    --accent-soft:#fff7ed;

    /* Status */
    --success:#16a34a;
    --success-soft:#ecfdf5;

    --danger:#dc2626;
    --danger-soft:#fef2f2;

    /* Overlay */
    --overlay:rgba(15,23,42,.55);

    /* Shadows */
    --shadow:
        0 10px 30px rgba(15,23,42,.08);

    --shadow-hover:
        0 20px 40px rgba(15,23,42,.12);

    --shadow-lg:
        0 20px 50px rgba(15,23,42,.15);

    --shadow-blue:
        0 10px 30px rgba(37,99,235,.15);
}
/* ================= RESET ================= */
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

/* ================= GLOBAL ================= */
body{
  font-family:'Inter', sans-serif;
   background:#f8fafc;
  color:var(--text);
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

h1,h2,h3{
  font-family:'Manrope', sans-serif;
}

/* ================= BUTTON SYSTEM ================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 18px;
  border-radius:10px;
  font-size:13px;
  font-weight:600;
  border:none;
  cursor:pointer;
  text-decoration:none;
  transition:0.25s;
}

/* PRIMARY */
.btn-primary{
   background:var(--primary);
}
  color:#fff;
}
.btn-primary:hover{
  background:#2ea9e0;

}

/* GRADIENT */
.btn-gradient{
  background:linear-gradient(
        135deg,
        var(--primary),
        var(--accent)
    );
  color:#fff;
}
.btn-gradient:hover{
  opacity:0.9;

}
.btn:hover{
  transform:translateY(-1px);
}
/* OUTLINE */
.btn-outline{
  background:#fff;
  color:var(--primary);
  border:1px solid var(--border);
}
.btn-outline:hover{
  background:var(--primary);
  color:#fff;
}

/* SMALL */
.btn-sm{
  padding:6px 14px;
  font-size:12px;
}



/* ================= MAIN ================= */
main{
  flex:1;
}


/* ================= FOOTER ================= */

footer{
    margin-top:auto;

    background:#0f172a;

    color:#94a3b8;

    text-align:center;

    padding:22px 15px;

    font-size:13px;

    border-top:1px solid rgba(255,255,255,.05);
}

.footer-link{
    color:#60a5fa;

    text-decoration:none;

    font-weight:600;

    transition:.25s;
}

.footer-link:hover{
    color:#93c5fd;
}

/* ================= BADGE ================= */
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 12px;
  border-radius:999px;
  font-size:11px;
  font-weight:600;
  letter-spacing:0.3px;
  background:var(--primary-soft);
    color:var(--primary);
}

/* ================= FILTER BAR ================= */
.qp-filter{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* ================= DROPDOWN (SELECT) ================= */
.qp-filter select{
  padding:8px 12px;
  border-radius:10px;
  border:1px solid var(--border-light);
  background:var(--white);
  font-size:13px;
  color:var(--text);
  cursor:pointer;
  transition:0.25s;
  min-width:140px;
}

/* hover */
.qp-filter select:hover{
  border-color:var(--primary);
}

/* focus */
.qp-filter select:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--primary-soft);
}


/* ================= TABLE ================= */

.table-wrapper{
  width:100%;
  overflow-x:auto;
}
.qp-table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
}

/* header */
.qp-table thead{
  background:var(--bg);
}
.qp-table thead th{
  position:sticky;
  top:0;
  z-index:1;
}
.qp-table th{
  padding:12px;
  text-align:left;
  font-size:13px;
  font-weight:600;
  color:var(--text);
  border-bottom:1px solid var(--border-light);
}

/* cells */
.qp-table td{
  padding:12px;
  font-size:13px;
  color:var(--text-light);
  border-bottom:1px solid var(--border-light);
}

/* row hover */
.qp-table tbody tr{
  transition:0.2s;
}

.qp-table tbody tr:hover{
  background:var(--primary-soft);
}

/* links inside table */
.qp-table a{
  color:var(--primary);
  font-weight:500;
  text-decoration:none;
}

.qp-table a:hover{
  color:var(--accent);
  text-decoration:underline;
}
/* ================= EMPTY ================= */
.empty{
  background:#fff;
  padding:25px;
  border-radius:12px;
  text-align:center;
  color:var(--text-light);
}

/* ================= FULL PAGE EMPTY ================= */
.empty-page{
  height:80vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

.empty-box{
  text-align:center;
  background:#fff;
  padding:40px;
  border-radius:16px;
  box-shadow:var(--shadow-lg);
}

.empty-icon{
  font-size:48px;
  margin-bottom:10px;
}

/* ================= ACTION BUTTONS ================= */
.action-btn{
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
}

.view-btn{
  background:var(--primary-soft);
  color:var(--primary);
}

.download-btn{
  background:var(--accent-soft);
  color:var(--accent);
}



/* ================= AUTH MODAL ================= */
.auth-modal{
    position:fixed;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;

    opacity:0;
    visibility:hidden;
    transition:0.25s ease;
    z-index:2000;
}

.auth-modal.show{
    opacity:1;
    visibility:visible;
}

/* OVERLAY */
.auth-overlay{
    position:absolute;
    inset:0;
    background:var(--overlay);
    backdrop-filter:blur(4px);
}

/* BOX */
.auth-box{
    position:relative;
    width:360px;
    background:var(--white);

    border-radius:16px;
    padding:30px;

    border:1px solid var(--border);
    box-shadow:var(--shadow-lg);

    transform:translateY(20px) scale(0.96);
    opacity:0;

    transition:0.25s ease;
}

.auth-modal.show .auth-box{
    transform:translateY(0) scale(1);
    opacity:1;
}

/* HEADER */


.auth-header{
    text-align:center;
    margin-bottom:18px;
}

.auth-header h3{
    font-size:24px;
    font-weight:700;

    color:var(--primary-dark);

    margin-bottom:4px;
}

.auth-header p{
    font-size:13px;
    color:var(--text-light);
}


/* FORM */
.auth-form{
    display:flex;
    flex-direction:column;
    gap:12px;
}

/* INPUT */
.auth-input{
    padding:12px;
    border-radius:10px;
    border:1px solid var(--border);
    font-size:14px;
    background:var(--white);
    color:var(--text);

    transition:0.2s;
}

.auth-input:focus{
    outline:none;
    border-color:var(--primary);
    box-shadow:0 0 0 3px var(--primary-soft);
}

/* DIVIDER */
.auth-divider{
    margin:18px 0;
    display:flex;
    align-items:center;
    gap:12px;
}

.auth-divider::before,
.auth-divider::after{
    content:"";
    flex:1;
    height:1px;
    background:var(--border);
}

.auth-divider span{
    font-size:12px;
    color:var(--text-light);
}

/* FOOTER */
.auth-footer{
    text-align:center;
    font-size:13px;
    color:var(--text-light);
}

.auth-footer a{
    color:var(--primary);
    font-weight:600;
    text-decoration:none;
}

.auth-footer a:hover{
    color:var(--accent);
}

/* ERROR */
.auth-error{
    background:var(--danger-soft);
    color:var(--danger);
    padding:8px;
    border-radius:8px;
    font-size:12px;
    text-align:center;
    margin-bottom:10px;
}

/* SUCCESS */
.auth-success{
    background:var(--success-soft);
    color:var(--success);
    padding:8px;
    border-radius:8px;
    font-size:12px;
    margin-bottom:10px;
}
.js-flash{
    padding:12px 14px;
    border-radius:12px;
    font-size:13px;
    font-weight:500;
    text-align:center;
    border:1px solid transparent;
    animation:flashFade .25s ease;
}
@keyframes flashFade{

    from{
        opacity:0;
        transform:translateY(-5px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}
/* USER MENU */
.user-menu{
    display:flex;
    align-items:center;
    gap:12px;
}

/* EMAIL */
.user-email{
  font-size:11px;
  font-weight:600;
  color:#fff;
  background:rgba(255,255,255,0.15);
  padding:4px 10px;
  border-radius:20px;
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* =====================================================
FLASH
===================================================== */

.flash-wrapper{
    min-height:46px;
    margin-bottom:10px;
}

.password-wrapper{
    position:relative;
    width:100%;
}
.password-toggle{
    position:absolute;
    top:50%;
    right:14px;

    transform:translateY(-50%);

    border:none;
    background:none;

    cursor:pointer;

    color:var(--text-light);
    font-size:15px;
}
.password-toggle:hover{
    color:var(--primary);
}




/* =====================================
   SUBJECT CARD
===================================== */

.subject-card{

    background:var(--white);

    border:1px solid var(--border);

    border-radius:18px;

    padding:24px 18px;

    text-align:center;

    position:relative;

    transition:.3s ease;

    cursor:pointer;

    overflow:hidden;
}

.subject-card:hover{

    transform:translateY(-6px);

    border-color:var(--primary);

    box-shadow:var(--shadow-hover);
}

/* TOP ACCENT BAR */

.subject-card::before{

    content:"";

    position:absolute;

    left:0;
    top:0;

    width:100%;
    height:4px;

    background:var(--primary);

    transform:scaleX(0);

    transition:.3s;
}

.subject-card:hover::before{
    transform:scaleX(1);
}

/* ICON */

.subject-icon{

    width:58px;
    height:58px;

    margin:0 auto 14px;

    border-radius:16px;

    background:var(--primary-soft);

    color:var(--primary);

    display:flex;

    align-items:center;
    justify-content:center;

    font-size:22px;

    transition:.3s;
}

.subject-card:hover .subject-icon{

    background:var(--primary);

    color:white;

    transform:scale(1.08);
}

/* TITLE */

.subject-title{

    font-size:15px;

    font-weight:700;

    color:var(--primary-dark);

    margin-bottom:8px;

    line-height:1.5;
}

/* META */

.subject-meta{

    font-size:12px;

    color:var(--text-light);

    font-weight:500;
}

/* OPTIONAL BADGE */

.subject-card .subject-badge{

    display:inline-block;

    margin-top:12px;

    padding:5px 10px;

    border-radius:999px;

    background:var(--accent-soft);

    color:var(--accent);

    font-size:11px;

    font-weight:700;
}

/* ================= SEMESTER TABS ================= */
.semester-tabs{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding-bottom:6px;
}
.sem-tab{
  padding:6px 14px;
  border-radius:8px;
  background:#fff;
  border:1px solid #e5e7eb;
  font-size:12px;
  cursor:pointer;
  transition:0.25s;
}


.sem-tab.active{
    background:var(--primary);
    border-color:var(--primary);
    color:white;
}



.section-title{
  font-family:'Manrope', sans-serif;
  font-size:20px;
  font-weight:700;
  letter-spacing:-0.4px;
   color:var(--primary-dark);
}

@media (max-width:768px){

  .qp-filter{
    flex-direction:column;
  }

  .qp-filter select{
    width:100%;
  }

  /* 🔥 FIX TABLE ALIGNMENT */
  .qp-table{
    font-size:12px;
  }

  .qp-table th,
  .qp-table td{
    padding:8px;
    white-space:nowrap;   /* ⭐ IMPORTANT */
  }

  /* 🔥 FIX ICON COLUMN WIDTH */
  .qp-table td:last-child,
  .qp-table th:last-child{
    width:50px;
    text-align:center;
  }

  /* 🔥 PREVENT TEXT BREAKING */
  .qp-table td{
    overflow:hidden;
    text-overflow:ellipsis;
  }

  /* 🔥 BETTER SCROLL */
  .table-wrapper{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

}


/* =========================================
   INLINE
========================================= */

.auth-inline{
    display:flex;
    align-items:center;
    gap:8px;
}

.flex-1{
    flex:1;
}

/* =========================================
   OTP WRAPPER
========================================= */

.otp-wrapper{
    background:var(--bg);

    border:1px solid var(--border);

    border-radius:16px;

    padding:14px;

    display:flex;
    flex-direction:column;

    gap:12px;
}

/* =========================================
   OTP TITLE
========================================= */

.otp-title{
    text-align:center;

    font-size:12px;
    font-weight:600;

    color:var(--text-light);
}

/* =========================================
   OTP BOXES
========================================= */

.otp-boxes{
    display:flex;
    justify-content:center;

    gap:8px;
}

.otp-input{
    width:42px;
    height:46px;

    border:1px solid var(--border-light);

    border-radius:12px;

    background:#fff;

    text-align:center;

    font-size:18px;
    font-weight:700;

    color:var(--text);

    transition:.2s;
}

.otp-input:focus{
    outline:none;

   border-color:var(--primary);

    box-shadow:
        0 0 0 3px
        var(--primary-soft);
}

/* =========================================
   OTP ACTIONS
========================================= */

.otp-actions{
    display:flex;
    justify-content:center;
    align-items:center;

    gap:14px;
}

.otp-action-btn{
    border:none;
    background:none;

    cursor:pointer;

    font-size:12px;
    font-weight:600;

    color:var(--primary);

    transition:.2s;
}

.otp-action-btn.resend{
    color:var(--accent);
}

.otp-action-btn:hover{
    opacity:.8;
}

/* =========================================
   PASSWORD
========================================= */

.password-input{
    padding-right:45px;
}


/* ================= HEADER ================= */

.sg-header{
    position:sticky;
    top:0;
    z-index:1000;

    background:#ffffff;

    border-bottom:1px solid #e5e7eb;

    box-shadow:0 2px 15px rgba(15,23,42,.05);

}

.sg-container{
    max-width:1280px;
    height:78px;

    margin:auto;

    display:flex;
    align-items:center;
    justify-content:space-between;

    padding:0 24px;
}

.brand-link{
    display:flex;
    align-items:center;
    gap:12px;

    text-decoration:none;
}

.brand-logo{
    width:46px;
    height:46px;

    border-radius:12px;

    background:linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    display:flex;
    align-items:center;
    justify-content:center;

    color:white;
    font-size:20px;
}

.brand-title{
    font-size:20px;
    font-weight:800;
    color:#0f172a;
}

.brand-subtitle{
    font-size:12px;
    color:#64748b;
}
.sg-nav{
    display:flex;
    align-items:center;
    gap:28px;
}

.sg-nav-link{
    position:relative;

    text-decoration:none;

    color:#475569;

    font-size:15px;
    font-weight:600;

    padding:8px 0;

    transition:.25s;
}

.sg-nav-link:hover{
    color:#2563eb;
    background:none;
}

/* Underline */
.sg-nav-link::after{
    content:"";

    position:absolute;

    left:0;
    bottom:-4px;

    width:0;
    height:2px;

    background:#2563eb;

    transition:.25s ease;
}

.sg-nav-link:hover::after{
    width:100%;
}

/* Active Menu */
.sg-nav-link.active{
    color:#0f172a;
    background:none;
}

.sg-nav-link.active::after{
    width:100%;
}

.sg-user{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:nowrap;
}

.sg-avatar{
    width:40px;
    height:40px;
    min-width:40px;

    border-radius:50%;

    display:flex;
    align-items:center;
    justify-content:center;

    background:#2563eb;
    color:#fff;

    font-size:14px;
    font-weight:700;
}

.sg-username{
    font-size:14px;
    font-weight:600;
    color:#334155;

    white-space:nowrap;
}
.sg-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    padding:10px 22px;

    background:linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    color:#fff;

    border:none;
    border-radius:12px;

    font-size:14px;
    font-weight:600;

    cursor:pointer;

    box-shadow:
        0 6px 18px rgba(37,99,235,.25);

    transition:.25s ease;
}

.sg-btn:hover{
    transform:translateY(-2px);

    box-shadow:
        0 10px 25px rgba(37,99,235,.35);
}
.logout-btn{
    background:#f1f5f9 !important;
    color:#334155 !important;
    box-shadow:none !important;
}

.logout-btn:hover{
    background:#e2e8f0 !important;
    transform:none !important;
}

.mobile-menu-btn{
    display:none;
}
/* MOBILE */
@media(max-width:768px){

    .sg-container{
        display:grid;
        grid-template-columns:40px 1fr auto;
        align-items:center;
        height:70px;
        padding:0 12px;
    }

    .mobile-menu-btn{
        display:flex;
        align-items:center;
        justify-content:center;
        font-size:20px;
        cursor:pointer;
        color:#0f172a;
    }

    .brand-link{
        justify-self:center;
    }

    .brand-logo{
        width:40px;
        height:40px;
        font-size:18px;
    }

    .brand-title{
        font-size:16px;
    }

    .brand-subtitle{
        display:none;
    }

    .sg-username{
        display:none;
    }

    .sg-avatar{
        width:34px;
        height:34px;
        min-width:34px;
        font-size:12px;
    }

    .sg-btn{
        padding:7px 12px;
        font-size:12px;
    }

    .sg-nav{
        display:none;
        position:fixed;
        top:70px;
        left:-260px;
        width:260px;
        height:100vh;
        background:#fff;
        flex-direction:column;
        gap:0;
        transition:.3s ease;
        box-shadow:0 10px 30px rgba(0,0,0,.15);
        z-index:9999;
    }

    .sg-nav.show{
        display:flex;
        left:0;
    }

    .sg-nav-link{
        width:100%;
        padding:14px 18px;
        border-bottom:1px solid #f1f5f9;
    }
}

