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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #000;
    color: #fff;
    overflow-x: hidden;
}

.page {
    min-height: 100vh;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Heart Monitor Background */
.heart-monitor {
    position: absolute;
    inset: 0;
    opacity: 0.2;
    pointer-events: none;
}

#ecg-svg {
    width: 100%;
    height: 100%;
}

.ecg-line {
    animation: ecg-scroll 10s linear infinite;
}

@keyframes ecg-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-2000px); }
}

/* Monitor HUD */
.monitor-hud {
    position: absolute;
    color: rgba(20, 184, 166, 0.4);
    font-size: 0.75rem;
    font-family: monospace;
    z-index: 1;
}

.monitor-hud.top-left {
    top: 1rem;
    left: 1rem;
}

.monitor-hud.top-right {
    top: 1rem;
    right: 1rem;
    text-align: right;
}

.monitor-hud.top-center {
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pulse-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: rgba(20, 184, 166, 1);
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

/* Animated Background Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.blob-teal {
    top: 5rem;
    left: 2.5rem;
    width: 16rem;
    height: 16rem;
    background: rgba(20, 184, 166, 0.1);
    animation: blob-teal 8s ease-in-out infinite;
}

.blob-red {
    bottom: 5rem;
    right: 2.5rem;
    width: 24rem;
    height: 24rem;
    background: rgba(239, 68, 68, 0.1);
    animation: blob-red 10s ease-in-out infinite;
}

@keyframes blob-teal {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.2); opacity: 0.4; }
}

@keyframes blob-red {
    0%, 100% { transform: scale(1.2); opacity: 0.4; }
    50% { transform: scale(1); opacity: 0.2; }
}

/* Main Content */
.content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
}

/* Logo Section */
.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
}

.rotating-logo {
    width: 12rem;
    height: 12rem;
    perspective: 1000px;
}

.rotating-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.5));
    animation: rotate-logo 20s linear infinite;
}

@keyframes rotate-logo {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

.main-title {
    margin-top: 2rem;
    font-size: 3.75rem;
    font-weight: bold;
    color: #fff;
    text-align: center;
}

.subtitle {
    margin-top: 1rem;
    font-size: 1.25rem;
    color: #d1d5db;
    text-align: center;
}

/* Prescription Form */
.prescription-form {
    position: relative;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.prescription-pad {
    background: #18181b;
    border: 1px solid #27272a;
    border-top: 4px solid #14b8a6;
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #27272a;
}

.prescription-title {
    font-family: Georgia, serif;
    font-size: 1.25rem;
    color: #fff;
}

.prescription-subtitle {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.prescription-date {
    text-align: right;
    font-size: 0.75rem;
    color: #9ca3af;
}

.prescription-date p {
    margin: 0.125rem 0;
}

.rx-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rx-symbol {
    font-family: Georgia, serif;
    font-size: 2.25rem;
    color: #5eead4;
}

.rx-text {
    font-size: 0.875rem;
    color: #d1d5db;
    font-style: italic;
}

/* Form */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: monospace;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid #3f3f46;
    color: #fff;
    font-family: monospace;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input::placeholder {
    color: #6b7280;
}

.form-group input:focus {
    border-color: #14b8a6;
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: linear-gradient(to right, #14b8a6, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(to right, #0d9488, #0891b2);
    transform: scale(1.02);
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    text-align: center;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
    animation: fade-in 0.3s;
}

.prescription-signature {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #27272a;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.instagram-icon {
    width: 2rem;
    height: 2rem;
    color: #14b8a6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.instagram-icon:hover {
    color: #5eead4;
    transform: scale(1.1);
}

.prescription-signature > div {
    text-align: right;
}

.signature-name {
    font-family: Georgia, serif;
    font-size: 1.125rem;
    color: #d1d5db;
    font-style: italic;
}

.signature-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.prescription-holes {
    position: absolute;
    left: 1rem;
    top: 2rem;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hole {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #27272a;
}

/* Success Overlay */
.success-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(24, 24, 27, 0.95);
    border-radius: 0.5rem;
    border: 1px solid #27272a;
}

.success-overlay.show {
    display: flex;
    animation: scale-in 0.3s;
}

.success-content {
    text-align: center;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.success-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #5eead4;
}

.success-subtitle {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Animations */
.fade-in {
    animation: fade-in 1s;
}

.fade-in-delay-1 {
    animation: fade-in 0.8s 0.3s both;
}

.fade-in-delay-2 {
    animation: fade-in 0.8s 0.4s both;
}

.fade-in-delay-3 {
    animation: fade-in 0.8s 0.5s both;
}

.fade-in-delay-4 {
    animation: fade-in 1s 1s both;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Admin Pages */
.admin-container {
    min-height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.back-btn {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #fff;
}

.admin-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-top: 4px solid #0891b2;
    border-radius: 0.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.admin-header {
    text-align: center;
    padding-bottom: 1rem;
}

.lock-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.admin-header h2 {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
}

.admin-header p {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-top: 0.5rem;
}

#admin-login-form {
    margin-top: 1.5rem;
}

#admin-password {
    width: 100%;
    padding: 0.75rem;
    background: #27272a;
    border: 1px solid #3f3f46;
    border-radius: 0.375rem;
    color: #fff;
    text-align: center;
    font-size: 1.125rem;
    outline: none;
}

#admin-password::placeholder {
    color: #6b7280;
}

.admin-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 1rem;
    background: linear-gradient(to right, #14b8a6, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: linear-gradient(to right, #0d9488, #0891b2);
}

.admin-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #27272a;
    text-align: center;
}

.admin-footer p {
    font-size: 0.75rem;
    color: #6b7280;
}

.shake {
    animation: shake 0.4s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #000;
    padding: 1.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-header h1 {
    font-size: 2.25rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 0.5rem;
}

.dashboard-header p {
    color: #9ca3af;
}

.refresh-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #14b8a6, #06b6d4);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.refresh-btn:hover {
    background: linear-gradient(to right, #0d9488, #0891b2);
}

.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#refresh-icon.spinning {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.stat-icon {
    font-size: 1.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
}

.stat-value-small {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

.table-card {
    background: #18181b;
    border: 1px solid #27272a;
    border-radius: 0.5rem;
    padding: 1.5rem;
}

.table-card h3 {
    color: #fff;
    margin-bottom: 1rem;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 2px solid rgba(20, 184, 166, 0.2);
    border-top-color: #14b8a6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-state p, .empty-state p {
    margin-top: 0.5rem;
    color: #9ca3af;
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.2;
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    border-bottom: 1px solid #27272a;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.875rem;
}

tbody tr {
    border-bottom: 1px solid #27272a;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: rgba(20, 184, 166, 0.05);
}

td {
    padding: 0.75rem 1rem;
}

td:nth-child(1) {
    color: #9ca3af;
}

td:nth-child(2) {
    font-weight: 500;
    color: #fff;
}

td:nth-child(3) {
    color: #d1d5db;
}

td:nth-child(4) {
    color: #9ca3af;
    font-size: 0.875rem;
}

.export-section {
    margin-top: 1.5rem;
    text-align: center;
}

.export-btn {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid #0891b2;
    color: #5eead4;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s;
}

.export-btn:hover {
    background: rgba(20, 184, 166, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .rotating-logo {
        width: 10rem;
        height: 10rem;
    }
    
    .prescription-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .prescription-date {
        text-align: left;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}