/* ==========================================================================
   SIMAPALA Global - Admin Dashboard Styles
   ========================================================================== */

:root {
  --sidebar-bg: #1b4332;
  --sidebar-bg-dark: #081c15;
  --sidebar-active: #2d6a4f;
  --sidebar-text: rgba(255,255,255,.85);
  --primary: #2d6a4f;
  --accent: #f77f00;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg-main: #f1f5f9;
  --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: #1e293b;
  margin: 0;
  min-height: 100vh;
}

/* ===== LAYOUT ===== */
.admin-wrapper { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-dark) 100%);
  color: white;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .3s;
}
.sidebar-header {
  padding: 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-header .logo {
  width: 50px;
  height: 50px;
  background: var(--accent);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: .75rem;
  color: white;
}
.sidebar-header h6 {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
}
.sidebar-header small {
  font-size: .75rem;
  opacity: .7;
  letter-spacing: 1px;
}

.sidebar-menu {
  padding: 1rem .75rem;
  list-style: none;
  margin: 0;
}
.sidebar-menu .menu-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,.4);
  padding: 1rem 1rem .5rem;
  margin-top: .5rem;
}
.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1rem;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 10px;
  margin-bottom: .15rem;
  font-size: .92rem;
  transition: all .2s;
}
.sidebar-menu li a:hover {
  background: rgba(255,255,255,.08);
  color: white;
}
.sidebar-menu li a.active {
  background: var(--sidebar-active);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sidebar-menu li a i {
  width: 20px;
  font-size: 1.05rem;
  text-align: center;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: 260px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  background: white;
  padding: .85rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar .btn-toggle {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #475569;
  cursor: pointer;
  display: none;
}
.topbar .page-title {
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0;
  color: #0f172a;
}
.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar .user-info {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .35rem .75rem .35rem .35rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background .2s;
}
.topbar .user-info:hover { background: #f1f5f9; }
.topbar .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
}
.topbar .user-name {
  font-weight: 600;
  font-size: .9rem;
  color: #1e293b;
}
.topbar .user-role {
  font-size: .75rem;
  color: #64748b;
  text-transform: capitalize;
}

/* ===== CONTENT AREA ===== */
.content {
  padding: 1.75rem;
  flex: 1;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: 12px;
  border: none;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}
.card-header {
  background: white;
  border-bottom: 1px solid #f1f5f9;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0 !important;
}
.card-header h5 {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
}

/* ===== STAT CARDS (Dashboard) ===== */
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--card-shadow);
  transition: all .25s;
  height: 100%;
  border-left: 4px solid var(--primary);
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
}
.stat-card.stat-success { border-left-color: var(--success); }
.stat-card.stat-warning { border-left-color: var(--warning); }
.stat-card.stat-info { border-left-color: var(--info); }
.stat-card.stat-danger { border-left-color: var(--danger); }
.stat-card.stat-accent { border-left-color: var(--accent); }

.stat-card .stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  background: var(--primary);
  flex-shrink: 0;
}
.stat-card.stat-success .stat-icon { background: var(--success); }
.stat-card.stat-warning .stat-icon { background: var(--warning); }
.stat-card.stat-info .stat-icon { background: var(--info); }
.stat-card.stat-danger .stat-icon { background: var(--danger); }
.stat-card.stat-accent .stat-icon { background: var(--accent); }

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0;
}
.stat-card .stat-label {
  color: #64748b;
  font-size: .85rem;
  margin: 0;
}

/* ===== TABLES ===== */
.table {
  margin-bottom: 0;
}
.table thead th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  border: none;
  padding: .85rem 1rem;
}
.table tbody td {
  padding: .85rem 1rem;
  vertical-align: middle;
  border-color: #f1f5f9;
  font-size: .92rem;
}
.table tbody tr:hover { background: #f8fafc; }

/* Avatar in table */
.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 600;
}

/* ===== BUTTONS ===== */
.btn {
  font-weight: 500;
  border-radius: 8px;
  padding: .5rem 1.1rem;
  font-size: .9rem;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: #1b4332;
  border-color: #1b4332;
}
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }

/* ===== FORM ===== */
.form-control, .form-select {
  border-radius: 8px;
  padding: .55rem .85rem;
  font-size: .92rem;
  border: 1px solid #e2e8f0;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(45,106,79,.15);
}
.form-label {
  font-weight: 500;
  font-size: .88rem;
  color: #475569;
  margin-bottom: .35rem;
}

/* ===== BADGES ===== */
.badge {
  font-weight: 600;
  padding: .35em .7em;
  font-size: .75em;
  border-radius: 6px;
}

/* ===== PAGINATION ===== */
.pagination .page-link {
  color: var(--primary);
  border-color: #e2e8f0;
  border-radius: 8px;
  margin: 0 2px;
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

/* ===== ALERTS ===== */
.alert {
  border-radius: 10px;
  border: none;
  padding: .85rem 1.1rem;
}

/* ===== LOGIN PAGE ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  background: var(--bg-main);
}
.login-left {
  flex: 1;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--sidebar-bg-dark) 100%),
              url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=1200&q=70') center/cover;
  background-blend-mode: multiply;
  color: white;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.login-left h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}
.login-left .feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.login-left .feature-item i {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-form {
  width: 100%;
  max-width: 420px;
}
.login-form h2 {
  font-weight: 800;
  margin-bottom: .5rem;
}
.login-form .subtitle {
  color: #64748b;
  margin-bottom: 2rem;
}
.input-group-icon { position: relative; }
.input-group-icon i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}
.input-group-icon .form-control { padding-left: 2.75rem; }

/* ===== CALENDAR ===== */
.fc-event {
  cursor: pointer;
  border: none !important;
  padding: 2px 5px !important;
  font-size: .8rem !important;
}
.fc-toolbar-title { font-size: 1.2rem !important; }

/* ===== INVENTARIS CARD VIEW ===== */
.inv-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all .25s;
  height: 100%;
}
.inv-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}
.inv-card-img {
  height: 150px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--sidebar-bg-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 3rem;
}
.inv-card-body { padding: 1rem; }
.inv-card-body h6 { font-weight: 700; margin-bottom: .25rem; }
.inv-card-body .code { font-size: .8rem; color: #64748b; font-family: monospace; }

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .topbar .btn-toggle { display: block; }
  .login-left { display: none; }
}

/* Quick action button */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: .75rem;
}
.quick-action-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem .75rem;
  text-align: center;
  text-decoration: none;
  color: #475569;
  transition: all .2s;
  display: block;
}
.quick-action-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-3px);
}
.quick-action-btn i {
  font-size: 1.5rem;
  display: block;
  margin-bottom: .35rem;
}
.quick-action-btn span { font-size: .85rem; font-weight: 500; }





@media (max-width: 768px){

  .content{
    padding: 1rem;
  }

  .topbar{
    padding: .75rem 1rem;
  }

  .page-title{
    font-size: 1rem;
  }

  .stat-card{
    padding: 1rem;
  }

  .stat-card .stat-value{
    font-size: 1rem;
    word-break: break-word;
  }

  .card-header{
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
  }

  .table-responsive{
    overflow-x: auto;
  }

}


@media (max-width: 768px){

  .navbar-mapala .navbar-brand{
    font-size: 1rem;
  }

  .navbar-mapala .navbar-brand img{
    width: 35px;
    height: 35px;
  }

  .hero{
    min-height: auto;
    padding: 120px 0 60px;
    text-align: center;
  }

  .hero h1{
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero .lead{
    font-size: .95rem;
    margin: 0 auto 1.5rem;
  }

  .btn-hero{
    width: 100%;
    justify-content: center;
    margin-bottom: .5rem;
  }

  .hero-stats{
    grid-template-columns: repeat(2,1fr);
    gap: .75rem;
  }

  .hero-stat-item h3{
    font-size: 1.4rem;
  }

  .hero-stat-item p{
    font-size: .75rem;
  }

  .section-title h2{
    font-size: 1.8rem;
  }

  .section-title p{
    font-size: .95rem;
  }

  .divisi-card,
  .berita-card,
  .prestasi-card,
  .contact-card{
    margin-bottom: 1rem;
  }

  .about-image img{
    min-height: 250px;
  }

  .footer{
    text-align: center;
  }

}
