/* ============================================================
   BloodBridge — Hospital Pages Styles (Pages 2-4)
   ============================================================ */

/* ── Two-Panel Layout (Sidebar + Form) ── */
.hospital-page {
    display: flex;
    min-height: 100vh;
    background: var(--grey-50);
}

.hospital-main {
    flex: 1;
    padding: var(--space-8);
    overflow-y: auto;
}

/* ── Page Header with Dropdown Button ── */
.hosp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.hosp-header-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

/* ── Registered Dropdown Button ── */
.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: var(--teal-primary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
}

.dropdown-trigger:hover {
    background: var(--teal-dark);
    transform: translateY(-1px);
}

.dropdown-trigger .arrow-icon {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-base) var(--ease-out);
    display: inline-flex;
}

.dropdown-trigger.open .arrow-icon {
    transform: rotate(180deg);
}

/* ── Dropdown Panel ── */
.dropdown-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 300ms var(--ease-out);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-6);
}

.dropdown-panel.open {
    max-height: 600px;
    border: 1px solid var(--grey-100);
}

.dropdown-panel .dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    border-bottom: 1px solid var(--grey-100);
    text-decoration: none;
    color: var(--grey-900);
}

.dropdown-panel .dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-panel .dropdown-item:hover {
    background: var(--grey-50);
    padding-left: calc(var(--space-5) + 6px);
}

.dropdown-panel .dropdown-item:active {
    background: rgba(26,122,138,0.1);
}

/* ── Registration Form Card ── */
.reg-form-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-10);
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}

.reg-form-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.reg-form-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: rgba(26,122,138,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
}

.reg-form-icon svg {
    width: 32px;
    height: 32px;
    color: var(--teal-primary);
}

.reg-form-header h2 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-2);
}

.reg-form-header p {
    font-size: var(--text-sm);
    color: var(--grey-600);
}

.reg-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
}

.reg-form .form-group {
    margin-bottom: var(--space-5);
}

.reg-form .form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--grey-900);
    margin-bottom: var(--space-2);
}

.reg-form input,
.reg-form select {
    height: 44px;
}

.btn-verify {
    width: 100%;
    padding: var(--space-4);
    background: var(--red-primary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-6);
    transition: all var(--duration-base) var(--ease-out);
}

.btn-verify:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-verify:active {
    transform: scale(0.97);
}

.btn-verify .spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    display: none;
}

.btn-verify.loading .spinner {
    display: block;
    animation: spin 600ms linear infinite;
}

.btn-verify.loading .btn-label {
    display: none;
}

.btn-verify.success {
    background: var(--green);
}

.btn-verify.success .btn-label {
    display: none;
}

.btn-verify.success .check-icon {
    display: block;
}

.btn-verify .check-icon {
    display: none;
    width: 24px;
    height: 24px;
}

/* ── Hospital / Blood Bank List ── */
.entity-list {
    max-width: 860px;
}

.entity-list-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.entity-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
    text-decoration: none;
    color: var(--grey-900);
    border: 1px solid transparent;
}

.entity-row:hover {
    transform: translateX(6px);
    background: var(--grey-50);
    box-shadow: var(--shadow-md);
    border-color: var(--grey-100);
}

.entity-row:active {
    background: rgba(26,122,138,0.08);
}

.entity-row-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: rgba(26,122,138,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.entity-row-icon svg {
    width: 22px;
    height: 22px;
    color: var(--teal-primary);
}

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

.entity-row-name {
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    margin-bottom: 2px;
}

.entity-row-address {
    font-size: var(--text-xs);
    color: var(--grey-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entity-row-badges {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.entity-row .arrow-hover {
    width: 20px;
    height: 20px;
    color: var(--grey-300);
    opacity: 0;
    transition: opacity var(--duration-fast);
    flex-shrink: 0;
}

.entity-row:hover .arrow-hover {
    opacity: 1;
    color: var(--teal-primary);
}

/* ── Hospital Dashboard ── */
.hosp-dashboard {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-6);
    padding: var(--space-6) var(--space-8);
}

.hosp-dash-main {
    min-width: 0;
}

.hosp-dash-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* ── Dashboard Header (top bar) ── */
.dash-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-8);
    background: var(--white);
    border-bottom: 1px solid var(--grey-100);
}

.dash-topbar-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
}

.dash-topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.dash-user-chip {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--grey-100);
    background: var(--white);
    cursor: pointer;
}

.dash-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: rgba(26,122,138,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-user-avatar svg {
    width: 20px;
    height: 20px;
    color: var(--teal-primary);
}

.dash-user-name {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
}

.dash-user-type {
    font-size: var(--text-xs);
    color: var(--grey-600);
}

/* ── Profile Banner ── */
.profile-banner {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius-xl);
    padding: var(--space-6) var(--space-8);
    color: var(--white);
    display: flex;
    align-items: center;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.profile-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-banner-icon svg {
    width: 28px;
    height: 28px;
    color: var(--white);
}

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

.profile-banner-name {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-1);
}

.profile-banner-id {
    display: inline-flex;
    padding: 2px 10px;
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-family: monospace;
    margin-bottom: var(--space-3);
}

.profile-banner-details {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    flex-wrap: wrap;
    font-size: var(--text-xs);
    color: rgba(255,255,255,0.7);
}

.profile-banner-details .detail-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.profile-banner-details svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

/* ── Blood Demand Request Card ── */
.demand-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

.demand-card-title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--red-primary);
    margin-bottom: var(--space-1);
}

.demand-card-subtitle {
    font-size: var(--text-sm);
    color: var(--grey-600);
    margin-bottom: var(--space-6);
}

.demand-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    transition: all var(--duration-base) var(--ease-out);
    overflow: hidden;
}

.demand-row select,
.demand-row input {
    height: 44px;
    flex: 1;
}

.demand-row select {
    max-width: 200px;
}

.demand-row .btn-delete-row {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--red-badge);
    flex-shrink: 0;
    transition: all var(--duration-fast);
}

.demand-row .btn-delete-row:hover {
    background: rgba(231,76,60,0.08);
}

.demand-row .btn-delete-row svg {
    width: 18px;
    height: 18px;
}

.demand-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-4);
}

.btn-add-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--teal-primary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: all var(--duration-fast);
}

.btn-add-row:hover {
    background: rgba(26,122,138,0.08);
}

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

.btn-request-blood {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    background: var(--red-primary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    transition: all var(--duration-base) var(--ease-out);
}

.btn-request-blood:hover {
    background: var(--red-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-request-blood:active {
    transform: scale(0.97);
}

.btn-request-blood svg {
    width: 16px;
    height: 16px;
}

.btn-request-blood .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    display: none;
}

.btn-request-blood.loading .spinner { display: block; animation: spin 600ms linear infinite; }
.btn-request-blood.loading .btn-label { display: none; }

/* ── Quick Stats Grid ── */
.quick-stats {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.quick-stats-title {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.quick-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.stat-card {
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    border: 1px solid var(--grey-100);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    transition: all var(--duration-fast);
    cursor: default;
    min-width: 0;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.stat-card > div:last-child {
    min-width: 0;
    overflow: hidden;
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 16px;
    height: 16px;
}

.stat-card-icon.red { background: rgba(192,57,43,0.1); color: var(--red-primary); }
.stat-card-icon.green { background: rgba(39,174,96,0.1); color: var(--green); }
.stat-card-icon.blue { background: rgba(26,122,138,0.1); color: var(--teal-primary); }
.stat-card-icon.amber { background: rgba(243,156,18,0.1); color: var(--amber); }

.stat-card-value {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card-label {
    font-size: 10px;
    color: var(--grey-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Recent Requests ── */
.recent-requests {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
}

.recent-requests-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.recent-requests-header h4 {
    font-family: var(--font-display);
    font-size: var(--text-md);
    font-weight: var(--font-bold);
}

.recent-requests-header a {
    font-size: var(--text-xs);
    color: var(--teal-primary);
    font-weight: var(--font-semibold);
}

.recent-req-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--grey-100);
    font-size: var(--text-sm);
}

.recent-req-item:last-child {
    border-bottom: none;
}

.recent-req-bg {
    font-weight: var(--font-bold);
    color: var(--red-primary);
    min-width: 28px;
}

.recent-req-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--grey-300);
}

.recent-req-units {
    font-weight: var(--font-semibold);
    white-space: nowrap;
}

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

.recent-req-bank {
    font-size: var(--text-xs);
    color: var(--grey-600);
}

.recent-req-date {
    font-size: var(--text-xs);
    color: var(--grey-600);
    white-space: nowrap;
}

.recent-req-status {
    flex-shrink: 0;
}

/* ── Status left border ── */
.recent-req-item[data-status="completed"] { border-left: 3px solid var(--green); padding-left: var(--space-3); }
.recent-req-item[data-status="pending"] { border-left: 3px solid var(--amber); padding-left: var(--space-3); }
.recent-req-item[data-status="approved"] { border-left: 3px solid var(--teal-primary); padding-left: var(--space-3); }

/* ── History Card ── */
.history-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--white);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-3);
    transition: all 200ms ease;
    position: relative;
    overflow: hidden;
}

.history-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.history-card-left {
    width: 4px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.history-card-bg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-bold);
    font-size: var(--text-md);
    flex-shrink: 0;
    background: rgba(192,57,43,0.08);
    color: var(--red-primary);
}

.history-card-body {
    flex: 1;
    min-width: 0;
}

.history-card-top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 4px;
}

.history-card-code {
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    color: var(--grey-900);
}

.history-card-meta {
    font-size: var(--text-xs);
    color: var(--grey-600);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.history-card-status {
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .hosp-dashboard { grid-template-columns: 1fr; }
}
