@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Design System Variables - Light Theme */
:root {
    --bg-primary: #ffffff; /* Pure white */
    --bg-secondary: #ffffff;
    --bg-surface: #ffffff; /* Pure white card base */
    --bg-surface-hover: #fafafa;
    --color-primary: #a89060; /* Bronze/gold accents */
    --color-primary-dark: #887248;
    --color-primary-light: #222222; /* High contrast headers */
    --color-text: #111111; /* Charcoal body text */
    --color-text-muted: #555555; /* Medium grey text */
    --color-checkin: #1c726c; /* Teal for check-in */
    --color-checkin-hover: #26918a;
    --color-checkout: #ad3d39; /* Crimson for check-out */
    --color-checkout-hover: #c94f4b;
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header & Navigation */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text);
}

.logo-section img {
    height: 48px;
    width: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
}

.logo-section h1 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #111111;
}

.logo-section span {
    color: var(--color-primary);
}

nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

nav a:hover, nav a.active {
    color: #111111;
    background-color: #f5f5f5;
}

nav a.active {
    background-color: #f0ebe0;
    color: var(--color-primary-dark);
}

/* Main Container */
main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Typography elements */
h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #111111;
    text-align: center;
}

/* Card layout */
.glass-card {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

/* PHONE KEYPAD CONTAINER */
.phone-signon-container {
    max-width: 460px;
    margin: 2rem auto;
    text-align: center;
}

.phone-display {
    background: #fcfcfc;
    border: 2px solid #d5d5d5;
    border-radius: var(--border-radius-md);
    padding: 1.2rem;
    margin-bottom: 2rem;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #111111;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.phone-display.placeholder {
    color: #999999;
    font-weight: 400;
    font-size: 1.8rem;
}

/* Keypad Grid */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 2rem;
}

.key-btn {
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    color: #111111;
    font-size: 1.8rem;
    font-weight: 500;
    padding: 1.2rem 0;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background-color: #f5f5f5;
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.key-btn:active {
    background-color: #e5e5e5;
}

.key-btn.action-key {
    background-color: #f5f5f5;
    color: #555555;
    font-size: 1.4rem;
}

.key-btn.action-key:hover {
    background-color: #e5e5e5;
    color: #111111;
}

/* Main action button */
.submit-btn {
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 6px 15px rgba(168, 144, 96, 0.3);
}

.submit-btn:disabled {
    background: #e5e5e5;
    color: #999999;
    cursor: not-allowed;
    box-shadow: none;
}

/* FAMILY SCREEN */
.family-container {
    max-width: 680px;
    margin: 0 auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

.family-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.family-title h3 {
    font-size: 1.6rem;
    color: #111111;
    margin-bottom: 4px;
}

.family-title p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.back-link {
    background-color: transparent;
    border: 1px solid #d5d5d5;
    color: #111111;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.back-link:hover {
    background-color: #f5f5f5;
}

/* Children List cards */
.child-check-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.child-check-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.child-info {
    flex: 1;
}

.child-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #111111;
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.in {
    background-color: #e6f4f2;
    color: #1c726c;
    border: 1px solid #c2e5e1;
}

.status-badge.out {
    background-color: #fbebeb;
    color: #ad3d39;
    border: 1px solid #f6c5c3;
}

.child-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.child-meta .allergy-warning {
    color: #b35900;
    font-weight: 600;
}

/* Toggle Check buttons */
.check-btn {
    border: none;
    padding: 0.8rem 1.6rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
    text-align: center;
}

.check-btn.check-in {
    background-color: var(--color-checkin);
    color: white;
}

.check-btn.check-in:hover {
    background-color: var(--color-checkin-hover);
    box-shadow: 0 4px 10px rgba(28, 114, 108, 0.2);
}

.check-btn.check-out {
    background-color: var(--color-checkout);
    color: white;
}

.check-btn.check-out:hover {
    background-color: var(--color-checkout-hover);
    box-shadow: 0 4px 10px rgba(173, 61, 57, 0.2);
}

.all-actions-container {
    display: flex;
    gap: 16px;
    margin-top: 2rem;
}

.all-actions-container button {
    flex: 1;
    padding: 1rem;
    font-weight: 600;
}

/* BADGE MODAL / TICKET PREVIEW */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    border-radius: var(--border-radius-lg);
    max-width: 480px;
    width: 90%;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.8rem;
}

.modal-header h4 {
    font-size: 1.3rem;
    color: #111111;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #999999;
    font-size: 1.5rem;
    cursor: pointer;
}

.close-modal-btn:hover {
    color: #111111;
}

/* Realistic Thermal Badge Styling */
.badge-preview {
    background-color: #ffffff;
    color: #000000;
    border-radius: 4px;
    padding: 1.5rem;
    font-family: 'Courier New', Courier, monospace;
    border: 2px dashed #000000;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.badge-logo {
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
    border-bottom: 2px double #000000;
    padding-bottom: 6px;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.badge-security-box {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 3px solid #000000;
    font-size: 1.6rem;
    font-weight: 900;
    padding: 4px 8px;
    background: #000;
    color: #fff;
    font-family: var(--font-sans);
}

.badge-child-name {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 800;
    margin: 15px 0 8px 0;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    padding-bottom: 4px;
}

.badge-detail-row {
    font-size: 0.9rem;
    margin: 6px 0;
    line-height: 1.4;
}

.badge-detail-row strong {
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.badge-allergies-box {
    margin-top: 15px;
    border: 2px solid #000000;
    padding: 8px;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

.badge-allergies-box.alert {
    background-color: #000000;
    color: #ffffff;
    font-family: var(--font-sans);
}

.badge-barcode {
    margin-top: 20px;
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        #000,
        #000 2px,
        #fff 2px,
        #fff 6px
    );
    opacity: 0.8;
}

.badge-footer {
    text-align: center;
    font-size: 0.75rem;
    margin-top: 10px;
    color: #555555;
    border-top: 1px dashed #aaaaaa;
    padding-top: 6px;
}

/* Notification banner toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--color-checkin);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1001;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.error {
    background-color: var(--color-checkout);
}

/* ADMIN DASHBOARD VIEW */
.admin-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin-top: 1rem;
}

.admin-sidebar {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius-md);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: fit-content;
    box-shadow: var(--shadow-sm);
}

.admin-sidebar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    text-align: left;
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.admin-sidebar-btn:hover {
    color: #111111;
    background-color: #f5f5f5;
}

.admin-sidebar-btn.active {
    color: var(--color-primary-dark);
    background-color: #f0ebe0;
    border-color: #d5d5d5;
}

/* Stats dashboard */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.stat-card h5 {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #111111;
}

.stat-card.active-in .stat-value {
    color: var(--color-checkin);
}

.stat-card.active-out .stat-value {
    color: var(--color-checkout);
}

/* Admin content sections */
.admin-section {
    display: none;
    animation: fadeIn 0.2s ease;
}

.admin-section.active {
    display: block;
}

.admin-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-input-wrapper input, .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    color: #111111;
    padding: 0.8rem 1rem;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input-wrapper input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 5px rgba(168, 144, 96, 0.2);
}

.btn {
    background-color: #ffffff;
    border: 1px solid #d5d5d5;
    color: #111111;
    padding: 0.8rem 1.4rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: #f5f5f5;
    border-color: #999999;
}

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

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

.btn.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn.btn-danger {
    background-color: #fbebeb;
    color: #ad3d39;
    border: 1px solid #f6c5c3;
}

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

/* Beautiful Admin Tables */
.table-responsive {
    overflow-x: auto;
    border: 1px solid #e5e5e5;
    border-radius: var(--border-radius-md);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: #f9f9f9;
    color: var(--color-primary-dark);
    font-weight: 600;
    padding: 1rem 1.2rem;
    border-bottom: 2px solid #e5e5e5;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e5e5e5;
    color: #444444;
}

tr:hover td {
    background-color: #fcfbf8;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

/* FORMS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 1.5rem;
}

@media(max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 1.5rem;
}

/* KEYBOARD TOGGLE / HELPERS */
.info-hint {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.info-hint a {
    color: var(--color-primary-dark);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Rules */
@media(max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .admin-sidebar-btn {
        white-space: nowrap;
    }
}

@media(max-width: 500px) {
    main {
        padding: 1.5rem 1rem;
    }
    
    .glass-card {
        padding: 1.5rem;
    }
    
    .phone-display {
        font-size: 1.8rem;
    }
    
    .key-btn {
        padding: 1rem 0;
        font-size: 1.5rem;
    }
    
    .all-actions-container {
        flex-direction: column;
    }
}
