/* Adminty-style Admin Template */

:root {
    --sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sidebar-width: 260px;
    --header-height: 70px;
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --card-orange: #ff6b6b;
    --card-green: #51cf66;
    --card-red: #ff8787;
    --card-teal: #20c997;
    --text-dark: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7fafc;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Top Header Bar */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
}

.top-header .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 30px;
}

.top-header .search-bar {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
}

.top-header .search-bar input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.top-header .search-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.top-header .header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.top-header .header-icon {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-muted);
    font-size: 20px;
}

.top-header .header-icon:hover {
    background: #f7fafc;
    color: var(--primary-color);
}

.top-header .header-icon .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.top-header .user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 25px;
    transition: all 0.3s;
}

.top-header .user-dropdown:hover {
    background: #f7fafc;
}

.top-header .user-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.top-header .user-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 1001;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.sidebar .sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .sidebar-logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar .sidebar-menu {
    padding: 20px 0;
}

.sidebar .menu-section {
    margin-bottom: 30px;
}

.sidebar .menu-section-title {
    padding: 0 20px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    letter-spacing: 1px;
}

.sidebar .menu-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.sidebar .menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    padding-left: 25px;
}

.sidebar .menu-item.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 3px solid white;
}

.sidebar .menu-item .menu-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar .menu-item .menu-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 30px;
    min-height: calc(100vh - var(--header-height));
}

/* KPI Cards */
.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border-top: 4px solid;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    opacity: 0.1;
}

.kpi-card.orange {
    border-top-color: var(--card-orange);
}

.kpi-card.orange::before {
    background: var(--card-orange);
}

.kpi-card.green {
    border-top-color: var(--card-green);
}

.kpi-card.green::before {
    background: var(--card-green);
}

.kpi-card.red {
    border-top-color: var(--card-red);
}

.kpi-card.red::before {
    background: var(--card-red);
}

.kpi-card.teal {
    border-top-color: var(--card-teal);
}

.kpi-card.teal::before {
    background: var(--card-teal);
}

.kpi-card .kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-card .kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.kpi-card .kpi-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 40px;
    opacity: 0.3;
}

.kpi-card .kpi-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    border: none;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.card-body {
    padding: 25px;
}

/* Tables */
.table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    background: white;
}

.table thead th {
    background: #f7fafc;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 15px;
    text-align: left;
}

.table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-dark);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: #f7fafc;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 14px;
    display: block;
}

.form-control {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
    transition: all 0.3s;
    background: white;
    color: var(--text-dark);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-control-sm {
    padding: 6px 12px;
    font-size: 13px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    margin: 0;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.card-subtitle {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s;
    border: none;
}

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

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #ff4757;
    color: white;
}

.btn-danger:hover {
    background: #ff3742;
}

/* List group styling */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-flush .list-group-item {
    border-left: none;
    border-right: none;
}

.bg-primary {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

code {
    background: #f7fafc;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary-color);
}

.bg-success {
    background-color: var(--card-green) !important;
    color: white !important;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-outline-danger {
    background: transparent;
    color: #ff4757;
    border: 1px solid #ff4757;
}

.btn-outline-danger:hover {
    background: #ff4757;
    color: white;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 11px;
}

.badge-success {
    background: var(--card-green);
    color: white;
}

.badge-secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-bg);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .logo-icon {
    width: 60px;
    height: 60px;
    background: var(--sidebar-bg);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .top-header {
        left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header .search-bar {
        display: none;
    }
}

/* Form Rows */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.col, .col-3, .col-md-4 {
    padding-left: 15px;
    padding-right: 15px;
    flex: 1;
}

.col-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

@media (max-width: 768px) {
    .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.col-form-label {
    padding-top: calc(0.5rem + 1px);
    padding-bottom: calc(0.5rem + 1px);
    margin-bottom: 0;
    font-size: inherit;
    line-height: 1.5;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

/* Card Footer */
.card-footer {
    padding: 15px 25px;
    background-color: rgba(0,0,0,0.03);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
}

/* Utilities */
.text-muted {
    color: var(--text-muted) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.justify-content-between { justify-content: space-between !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

.d-inline { display: inline !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}

.object-cover {
    object-fit: cover;
}

.ms-auto {
    margin-left: auto;
}

.h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.row-deck {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.row-cards .card {
    height: 100%;
}

.card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bg-warning {
    background-color: #ffc107;
    color: #000;
}

.page-header {
    margin-bottom: 25px;
}

.container-xl {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 15px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.text-reset {
    color: var(--text-muted);
    text-decoration: none;
}

.text-reset:hover {
    color: var(--primary-color);
}

/* DL styling */
dl.row {
    margin: 0;
}

dl.row dt {
    font-weight: 600;
    color: var(--text-dark);
}

dl.row dd {
    color: var(--text-muted);
    margin-bottom: 10px;
}

dl.row dd:last-child {
    margin-bottom: 0;
}

/* Fix nested cards in forms */
.card .card {
    box-shadow: none;
    border: 1px solid var(--border-color);
    margin-bottom: 0;
}

.card .card-body {
    padding: 1rem;
}

/* Small text helper */
small.text-muted {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Rounded images */
.rounded {
    border-radius: 8px;
}

/* Better form alignment */
.row.mb-3 {
    align-items: flex-start;
}

.row.mb-3 .form-label {
    margin-bottom: 0;
}

/* Table action buttons */
.table td .btn {
    margin-right: 5px;
}

.table td .btn:last-child {
    margin-right: 0;
}
