/* ==========================================================================
   JIPPA Admin Panel Stylesheet
   ========================================================================== */

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

:root {
    --navy: #0F2345;
    --navy-dark: #03102f;
    --blue: #3A5D87;
    --steel: #597BA3;
    --gold: #C09C33;
    --gold-light: #D4B455;
    --white: #FFFFFF;
    --gray: #D1D5D6;
    --gray-light: #F4F5F6;
    --gray-medium: #9CA3AF;
    --gray-dark: #4B5563;
    --green: #059669;
    --green-light: #D1FAE5;
    --red: #DC2626;
    --red-light: #FEE2E2;
    --yellow: #D97706;
    --yellow-light: #FEF3C7;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --transition: 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(15, 35, 69, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 35, 69, 0.1);
    --shadow-lg: 0 8px 30px rgba(15, 35, 69, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

html { font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--navy);
    background: var(--gray-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
}

a { text-decoration: none; color: var(--blue); }
a:hover { color: var(--navy); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    padding: 24px;
}

.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--navy-dark);
    opacity: 0.3;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-card__logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card__logo img {
    height: 64px;
    width: auto;
    margin: 0 auto 12px;
}

.password-field {
    position: relative;
}

.password-field .form-input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.password-toggle:hover {
    color: var(--navy);
}

.login-card__title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 8px;
}

.login-card__subtitle {
    text-align: center;
    color: var(--gray-medium);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.login-error {
    background: var(--red-light);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--red);
    text-align: center;
}

.login-hint {
    margin-top: 24px;
    padding: 16px;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--gray-dark);
    text-align: center;
}

.login-hint strong {
    color: var(--navy);
}

/* --------------------------------------------------------------------------
   Admin Layout
   -------------------------------------------------------------------------- */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--navy);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar__logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar__logo img {
    height: 40px;
}

.sidebar__logo-text {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}

.sidebar__logo-text span {
    display: block;
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar__nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.sidebar__nav-label {
    padding: 12px 24px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--steel);
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.sidebar__link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.sidebar__link--active {
    color: var(--white);
    background: rgba(192, 156, 51, 0.1);
    border-left-color: var(--gold);
}

.sidebar__link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar__link-badge {
    margin-left: auto;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.sidebar__footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar__user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar__user-info {
    flex: 1;
    min-width: 0;
}

.sidebar__user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    font-size: 0.75rem;
    color: var(--steel);
    text-transform: capitalize;
}

/* Main content */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main__header {
    background: var(--white);
    border-bottom: 1px solid var(--gray);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main__title {
    font-size: 1.5rem;
    font-weight: 600;
}

.main__title-sub {
    font-size: 0.85rem;
    color: var(--gray-medium);
    font-weight: 400;
    margin-top: 2px;
}

.main__content {
    padding: 32px;
    flex: 1;
}

.sidebar__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--navy);
    padding: 8px;
}

.sidebar__toggle svg {
    width: 24px;
    height: 24px;
}

.sidebar__overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.sidebar__overlay--visible {
    display: block;
}

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-card__icon--navy { background: var(--navy); }
.stat-card__icon--gold { background: var(--gold); }
.stat-card__icon--blue { background: var(--blue); }
.stat-card__icon--gray { background: var(--gray-dark); }

.stat-card__icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.stat-card__icon--gold svg {
    color: var(--navy);
}

.stat-card__value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card__label {
    font-size: 0.85rem;
    color: var(--gray-medium);
}

.panel {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.panel__header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel__title {
    font-size: 1.05rem;
    font-weight: 600;
}

.panel__body {
    padding: 24px;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-medium);
    border-bottom: 2px solid var(--gray);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-light);
    color: var(--gray-dark);
    vertical-align: middle;
}

.table tr:hover td {
    background: var(--gray-light);
}

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

.table__name {
    font-weight: 600;
    color: var(--navy);
}

.table__email {
    font-size: 0.85rem;
    color: var(--gray-medium);
}

.table__actions {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-medium);
}

.table-empty svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: var(--gray);
}

/* --------------------------------------------------------------------------
   Status Badges
   -------------------------------------------------------------------------- */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-badge--new {
    background: var(--yellow-light);
    color: var(--yellow);
}
.status-badge--new .status-badge__dot { background: var(--yellow); }

.status-badge--in_progress {
    background: rgba(58, 93, 135, 0.12);
    color: var(--blue);
}
.status-badge--in_progress .status-badge__dot { background: var(--blue); }

.status-badge--closed {
    background: var(--green-light);
    color: var(--green);
}
.status-badge--closed .status-badge__dot { background: var(--green); }

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge--admin {
    background: var(--navy);
    color: var(--white);
}

.role-badge--staff {
    background: var(--gray-light);
    color: var(--gray-dark);
    border: 1px solid var(--gray);
}

.active-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.active-badge--active { color: var(--green); }
.active-badge--inactive { color: var(--red); }

.active-badge__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.active-badge--active .active-badge__dot { background: var(--green); }
.active-badge--inactive .active-badge__dot { background: var(--red); }

/* --------------------------------------------------------------------------
   Filters & Search
   -------------------------------------------------------------------------- */

.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--gray-medium);
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
}

.search-box input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(58, 93, 135, 0.12);
}

.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.filter-tab {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-dark);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
}

.filter-tab:hover {
    color: var(--navy);
}

.filter-tab--active {
    background: var(--navy);
    color: var(--white);
}

.filter-tab__count {
    margin-left: 6px;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Forms (Admin)
   -------------------------------------------------------------------------- */

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 8px;
}

.form-label span { color: var(--gold); }

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--navy);
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(58, 93, 135, 0.12);
}

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

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233A5D87' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-medium);
    margin-top: 6px;
}

/* --------------------------------------------------------------------------
   Buttons (Admin)
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn--primary:hover {
    background: var(--blue);
    border-color: var(--blue);
}

.btn--gold {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

.btn--gold:hover {
    background: var(--gold-light);
    border-color: var(--gold-light);
}

.btn--danger {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
}

.btn--danger:hover {
    background: var(--red);
    color: var(--white);
}

.btn--ghost {
    background: transparent;
    color: var(--gray-dark);
    border-color: var(--gray);
}

.btn--ghost:hover {
    background: var(--gray-light);
    color: var(--navy);
}

.btn--sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--icon {
    padding: 8px;
    width: 36px;
    height: 36px;
}

.btn--icon svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------------------
   Alert Messages
   -------------------------------------------------------------------------- */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.alert--success {
    background: var(--green-light);
    color: var(--green);
}

.alert--error {
    background: var(--red-light);
    color: var(--red);
}

.alert--warning {
    background: var(--yellow-light);
    color: var(--yellow);
}

.alert--info {
    background: rgba(58, 93, 135, 0.1);
    color: var(--blue);
}

/* --------------------------------------------------------------------------
   Inquiry Detail
   -------------------------------------------------------------------------- */

.inquiry-detail {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

.inquiry-info {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    padding: 28px;
}

.inquiry-info__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray);
}

.inquiry-info__name {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.inquiry-info__meta {
    font-size: 0.85rem;
    color: var(--gray-medium);
}

.inquiry-field {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.inquiry-field:last-child {
    border-bottom: none;
}

.inquiry-field__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inquiry-field__value {
    font-size: 0.95rem;
    color: var(--navy);
}

.inquiry-message {
    margin-top: 20px;
    padding: 20px;
    background: var(--gray-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
}

.inquiry-message__label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-medium);
    margin-bottom: 8px;
}

.inquiry-message__text {
    font-size: 0.95rem;
    color: var(--navy);
    line-height: 1.7;
    white-space: pre-wrap;
}

.inquiry-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.inquiry-sidebar__panel {
    background: var(--white);
    border: 1px solid var(--gray);
    border-radius: var(--radius-md);
    padding: 24px;
}

.inquiry-sidebar__title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-medium);
    margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 35, 69, 0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay--visible {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal__header {
    padding: 24px;
    border-bottom: 1px solid var(--gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: 1.2rem;
}

.modal__close {
    background: none;
    border: none;
    color: var(--gray-medium);
    padding: 4px;
    transition: color var(--transition);
}

.modal__close:hover {
    color: var(--navy);
}

.modal__close svg {
    width: 24px;
    height: 24px;
}

.modal__body {
    padding: 24px;
}

.modal__footer {
    padding: 20px 24px;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   Responsive (Admin)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .inquiry-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar--open {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
    }

    .sidebar__toggle {
        display: flex;
    }

    .main__header {
        padding: 16px 20px;
    }

    .main__content {
        padding: 20px;
    }

    .stat-cards {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 32px 24px;
    }
}
