/* Admin Dashboard Styles - TDesign Inspired */
/* Flat design, no shadows, no gradients */

/* CSS Variables */
:root {
    --admin-primary: #0052d9;
    --admin-primary-hover: #0046bb;
    --admin-bg: #f5f7fa;
    --admin-sidebar-bg: #ffffff;
    --admin-sidebar-width: 232px;
    --admin-sidebar-collapsed: 64px;
    --admin-header-height: 64px;
    --admin-text: #1d2129;
    --admin-text-secondary: #4e5969;
    --admin-text-muted: #86909c;
    --admin-border: #e5e6eb;
    --admin-border-light: #f2f3f5;
    --admin-success: #00b42a;
    --admin-warning: #ff7d00;
    --admin-danger: #f53f3f;
    --admin-info: #165dff;
}

/* Reset for admin area */
.admin-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--admin-bg);
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--admin-sidebar-width);
    height: 100vh;
    background-color: var(--admin-sidebar-bg);
    border-right: 1px solid var(--admin-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.admin-sidebar-header {
    height: var(--admin-header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--admin-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo:hover {
    color: var(--admin-primary-hover);
    text-decoration: none;
}

.sidebar-logo i {
    font-size: 20px;
}

.admin-sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.admin-sidebar-menu .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--admin-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.admin-sidebar-menu .nav-link:hover {
    color: var(--admin-primary);
    background-color: var(--admin-bg);
}

.admin-sidebar-menu .nav-link.active {
    color: var(--admin-primary);
    background-color: rgba(0, 82, 217, 0.06);
    border-left-color: var(--admin-primary);
}

.admin-sidebar-menu .nav-link i {
    width: 20px;
    margin-right: 12px;
    font-size: 16px;
    text-align: center;
}

/* Submenu */
.admin-sidebar-menu .collapse .nav-link {
    padding-left: 56px;
    font-size: 13px;
}

.admin-sidebar-menu .nav-link[data-bs-toggle="collapse"] {
    position: relative;
}

.admin-sidebar-menu .nav-link[data-bs-toggle="collapse"]::after {
    content: "\f107";
    font-family: "FontAwesome";
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.admin-sidebar-menu .nav-link[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Main Content */
.admin-main {
    margin-left: var(--admin-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.admin-header {
    height: var(--admin-header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-header-left h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User Info */
.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.admin-user:hover {
    background-color: var(--admin-bg);
}

.admin-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--admin-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.admin-user-name {
    font-size: 14px;
    color: var(--admin-text);
    font-weight: 500;
}

/* Content Wrapper */
.admin-content {
    flex: 1;
    padding: 24px;
}

/* Breadcrumb */
.admin-breadcrumb {
    margin-bottom: 24px;
}

.admin-breadcrumb .breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.admin-breadcrumb .breadcrumb-item a {
    color: var(--admin-text-muted);
    text-decoration: none;
}

.admin-breadcrumb .breadcrumb-item a:hover {
    color: var(--admin-primary);
}

.admin-breadcrumb .breadcrumb-item.active {
    color: var(--admin-text-secondary);
}

/* Cards */
.admin-card {
    background-color: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    margin-bottom: 24px;
}

.admin-card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-header h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0;
}

.admin-card-body {
    padding: 24px;
}

/* Buttons */
.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-admin i {
    font-size: 12px;
}

.btn-admin-primary {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
    color: #ffffff;
}

.btn-admin-primary:hover {
    background-color: var(--admin-primary-hover);
    border-color: var(--admin-primary-hover);
    color: #ffffff;
}

.btn-admin-secondary {
    background-color: #ffffff;
    border-color: var(--admin-border);
    color: var(--admin-text-secondary);
}

.btn-admin-secondary:hover {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.btn-admin-success {
    background-color: var(--admin-success);
    border-color: var(--admin-success);
    color: #ffffff;
}

.btn-admin-danger {
    background-color: var(--admin-danger);
    border-color: var(--admin-danger);
    color: #ffffff;
}

.btn-admin-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-admin-lg {
    padding: 10px 20px;
    font-size: 14px;
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
    font-weight: 600;
    color: var(--admin-text);
    background-color: var(--admin-bg);
}

.admin-table td {
    color: var(--admin-text-secondary);
}

.admin-table tbody tr:hover {
    background-color: var(--admin-bg);
}

/* Forms */
.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--admin-text);
    margin-bottom: 8px;
}

.admin-form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 13px;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background-color: #ffffff;
    transition: border-color 0.2s;
}

.admin-form-control:focus {
    outline: none;
    border-color: var(--admin-primary);
}

.admin-form-control::placeholder {
    color: var(--admin-text-muted);
}

/* Status Badges */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.admin-badge-success {
    background-color: rgba(0, 180, 42, 0.1);
    color: var(--admin-success);
}

.admin-badge-warning {
    background-color: rgba(255, 125, 0, 0.1);
    color: var(--admin-warning);
}

.admin-badge-danger {
    background-color: rgba(245, 63, 63, 0.1);
    color: var(--admin-danger);
}

.admin-badge-info {
    background-color: rgba(22, 93, 255, 0.1);
    color: var(--admin-info);
}

/* Dropdown */
.admin-dropdown-menu {
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 4px 0;
    min-width: 160px;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--admin-text-secondary);
    text-decoration: none;
    transition: background-color 0.2s;
}

.admin-dropdown-item:hover {
    background-color: var(--admin-bg);
    color: var(--admin-primary);
}

.admin-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background-color: var(--admin-border);
}

/* Stats Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.admin-stat-card,.admin-card {
    background-color: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    padding: 24px;
}

.admin-stat-title {
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-bottom: 8px;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--admin-text);
    margin-bottom: 8px;
}

.admin-stat-change {
    font-size: 12px;
}

.admin-stat-change.up {
    color: var(--admin-success);
}

.admin-stat-change.down {
    color: var(--admin-danger);
}

/* Page Header */
.admin-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-page-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--admin-text);
    margin: 0;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    color: var(--admin-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sidebar-toggle:hover {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

/* Responsive */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.admin-text-primary { color: var(--admin-primary); }
.admin-text-success { color: var(--admin-success); }
.admin-text-warning { color: var(--admin-warning); }
.admin-text-danger { color: var(--admin-danger); }
.admin-text-muted { color: var(--admin-text-muted); }

.admin-mb-0 { margin-bottom: 0; }
.admin-mb-1 { margin-bottom: 8px; }
.admin-mb-2 { margin-bottom: 16px; }
.admin-mb-3 { margin-bottom: 24px; }

.admin-d-flex { display: flex; }
.admin-align-center { align-items: center; }
.admin-justify-between { justify-content: space-between; }
.admin-gap-1 { gap: 8px; }
.admin-gap-2 { gap: 16px; }

/* Collapsible Sidebar Styles */
/* Sidebar collapsed state */
.admin-sidebar.collapsed {
    width: var(--admin-sidebar-collapsed);
}

.admin-sidebar.collapsed .admin-sidebar-header h3 span {
    display: none;
}

.admin-sidebar.collapsed .admin-sidebar-menu .nav-link span {
    display: none;
}

.admin-sidebar.collapsed .admin-sidebar-menu .nav-link {
    justify-content: center;
    padding: 12px;
}

.admin-sidebar.collapsed .admin-sidebar-menu .nav-link i {
    margin-right: 0;
    font-size: 18px;
}

.admin-sidebar.collapsed .admin-sidebar-menu .collapse,
.admin-sidebar.collapsed .admin-sidebar-menu .collapse.show {
    display: none !important;
}

/* Main content adjusts when sidebar is collapsed */
.admin-sidebar.collapsed + .admin-main {
    margin-left: var(--admin-sidebar-collapsed);
}

/* Tooltip style for collapsed sidebar */
.admin-sidebar.collapsed .admin-sidebar-menu .nav-link {
    position: relative;
}

.admin-sidebar.collapsed .admin-sidebar-menu .nav-link:hover::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--admin-text);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 8px;
    z-index: 1100;
}

.admin-sidebar.collapsed .admin-sidebar-menu .nav-link:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--admin-text);
    margin-left: -4px;
    z-index: 1100;
}

/* Smooth transition for sidebar */
.admin-sidebar,
.admin-main {
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link span,
.sidebar-logo span {
    transition: opacity 0.2s ease;
}

/* Collapsed header - center the icon */
.admin-sidebar.collapsed .admin-sidebar-header {
    justify-content: center;
    padding: 0;
}

.admin-sidebar.collapsed .sidebar-logo {
    justify-content: center;
}

.admin-sidebar.collapsed .sidebar-logo span {
    display: none;
}

/* Collapse toggle button in header */
.btn-sidebar-collapse {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    color: var(--admin-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sidebar-collapse:hover {
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.btn-sidebar-collapse i {
    transition: transform 0.3s ease;
}

.btn-sidebar-collapse.collapsed i {
    transform: rotate(180deg);
}
