<style>
    .view-card .card-body {
        padding: 1.25rem 1.5rem;
    }

    .view-card hr {
        margin: 1rem 0;
    }

    .view-table td {
    padding: 0.35rem 0.25rem;
    vertical-align: middle;
}

.view-table .info-label {
    width: 38%;
    color: #6c757d;
    font-weight: 600;
}

</style>
<div class="content">
    <div class="card position-relative shadow-sm rounded-4 view-card">

        <!-- Back button -->
        <div class="fab-top-group" style="position:absolute; top:8px; right:25px;">
            <a href="<?= base_url('authority/index/'.$this->session->userdata('company_id')) ?>"
                class="btn btn-outline-secondary btn-sm d-flex align-items-center justify-content-center"
                style="border-radius: 50%; width: 36px; height: 36px; padding: 0;">
                <i class="fa fa-arrow-left"></i>
            </a>
        </div>

        <div class="card-body">
            <!-- Header -->
            <div class="d-flex justify-content-between align-items-center mb-3 pb-2 border-bottom">
                <h5 class="mb-0">
                    <i class="fas fa-eye text-primary"></i> View Authority
                </h5>
            </div>

            <!-- Basic Info -->
            <div class="row">
                <div class="col-md-6">
                    <div class="card info-card">
                        <div class="card-body">
                            <h6 class="card-title text-primary">
                                <i class="fas fa-info-circle"></i> Authority Information
                            </h6>

                            <table class="table table-sm table-borderless mb-0 view-table">
                                <tr>
                                    <td class="info-label" width="40%">Authority Name:</td>
                                    <td><?= htmlspecialchars($authority->authority_name) ?></td>
                                </tr>
                                <tr>
                                    <td class="info-label">Alias:</td>
                                    <td><?= htmlspecialchars($authority->alias_name) ?: '-' ?></td>
                                </tr>
                                <tr>
                                    <td class="info-label">Status:</td>
                                    <td>
                                        <?= ($authority->status == '1')
                                            ? '<span class="badge bg-success">Active</span>'
                                            : '<span class="badge bg-secondary">Inactive</span>' ?>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="info-label">Created On:</td>
                                    <td><?= date('d-M-Y', strtotime($authority->created_date)) ?></td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>

            <hr class="my-4">

            <!-- Footer -->
            <div class="text-center">
                <a href="<?= base_url('authority/index/'.$this->session->userdata('company_id')) ?>"
                   class="btn btn-secondary">
                    <i class="fas fa-arrow-left"></i> Back to List
                </a>
            </div>

        </div>
    </div>
</div>
