html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #334155;
    line-height: 1.6;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-header i {
    font-size: 28px;
    color: var(--primary-color);
}

.sidebar.collapsed .sidebar-header span {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.menu-item.active .menu-link {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left: 4px solid var(--primary-color);
    padding-left: 16px;
    font-weight: 700; /* make active menu label bold */
}

.menu-item.active .menu-link i {
    color: var(--primary-color);
}

.menu-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar.collapsed .menu-link span {
    display: none;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

.sidebar.collapsed .logout-link span {
    display: none;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: 80px;
    width: calc(100% - 80px);
}

/* ========================================
   TOP NAVBAR
   ======================================== */

.top-navbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info-dropdown {
    position: relative;
}

.user-info-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s;
}

.user-info-btn:hover {
    background: var(--light-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--secondary-color);
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1001;
}

.user-menu.show {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
}

.user-menu-item:hover {
    background: var(--light-color);
}

.user-menu-item i {
    width: 20px;
    color: var(--secondary-color);
}

.user-menu hr {
    margin: 8px 0;
    border: none;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   CONTENT WRAPPER
   ======================================== */

.content-wrapper {
    padding: 30px;
    flex: 1;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .user-details {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 20px 15px;
    }

    .top-navbar {
        padding: 0 15px;
    }

    .page-title {
        font-size: 18px;
    }
}

/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.table-responsive {
    overflow-x: auto;
}