/* Admin Dashboard Styles */
:root {
    --sidebar-width: 260px;
    --header-height: 70px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #3f3f46;
    background: #f4f4f5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #6b21a8 0%, #581c87 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 25px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    padding: 0 12px;
    margin-bottom: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
    margin-bottom: 5px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-weight: 500;
}

.nav-item-icon {
    font-size: 1.25rem;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
}

/* Header */
.admin-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e4e4e7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #18181b;
}

.header-title p {
    font-size: 0.875rem;
    color: #71717a;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Page Content */
.page-content {
    padding: 30px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #e4e4e7;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f4f4f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #18181b;
}

.card-body {
    padding: 25px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    border: 1px solid #e4e4e7;
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
}

.stat-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card-icon.purple {
    background: #f3e8ff;
    color: #7c3aed;
}

.stat-card-icon.blue {
    background: #dbeafe;
    color: #3b82f6;
}

.stat-card-icon.green {
    background: #d1fae5;
    color: #10b981;
}

.stat-card-icon.orange {
    background: #ffedd5;
    color: #f97316;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #18181b;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: #71717a;
    margin-top: 5px;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 20px;
    margin-top: 10px;
}

.stat-card .stat-change.up {
    background: #d1fae5;
    color: #059669;
}

.stat-card .stat-change.down {
    background: #fee2e2;
    color: #dc2626;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #f4f4f5;
}

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #71717a;
    background: #fafafa;
}

tr:hover td {
    background: #fafafa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Status Badge */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status.pending {
    background: #fef3c7;
    color: #92400e;
}

.status.pending .status-dot {
    background: #f59e0b;
}

.status.in_transit {
    background: #f3e8ff;
    color: #6b21a8;
}

.status.in_transit .status-dot {
    background: #7c3aed;
}

.status.delivered {
    background: #d1fae5;
    color: #065f46;
}

.status.delivered .status-dot {
    background: #10b981;
}

.status.failed {
    background: #fee2e2;
    color: #991b1b;
}

.status.failed .status-dot {
    background: #ef4444;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6b21a8 100%);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f4f4f5;
    color: #3f3f46;
}

.btn-secondary:hover {
    background: #e4e4e7;
}

.btn-outline {
    background: transparent;
    border: 1px solid #e4e4e7;
    color: #3f3f46;
}

.btn-outline:hover {
    background: #f4f4f5;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger:hover {
    background: #fecaca;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #3f3f46;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e4e4e7;
    border-radius: 10px;
    font-size: 0.9375rem;
    transition: all 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-control::placeholder {
    color: #a1a1aa;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row.three {
    grid-template-columns: repeat(3, 1fr);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6b21a8 0%, #581c87 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #7c3aed, #6b21a8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 15px;
}

.login-logo h1 {
    font-size: 1.75rem;
    color: #18181b;
}

.login-logo p {
    color: #71717a;
    font-size: 0.9375rem;
}

.login-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    color: #71717a;
    font-size: 0.875rem;
}

.login-footer a {
    color: #7c3aed;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 25px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.pagination a {
    background: #fff;
    border: 1px solid #e4e4e7;
    color: #3f3f46;
}

.pagination a:hover {
    background: #f4f4f5;
}

.pagination .active {
    background: #7c3aed;
    color: #fff;
    border: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: #18181b;
    margin-bottom: 10px;
}

.empty-state p {
    color: #71717a;
    margin-bottom: 25px;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-content {
        padding: 20px;
    }

    .admin-header {
        padding: 0 20px;
    }
}