/* ==========================================================
   PMIPTI I-LIBRARY — ACADEMIC ELEGANT THEME
   Terinspirasi layout Cambridge Research, palet warna sendiri
   ========================================================== */
:root{
    /* Warna utama: Maroon / Wine — elegan & akademik */
    --primary:#7A1F2B;
    --primary-dark:#5A1620;
    --primary-light:#A63D46;

    /* Aksen: Warm Gold — mewah, dipakai untuk highlight & hover */
    --violet:#8C3B4A;
    --blue:#5E4B56;
    --teal:#3F5E5A;
    --orange:#C9A24B;
    --pink:#9C5B63;
    --amber:#C9A24B;

    --page-bg:#FAF7F2;
    --text:#2B2420;
    --muted:#7A7168;
    --white:#FFFFFF;
    --border:#EDE6DA;

    --shadow:0 8px 24px rgba(60,40,20,.06);
    --shadow-hover:0 16px 36px rgba(60,40,20,.12);
    --sidebar-width:270px;
    --radius:18px;
    --radius-sm:12px;
    --fast:.15s ease;

    --font-heading:'Playfair Display',Georgia,serif;
    --font-body:'Source Serif 4','Segoe UI',Arial,sans-serif;
}

*{ box-sizing:border-box; }

html{ scroll-behavior:smooth; }

body{
    margin:0;
    min-height:100vh;
    background:var(--page-bg);
    color:var(--text);
    font-family:var(--font-body);
}

img,canvas{ max-width:100%; }
a{ color:inherit; text-decoration:none; }
button,.btn{ cursor:pointer; }

h1,h2,h3,h4,h5,h6,
.logo h3,.navbar h3,.page-title h2,.page-header h2,
.welcome-card h1,.stat-card h2,.summary-card h5,
.quick-card h5,.latest-book h5{
    font-family:var(--font-heading);
    letter-spacing:.2px;
}

/* ================= LAYOUT ================= */

.wrapper{ min-height:100vh; }

.content{
    min-height:100vh;
    margin-left:var(--sidebar-width);
    padding:28px 32px;
    overflow-x:hidden;
    transition:margin-left var(--fast);
}

/* ================= SIDEBAR (cream white, maroon accent) ================= */

.sidebar{
    position:fixed;
    top:0; left:0;
    width:var(--sidebar-width);
    height:100vh;
    padding:26px 18px;
    display:flex;
    flex-direction:column;
    overflow-y:auto;
    overflow-x:hidden;

    background:var(--white);
    border-right:1px solid var(--border);
    box-shadow:4px 0 24px rgba(60,40,20,.04);
    z-index:1000;
    transition:transform var(--fast);
}

.sidebar::-webkit-scrollbar{ width:5px; }
.sidebar::-webkit-scrollbar-thumb{ background:var(--border); border-radius:10px; }

.logo{
    flex-shrink:0;
    margin-bottom:26px;
    text-align:center;
    position:relative;
}

.sidebar-logo,.siderbar-Loko{
    display:block;
    width:56px;
    height:56px;
    margin:0 auto 12px;
    object-fit:contain;
    padding:10px;

    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    border-radius:16px;
    box-shadow:0 6px 16px rgba(122,31,43,.3);
}

.logo h3{
    margin:0 0 4px;
    font-size:20px;
    font-weight:700;
    color:var(--text);
}

.logo small{
    font-size:12px;
    color:var(--muted);
    font-family:var(--font-body);
}

.sidebar .nav{ flex:1; margin-top:10px; }
.sidebar .nav-item{ margin-bottom:5px; }

.sidebar .nav-link{
    display:flex;
    align-items:center;
    gap:13px;
    width:100%;
    padding:11px 14px;

    color:var(--text);
    font-size:14.5px;
    font-weight:500;
    font-family:var(--font-body);

    border-radius:12px;
    transition:background var(--fast), color var(--fast);
}

.sidebar .nav-link i{
    flex:0 0 22px;
    width:22px;
    text-align:center;
    font-size:18px;
    color:var(--muted);
    transition:color var(--fast);
}

.sidebar .nav-link:hover{
    background:#F6EFE4;
    color:var(--primary);
}

.sidebar .nav-link:hover i{ color:var(--orange); }

.sidebar .nav-link.active{
    color:#FFFFFF;
    background:linear-gradient(135deg,var(--primary) 0%,var(--primary-dark) 100%);
    font-weight:700;
    box-shadow:0 6px 16px rgba(122,31,43,.3);
}

.sidebar .nav-link.active i{ color:var(--orange); }

.logout-area{ margin-top:auto; padding-top:16px; border-top:1px solid var(--border); }

.logout-area a{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    width:100%;
    padding:11px;

    color:var(--primary);
    background:#F6EFE4;
    font-weight:700;
    font-size:14px;

    border-radius:12px;
    transition:background var(--fast), color var(--fast);
}

.logout-area a:hover{
    background:var(--primary);
    color:#FFFFFF;
}

/* ================= SIDEBAR TOGGLE ================= */

.sidebar-toggle-btn{
    position:fixed;
    top:18px; left:18px;
    z-index:1100;
    width:44px; height:44px;
    display:flex; align-items:center; justify-content:center;

    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    color:#fff; border:0; border-radius:12px;
    font-size:20px;
    box-shadow:0 6px 16px rgba(122,31,43,.3);
    transition:left var(--fast), transform var(--fast);
}
.sidebar-toggle-btn:active{ transform:scale(.94); }

.sidebar.sidebar-hidden{ transform:translateX(-100%); }
body.sidebar-hidden .content{ margin-left:0; }

@media(min-width:992px){
    body:not(.sidebar-hidden) .sidebar-toggle-btn{
        left:calc(var(--sidebar-width) + 14px);
    }
}

/* ================= NAVBAR ================= */

.navbar{
    min-height:62px;
    padding:14px 22px !important;
    background:#FFFFFF !important;
    border:0 !important;
    border-radius:16px;
    box-shadow:var(--shadow);
}

.navbar h3{ margin:0; font-size:23px; font-weight:700; color:var(--primary-dark); }
.navbar small{ color:var(--muted); font-family:var(--font-body); }

.page-title,.page-header{
    display:flex; align-items:center; justify-content:space-between;
    gap:20px; margin-bottom:28px;
}
.page-title h2,.page-header h2{ margin:0; color:var(--primary); font-weight:700; }
.page-title .btn,.page-header .btn{ flex-shrink:0; }

/* ================= CARD BASE ================= */

.card{
    border:0 !important;
    border-radius:var(--radius) !important;
    box-shadow:var(--shadow);
    overflow:hidden;
    transition:box-shadow var(--fast);
}

.card-header{
    padding:16px 20px;
    border-bottom:1px solid var(--border);
    font-weight:700;
}

.card-body{ background:#FFFFFF; }

/* ================= WELCOME BANNER — deep academic gradient ================= */

.welcome-card{
    position:relative;
    isolation:isolate;
    overflow:hidden;

    margin-bottom:28px;
    padding:46px;

    color:#FFFFFF;
    border-radius:24px;

    background:linear-gradient(120deg,
        var(--primary-dark) 0%,
        var(--primary) 55%,
        var(--orange) 130%);

    box-shadow:0 20px 45px rgba(90,22,32,.28);
}

.welcome-card::before,.welcome-card::after{
    content:"";
    position:absolute;
    pointer-events:none;
    z-index:-1;
    border-radius:50%;
}

.welcome-card::before{
    width:280px; height:280px;
    top:-110px; right:-90px;
    background:rgba(255,255,255,.10);
}

.welcome-card::after{
    width:200px; height:200px;
    left:-70px; bottom:-90px;
    background:rgba(201,162,75,.16);
}

.welcome-card .row,
.welcome-card .col-lg-8,
.welcome-card .col-lg-4{ position:relative; z-index:2; }

.welcome-card .badge{ font-weight:700; }
.welcome-card .badge.bg-light{
    background:rgba(255,255,255,.20) !important;
    color:#FFFFFF !important;
    letter-spacing:1.5px;
    font-family:var(--font-body);
}

.welcome-card h1{ font-weight:700; letter-spacing:-.5px; }
.welcome-card p{ font-family:var(--font-body); }

.welcome-card .btn-light{
    background:#FFFFFF;
    border-color:#FFFFFF;
    color:var(--primary-dark);
    font-weight:700;
}
.welcome-card .btn-light:hover{ background:var(--orange); color:#FFFFFF; }

.welcome-card .btn-outline-light{
    border-color:rgba(255,255,255,.6);
    font-weight:600;
}
.welcome-card .btn-outline-light:hover{
    background:rgba(255,255,255,.18);
}

.welcome-logo{
    display:block;
    width:170px; max-width:85%; height:auto;
    margin:0 auto;
    object-fit:contain;
    filter:drop-shadow(0 8px 18px rgba(0,0,0,.25));
}

/* ================= STAT CARDS — muted academic palette ================= */

.stat-card{
    position:relative;
    isolation:isolate;
    height:100%;
    min-height:200px;
    padding:28px 20px;
    text-align:center;
    background:#FFFFFF;
    border-radius:20px !important;
    box-shadow:var(--shadow);
    transition:box-shadow var(--fast), transform var(--fast);
}

.stat-card:hover{
    box-shadow:var(--shadow-hover);
    transform:translateY(-3px);
}

.stat-icon{
    width:66px; height:66px;
    margin:0 auto 14px;
    display:flex; align-items:center; justify-content:center;
    border-radius:50%;
    font-size:28px;
    color:#FFFFFF;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
}

/* rotasi warna tetap dalam nuansa maroon-gold-teal yang senada */
.row.g-4 .col-lg-3:nth-of-type(1) .stat-icon,
.row.g-4 .col-lg-4:nth-of-type(5) .stat-icon{
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
}
.row.g-4 .col-lg-3:nth-of-type(2) .stat-icon{
    background:linear-gradient(135deg,var(--violet),var(--primary-light));
}
.row.g-4 .col-lg-3:nth-of-type(3) .stat-icon{
    background:linear-gradient(135deg,var(--teal),#5E8580);
}
.row.g-4 .col-lg-3:nth-of-type(4) .stat-icon{
    background:linear-gradient(135deg,var(--blue),#7A6470);
}
.row.g-4 .col-lg-4:nth-of-type(6) .stat-icon{
    background:linear-gradient(135deg,var(--amber),#DDBB6F);
}
.row.g-4 .col-lg-4:nth-of-type(7) .stat-icon{
    background:linear-gradient(135deg,var(--pink),#B37F86);
}

.stat-card h2{
    margin:0 0 4px;
    color:var(--text);
    font-size:34px;
    font-weight:700;
}

.stat-card p{
    margin:0;
    color:var(--muted);
    font-size:14px;
    font-weight:600;
    font-family:var(--font-body);
}

/* ================= CHART / SUMMARY ================= */

.chart-card,.summary-card{
    height:100%;
    background:#FFFFFF;
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

.chart-card{ overflow:hidden; }

.chart-card .card-header,.dashboard-title{
    color:#FFFFFF;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    font-weight:700;
}

.chart-card .card-body{ padding:22px; }
.chart-card canvas{ width:100% !important; max-height:340px; }

.summary-card{ padding:22px; }
.summary-card h5{ margin-bottom:18px; color:var(--primary-dark); font-weight:700; }
.summary-card p{
    display:flex; justify-content:space-between; align-items:center;
    gap:15px; padding:9px 0; margin:0;
    border-bottom:1px solid var(--border);
    font-family:var(--font-body);
}
.summary-card p:last-child{ border-bottom:0; }
.summary-card span{ color:var(--primary); font-weight:800; }

/* ================= QUICK MENU ================= */

.quick-card{
    height:100%;
    padding:28px 20px;
    text-align:center;
    background:#FFFFFF;
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow);
    transition:box-shadow var(--fast), transform var(--fast);
}

.quick-card:hover{
    box-shadow:var(--shadow-hover);
    transform:translateY(-3px);
}

.quick-icon{
    width:70px; height:70px;
    margin:0 auto 16px;
    display:flex; align-items:center; justify-content:center;
    border-radius:50%;
    color:#FFFFFF;
    font-size:28px;
}

.row.g-4 .col-md-3:nth-of-type(1) .quick-icon{ background:linear-gradient(135deg,var(--primary),var(--primary-dark)); }
.row.g-4 .col-md-3:nth-of-type(2) .quick-icon{ background:linear-gradient(135deg,var(--violet),var(--primary-light)); }
.row.g-4 .col-md-3:nth-of-type(3) .quick-icon{ background:linear-gradient(135deg,var(--teal),#5E8580); }
.row.g-4 .col-md-3:nth-of-type(4) .quick-icon{ background:linear-gradient(135deg,var(--amber),#DDBB6F); }

.quick-card h5{ margin-bottom:6px; color:var(--text); font-weight:700; }
.quick-card p{ margin:0; color:var(--muted); font-size:13.5px; font-family:var(--font-body); }

/* ================= LATEST BOOK ================= */

.latest-book{
    height:100%;
    overflow:hidden;
    background:#FFFFFF;
    border-radius:20px;
    box-shadow:var(--shadow);
    transition:box-shadow var(--fast), transform var(--fast);
}

.latest-book:hover{
    box-shadow:var(--shadow-hover);
    transform:translateY(-3px);
}

.latest-cover,.book-thumb-cover{
    display:block;
    width:100%;
    height:300px;
    object-fit:cover;
    background:linear-gradient(135deg,#F3EEE5,#EBE2D2);
}

.latest-book .card-body{ padding:20px; text-align:center; }

.latest-book h5{
    min-height:46px;
    margin-bottom:8px;
    color:var(--text);
    font-weight:700;
}

.latest-book p{ margin-bottom:6px; color:var(--muted); font-family:var(--font-body); }
.latest-book strong{ color:var(--primary); }

.latest-book .badge{ padding:6px 12px; border-radius:30px; font-size:12px; }

.latest-book .btn{ border-radius:10px; font-weight:600; }

.latest-book .btn-danger{
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    border:0;
}
.latest-book .btn-danger:hover{ filter:brightness(1.08); }

.latest-book .btn-dark{ border:0; background:var(--text); }
.latest-book .btn-dark:hover{ background:#000000; }

.book-thumb{
    display:block;
    width:60px; height:78px;
    object-fit:cover;
    border-radius:9px;
    box-shadow:0 4px 12px rgba(0,0,0,.15);
}

/* ================= TABLE ================= */

.table-responsive{ border-radius:15px; }
.table{ margin-bottom:0; background:#FFFFFF; font-family:var(--font-body); }

.table thead{
    color:#FFFFFF;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
}

.table thead th{
    padding:14px; border:0;
    font-size:13.5px; font-weight:700;
    white-space:nowrap;
}

.table tbody td{ padding:13px 14px; vertical-align:middle; border-color:var(--border); }
.table tbody tr:hover{ background:#FBF5EC; }

/* ================= BUTTONS ================= */

.btn{
    border-radius:11px;
    font-weight:600;
    font-family:var(--font-body);
    transition:filter var(--fast), transform var(--fast);
}
.btn:hover{ transform:translateY(-1px); }

.btn-primary,.btn-danger{
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    border:0;
}
.btn-primary:hover,.btn-danger:hover{ filter:brightness(1.08); }

.btn-success{
    background:linear-gradient(135deg,#3F5E5A,#5E8580);
    border:0;
}
.btn-success:hover{ filter:brightness(1.08); }

.btn-outline-danger{
    color:var(--primary);
    border-color:var(--primary);
    font-weight:600;
}
.btn-outline-danger:hover{
    color:#FFFFFF;
    background:var(--primary);
    border-color:var(--primary);
}

.btn-login{
    width:100%; height:50px;
    color:#FFFFFF;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    border:0; border-radius:13px;
    font-weight:700;
}
.btn-login:hover{ filter:brightness(1.08); }

/* ================= FORM ================= */

.form-label{ color:#4A4038; font-weight:600; font-family:var(--font-body); }

.form-control,.form-select{
    min-height:46px;
    border:1px solid var(--border);
    border-radius:11px;
    font-family:var(--font-body);
    transition:border-color var(--fast), box-shadow var(--fast);
}

.form-control:focus,.form-select:focus{
    border-color:var(--primary);
    box-shadow:0 0 0 .2rem rgba(122,31,43,.12);
}

textarea.form-control{ min-height:110px; }

/* ================= LOGIN PAGE ================= */

body.login-page{
    min-height:100vh; margin:0;
    display:flex; align-items:center; justify-content:center;
    padding:25px;

    background-image:
        linear-gradient(135deg, rgba(90,22,32,.78), rgba(201,162,75,.45)),
        url('/assets/bg-login.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


.login-card{
    width:min(420px,100%);
    padding:40px;
    background:#FFFFFF;
    border-radius:22px;
    box-shadow:0 20px 50px rgba(60,40,20,.12);
}

.login-logo{
    width:82px; height:82px;
    margin:0 auto 22px;
    display:flex; align-items:center; justify-content:center;
    background:linear-gradient(135deg,var(--primary),var(--primary-dark));
    border-radius:50%;
}

.login-logo img{ width:48px; height:auto; filter:brightness(0) invert(1); }
.login-logo i{ color:#FFFFFF; font-size:38px; }

.login-card .form-control{ height:50px; border-radius:12px; }

.login-footer{ margin-top:18px; text-align:center; color:var(--muted); font-size:13px; font-family:var(--font-body); }

/* ================= ALERT / BADGE ================= */

.badge{ font-weight:600; }
.alert{ border-radius:12px; }
.text-danger{ color:var(--primary) !important; }

/* ================= RESPONSIVE ================= */

@media(max-width:1199px){
    :root{ --sidebar-width:235px; }
    .content{ padding:22px; }
    .welcome-card{ padding:32px; }
    .welcome-logo{ width:145px; }
}

@media(max-width:991px){
    :root{ --sidebar-width:80px; }
    .sidebar{ width:80px; padding:20px 10px; }
    .logo h3,.logo small,.sidebar .nav-link span{ display:none; }
    .sidebar-logo,.siderbar-Loko{ width:44px; margin-bottom:16px; }
    .sidebar .nav-link{ justify-content:center; padding:12px 8px; }
    .sidebar .nav-link i{ margin:0; }
    .content{ margin-left:80px; padding:18px; }
    .welcome-card{ padding:28px; }
    .welcome-logo{ width:120px; }
}

@media(max-width:767px){
    .sidebar{ position:relative; width:100%; height:auto; min-height:auto; padding:14px; }
    .logo{ margin-bottom:12px; }
    .logo h3,.logo small{ display:block; }
    .sidebar-logo,.siderbar-Loko{ width:56px; margin-bottom:8px; }
    .sidebar .nav{ display:flex; flex-direction:row; flex-wrap:wrap; gap:5px; }
    .sidebar .nav-item{ margin:0; flex:1 1 auto; }
    .sidebar .nav-link{ justify-content:center; padding:9px 7px; font-size:12.5px; }
    .sidebar .nav-link span{ display:inline; }
    .content{ margin-left:0; padding:14px; min-height:auto; }
    .page-title,.page-header{ flex-direction:column; align-items:stretch; margin-bottom:18px; }
    .page-title .btn,.page-header .btn{ width:100%; }
    .welcome-card{ padding:24px 18px; text-align:center; }
    .welcome-card .col-lg-8{ margin-bottom:22px; }
    .welcome-logo{ width:105px; }
    .stat-card{ min-height:180px; }
    .latest-cover,.book-thumb-cover{ height:260px; }
    .login-card{ padding:28px 20px; }
}

@media(max-width:480px){
    .content{ padding:12px; }
    .welcome-card{ border-radius:18px; }
    .stat-card{ padding:22px 14px; }
    .stat-icon{ width:58px; height:58px; font-size:24px; }
    .stat-card h2{ font-size:28px; }
    .quick-card{ padding:22px 14px; }
    .table thead th,.table tbody td{ padding:9px; font-size:12.5px; }
}


