<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<div class="admin-main">
	<nav class="navbar admin-topbar">
		<div class="container-fluid py-2">
			<div class="d-flex align-items-center gap-2">
				<button class="btn btn-outline-secondary d-lg-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#adminSidebar" aria-controls="adminSidebar">
					<i class="bi bi-list"></i>
				</button>
				<div>
					<div class="page-title"><?php echo isset($title) ? e($title) : 'Loundri'; ?></div>
					<div class="page-subtitle">Manajemen Laundry</div>
				</div>
			</div>

			<div class="d-flex align-items-center gap-2">
				<a class="btn btn-outline-dark btn-sm" href="<?php echo site_url('beranda'); ?>" target="_blank" rel="noopener">
					<i class="bi bi-box-arrow-up-right"></i> Lihat Website
				</a>
				<div class="dropdown">
					<button class="btn btn-brand btn-sm dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
						<i class="bi bi-person-circle"></i> <?php echo isset($current_user['name']) ? e($current_user['name']) : 'Admin'; ?>
					</button>
					<ul class="dropdown-menu dropdown-menu-end">
						<li><a class="dropdown-item" href="<?php echo site_url('logout'); ?>"><i class="bi bi-box-arrow-right"></i> Logout</a></li>
					</ul>
				</div>
			</div>
		</div>
	</nav>

	<main class="container-fluid py-4">
		<?php if ($this->session->flashdata('success')): ?>
			<div class="alert alert-success"><?php echo e($this->session->flashdata('success')); ?></div>
		<?php endif; ?>
		<?php if ($this->session->flashdata('error')): ?>
			<div class="alert alert-danger"><?php echo $this->session->flashdata('error'); ?></div>
		<?php endif; ?>
