/* Global Styles */
* {
    box-sizing: border-box;
}

:root {
    --primary: #1d4ed8;
    --primary-light: #2563eb;
    --dark-header: #0f172a;
    --bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #166534;
    --success-bg: #dcfce7;
    --danger: #991b1b;
    --danger-bg: #fee2e2;
}

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    padding-top: 5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevent horizontal overflow */
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5rem;
    background: var(--dark-header);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar h1 svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary-light);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    color: white;
}

.nav-links a.logout {
    color: #f87171;
}

.nav-links a.logout:hover {
    color: #ef4444;
}

/* Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: calc(100vw - 4rem);
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    min-width: 300px;
    animation: slideInRight 0.4s ease-out forwards;
    cursor: pointer;
}

.toast.error { border-left-color: #ef4444; color: #991b1b; background: #fef2f2; }
.toast.success { border-left-color: #22c55e; color: #166534; background: #f0fdf4; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

/* Footer */
.main-footer {
    margin-top: auto;
    padding: 4rem 1.5rem;
    background: white;
    border-top: 1px solid var(--border);
    text-align: center;
    width: 100%;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--dark-header);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.footer-logo svg {
    width: 24px;
    height: 24px;
    color: var(--primary-light);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #f1f5f9;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-bottom b {
    color: var(--text-main);
}

@media (max-width: 640px) {
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

/* SVG Defaults */
svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Login Page Specific */
.login-body {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    align-items: center;
    justify-content: center;
    padding-top: 0;
    min-height: 100vh;
}

.login-card {
    width: 90%;
    max-width: 420px;
    background: white;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.5s ease-out;
}

.login-header {
    background-color: var(--dark-header);
    padding: 3rem 2rem;
    text-align: center;
    color: white;
}

.icon-box {
    background: var(--primary-light);
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.02em;
}

.login-header p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0.75rem 0 0;
    font-size: 0.95rem;
}

.form-body {
    padding: 2.5rem;
}

.error-box {
    background: #fef2f2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid #fee2e2;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.label-with-icon svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: 1.5px solid var(--border);
    border-radius: 0.85rem;
    box-sizing: border-box;
    font-size: 1rem;
    transition: all 0.2s;
    color: var(--text-main);
}

input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-light);
    color: white;
    border: none;
    border-radius: 0.85rem;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.2s;
    margin-top: 1rem;
}

.submit-btn svg {
    width: 20px;
    height: 20px;
}

.submit-btn:hover {
    background-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.login-footer {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.login-footer b {
    color: var(--text-main);
}

.site-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.6rem 1.2rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 2rem;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.site-link:hover {
    background: white;
    border-color: var(--primary-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Index Page Specific */
.welcome-section {
    margin-bottom: 3rem;
    animation: fadeInDown 0.5s ease-out;
}

.welcome-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
}

.welcome-section p {
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out;
}

.file-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    background: #eff6ff;
    color: var(--primary-light);
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 24px;
    height: 24px;
}

.file-details {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    word-break: break-all;
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.download-btn {
    background: #f1f5f9;
    color: var(--primary);
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.download-btn:hover {
    background: var(--primary-light);
    color: white;
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: white;
    border-radius: 2rem;
    border: 2px dashed var(--border);
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.account-section {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
}

.account-card {
    background: white;
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    max-width: 500px;
}

.account-card h3 {
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.account-card h3 svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.btn-save {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

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

/* Admin Page Specific */
.admin-container {
    max-width: 1000px;
}

.admin-card {
    padding: 2.5rem;
}

.admin-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-card h2 svg {
    width: 24px;
    height: 24px;
    color: var(--primary-light);
}

.admin-card p {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.user-section {
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
}

.user-section:last-child {
    border-bottom: none;
}

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

.user-header svg {
    width: 20px;
    height: 20px;
    color: var(--primary-light);
}

.user-header strong {
    font-size: 1.1rem;
    color: var(--text-main);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.file-permission-item .file-checkbox {
    background: transparent;
    border: none;
    padding: 0;
    flex: 1;
}

.file-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.file-checkbox:hover {
    border-color: var(--primary-light);
    background: #eff6ff;
}

.file-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.save-btn {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.save-btn:hover {
    background: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.file-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.file-table th, .file-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.file-table th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    background: #f1f5f9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.btn-icon:hover {
    background: var(--primary-light);
    color: white;
}

.btn-icon.delete:hover {
    background: #ef4444;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    animation: modalFadeIn 0.3s ease-out;
}

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

.modal h3 {
    margin-top: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-form input {
    width: 100%;
}

.modal-form .checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-form .checkbox-group input {
    width: 18px;
    height: 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-cancel {
    background: #f1f5f9;
    color: var(--text-muted);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-confirm {
    background: var(--primary-light);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.upload-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px dashed var(--border);
    flex-wrap: wrap; /* Allow wrapping on mobile */
}

.upload-form input[type="file"] {
    flex: 1;
    min-width: 200px;
}

.user-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.user-form input {
    flex: 1;
    min-width: 150px;
}

.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 700;
    background: #e2e8f0;
    color: var(--text-muted);
}

.badge.admin {
    background: #dbeafe;
    color: var(--primary);
}

.user-email-badge {
    background: #f1f5f9;
    color: #64748b;
    font-weight: normal;
}

.user-email-text {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 10px;
}

.modal-user-display {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.modal-user-display strong {
    color: var(--text-main);
}

.log-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.log-actions {
    display: flex;
    gap: 0.5rem;
}

.clear-log-btn {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 0.5rem 1rem;
    width: auto;
    height: auto;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.test-email-btn {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 0.5rem 1rem;
    width: auto;
    height: auto;
    font-size: 0.85rem;
    gap: 0.5rem;
}

.settings-field {
    flex: 1;
}

.settings-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.settings-field input {
    width: 100%;
    padding: 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 0.5rem;
    box-sizing: border-box;
}

/* Log Viewer Styles */
.log-viewer {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.log-entry {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
}

.progress-container {
    display: none;
    width: 100%;
    background-color: #f1f5f9;
    border-radius: 9999px;
    height: 10px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    display: none;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.5rem;
    text-align: center;
}

.file-permission-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    gap: 0.75rem;
    transition: all 0.2s;
}

.file-permission-item:hover {
    border-color: var(--primary-light);
    background: white;
}

.file-permission-item .file-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%;
}

.file-name-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    word-break: break-all;
    line-height: 1.4;
}

.expiry-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.expiry-input-group label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.expiry-input-group input[type="datetime-local"] {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
    border: 1.5px solid var(--border);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    background-color: white;
    color: var(--text-main);
}

.expiry-input-group input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.perm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Tabs System */
.tabs-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    transition: all 0.2s;
    font-size: 1rem;
    white-space: nowrap;
}

.tab-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.02);
}

.tab-btn.active {
    color: var(--primary-light);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
    border-radius: 4px 4px 0 0;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInTab 0.3s ease-out;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    .nav-links {
        gap: 1rem;
    }
    .nav-links span {
        display: none; /* Hide text in nav links on mobile */
    }
    .grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 0 0.75rem;
    }
    .admin-card {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }
    .file-grid {
        grid-template-columns: 1fr;
    }
    .file-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .user-form, .upload-form {
        flex-direction: column;
    }
    .upload-form button, .user-form button {
        width: 100%;
    }
    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    .expiry-input-group {
        width: 100%;
        justify-content: space-between;
        flex-direction: row; /* Keep label and input on same line if possible, or stack if preferred */
        align-items: center;
    }
    .perm-footer {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }
    .perm-footer button {
        width: 100%;
    }
    .tabs-nav {
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1.5rem;
    }
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .log-actions {
        flex-direction: column;
        width: 100%;
    }
    .log-actions form, .log-actions .btn-icon {
        width: 100%;
    }
    .log-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

