/* ============================================
   Feedback System - Design System
   Premium, modern, glassmorphism-based UI
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- CSS Variables ---- */
:root {
    --theme-accent: #d4af37;
    --theme-accent-light: #b8860b;
    --theme-card-bg: rgba(255, 255, 255, 0.7);

    --bg-primary: #f8f9fa;
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.85);
    --bg-input: rgba(255, 255, 255, 0.8);
    --bg-input-focus: rgba(255, 255, 255, 1);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --border-color: rgba(0, 0, 0, 0.1);
    --border-focus: var(--theme-accent);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(var(--theme-accent), 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Background Overlay ---- */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Animated floating particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--theme-accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-10vh) rotate(720deg);
        opacity: 0;
    }
}

/* ---- Layout ---- */
.container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm {
    max-width: 620px;
}

.container-md {
    max-width: 900px;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.25rem;
}

.text-gradient {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* ---- Glass Card ---- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition-normal);
}

.glass-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.glass-card-accent {
    border-color: rgba(var(--theme-accent), 0.2);
    box-shadow: var(--shadow-md), 0 0 60px rgba(var(--theme-accent), 0.05);
}

/* ---- Form Styles ---- */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition-normal);
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: #f43f5e;
    font-size: 0.8rem;
    margin-top: 6px;
    display: none;
}

.form-input.error,
.form-textarea.error {
    border-color: #f43f5e;
}

.form-input.error+.form-error,
.form-textarea.error+.form-error {
    display: block;
}

/* ---- Star Rating ---- */
.star-rating {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.star-rating input {
    display: none;
}

.star-rating label {
    cursor: pointer;
    font-size: 2rem;
    color: var(--text-muted);
    transition: var(--transition-fast);
    line-height: 1;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: var(--theme-accent);
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transition: width 0.6s ease, height 0.6s ease;
    transform: translate(-50%, -50%);
}

.btn:active::after {
    width: 400px;
    height: 400px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
    color: #fff;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--theme-accent);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1.5px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
}

/* ---- Header ---- */
.page-header {
    text-align: center;
    padding: 48px 0 32px;
    animation: fadeInDown 0.6s ease;
}

.page-header .logo {
    font-size: 1rem;
    font-weight: 600;
    color: var(--theme-accent);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.page-header h1 {
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ---- Form Container ---- */
.form-container {
    animation: fadeInUp 0.6s ease 0.2s both;
}

.form-footer {
    text-align: center;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ---- Success Message ---- */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
}

.success-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.success-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px;
    text-align: center;
    max-width: 420px;
    transform: scale(0.8);
    transition: var(--transition-normal);
}

.success-overlay.show .success-card {
    transform: scale(1);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 2.5rem;
    animation: successPulse 2s ease infinite;
}

@keyframes successPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.3);
    }

    50% {
        box-shadow: 0 0 0 16px rgba(139, 92, 246, 0);
    }
}

/* ============================================
   ADMIN DASHBOARD STYLES
   ============================================ */

/* ---- Admin Login ---- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.6s ease;
}

.login-card .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.8rem;
}

/* ---- Admin Nav ---- */
.admin-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-nav .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.admin-nav .nav-brand .brand-dot {
    width: 10px;
    height: 10px;
    background: var(--theme-accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--theme-accent);
}

.admin-nav .nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---- Stats Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.filter-bar label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-bar input[type="date"],
.filter-bar select {
    padding: 8px 12px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.filter-bar input[type="date"]:focus,
.filter-bar select:focus {
    border-color: var(--theme-accent);
}

/* Override date input calendar icon color for dark theme */
.filter-bar input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}

/* ---- Data Table ---- */
.table-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-header h3 {
    color: var(--text-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 14px 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: top;
}

.data-table tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table .feedback-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table .rating-cell {
    color: var(--theme-accent);
    font-weight: 600;
}

.data-table .date-cell {
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.data-table .actions-cell {
    display: flex;
    gap: 6px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* ---- Detail Modal ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-normal);
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 560px;
    width: 100%;
    transform: scale(0.9) translateY(20px);
    transition: var(--transition-normal);
}

.modal-overlay.show .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.modal-body .detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.modal-body .detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.modal-body .detail-value {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

.landing-hero {
    text-align: center;
    padding: 80px 0 48px;
    animation: fadeInDown 0.8s ease;
}

.landing-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.1;
}

.landing-hero p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}

.form-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.4s ease both;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    transition: var(--transition-normal);
}

.form-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg);
}

.form-card:hover::before {
    height: 4px;
}

.form-card .card-number {
    font-size: 2.5rem;
    font-weight: 800;
    opacity: 0.12;
    position: absolute;
    top: 12px;
    right: 20px;
    line-height: 1;
}

.form-card .card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.form-card .card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-card .card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.form-card .card-link {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition-fast);
    text-decoration: none;
}

.form-card .card-link-form {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.form-card .card-link-form:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.form-card .card-link-admin {
    color: #fff;
}

/* ---- Toast Notification ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(20, 20, 35, 0.95);
    color: #ffffff;
    /* FORCE WHITE SO IT'S READABLE ON DARK BG */
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 200;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition-normal);
    min-width: 300px;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 3px solid #10b981;
}

.toast-error {
    border-left: 3px solid #f43f5e;
}

.toast-info {
    border-left: 3px solid #3b82f6;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.pagination button:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--theme-accent);
    color: #fff;
    border-color: var(--theme-accent);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--theme-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   COMPREHENSIVE RESPONSIVE DESIGN
   Mobile-first, all resolutions
   ============================================ */

/* Touch-friendly base: minimum 44px tap targets on all interactive elements */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 40px;
        padding: 10px 16px;
    }

    .form-input,
    .form-textarea,
    select {
        min-height: 48px;
        font-size: 16px !important;
        /* prevent iOS zoom */
    }

    .star-rating label {
        font-size: 2.4rem;
        padding: 4px;
    }

    .pagination button {
        min-width: 40px;
        min-height: 40px;
    }

    .modal-close {
        width: 44px;
        height: 44px;
    }

    .card-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ---- 1200px: Large tablets / small desktops ---- */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .forms-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .data-table .feedback-cell {
        max-width: 200px;
    }
}

/* ---- 1024px: Tablets landscape ---- */
@media (max-width: 1024px) {
    .landing-hero h1 {
        font-size: 2.8rem;
    }

    .landing-hero p {
        font-size: 1.05rem;
    }

    .admin-nav {
        padding: 12px 16px;
        gap: 12px;
    }

    .admin-nav .nav-brand {
        font-size: 1rem;
    }
}

/* ---- 768px: Tablets portrait ---- */
@media (max-width: 768px) {

    /* Typography */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Layout */
    .container {
        padding: 12px;
    }

    .container-sm {
        max-width: 100%;
        padding: 12px;
    }

    /* Landing */
    .landing-hero {
        padding: 32px 0 20px;
    }

    .landing-hero h1 {
        font-size: 2rem;
    }

    .landing-hero p {
        font-size: 0.95rem;
        margin-bottom: 20px;
    }

    .forms-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 12px;
    }

    /* Cards */
    .glass-card {
        padding: 20px;
        border-radius: var(--radius-md);
    }

    .form-card {
        padding: 18px;
    }

    .form-card .card-number {
        font-size: 2rem;
    }

    .form-card .card-title {
        font-size: 1rem;
    }

    /* Page header */
    .page-header {
        padding: 24px 0 16px;
    }

    .page-header .logo {
        font-size: 0.85rem;
        letter-spacing: 0.1em;
        margin-bottom: 10px;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    /* Form inputs */
    .form-group {
        margin-bottom: 18px;
    }

    .form-input,
    .form-textarea {
        padding: 12px 14px;
    }

    .form-textarea {
        min-height: 100px;
    }

    .form-label {
        font-size: 0.8rem;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 16px 0;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-value {
        font-size: 1.6rem;
    }

    .stat-card .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        margin-bottom: 10px;
    }

    /* Admin nav */
    .admin-nav {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
        gap: 8px;
    }

    .admin-nav .nav-brand {
        justify-content: center;
        font-size: 0.95rem;
    }

    .admin-nav .nav-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .admin-nav .nav-actions .form-selector {
        width: 100%;
    }

    .admin-nav .nav-actions .form-selector select {
        width: 100%;
        min-width: unset;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 14px;
    }

    .filter-bar input[type="date"] {
        width: 100%;
    }

    .filter-bar .btn {
        width: 100%;
        justify-content: center;
    }

    /* Table */
    .table-container {
        border-radius: var(--radius-md);
    }

    .table-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 650px;
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .data-table .feedback-cell {
        max-width: 150px;
    }

    /* Modals */
    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-card {
        padding: 24px;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
        overflow-y: auto;
    }

    /* Success overlay */
    .success-card {
        padding: 32px 24px;
        margin: 12px;
    }

    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 2rem;
    }

    /* Toast */
    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        min-width: unset;
        width: auto;
        font-size: 0.85rem;
        padding: 12px 16px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
        padding: 14px 8px;
        flex-wrap: wrap;
    }

    .pagination button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Login */
    .login-container {
        padding: 16px;
    }

    .login-card {
        max-width: 100%;
    }

    .login-card .logo-icon {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }

    /* Buttons */
    .btn {
        padding: 12px 20px;
        font-size: 0.88rem;
    }

    .btn-sm {
        padding: 8px 14px;
        font-size: 0.78rem;
    }

    .btn-block {
        padding: 14px;
    }

    /* Back link */
    .back-link {
        font-size: 0.85rem;
        padding: 12px 0;
    }

    /* Theme badge */
    .theme-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* ---- 480px: Large phones ---- */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .landing-hero {
        padding: 24px 0 16px;
    }

    .landing-hero h1 {
        font-size: 1.7rem;
    }

    .landing-hero p {
        font-size: 0.88rem;
        padding: 0 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .forms-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .form-card .card-actions {
        flex-direction: column;
    }

    .form-card .card-link {
        padding: 10px;
    }

    .glass-card {
        padding: 16px;
    }

    .page-header {
        padding: 20px 0 12px;
    }

    .page-header .logo {
        font-size: 0.75rem;
    }

    .form-footer {
        font-size: 0.75rem;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .empty-state .empty-icon {
        font-size: 2.5rem;
    }

    /* Star rating bigger on mobile for easy tap */
    .star-rating {
        gap: 4px;
    }

    .star-rating label {
        font-size: 2.2rem;
    }

    /* Modal full screen on small phones */
    .modal-overlay {
        padding: 0;
    }

    .modal-card {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px;
    }

    .modal-header {
        margin-bottom: 16px;
    }

    .modal-body .detail-value {
        font-size: 0.88rem;
    }
}

/* ---- 360px: Small phones ---- */
@media (max-width: 360px) {
    h1 {
        font-size: 1.3rem;
    }

    .landing-hero h1 {
        font-size: 1.4rem;
    }

    .container {
        padding: 8px;
    }

    .glass-card {
        padding: 14px;
    }

    .form-input,
    .form-textarea {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.82rem;
    }

    .stat-card .stat-value {
        font-size: 1.1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav .nav-brand span:not(.brand-dot) {
        font-size: 0.85rem;
    }
}

/* ---- Safe area support for notched phones ---- */
@supports (padding: env(safe-area-inset-bottom)) {
    .toast {
        bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .modal-overlay {
        padding-bottom: env(safe-area-inset-bottom);
    }

    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ---- Landscape phone fix ---- */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: 8px;
        min-height: auto;
    }

    .login-card .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .landing-hero {
        padding: 16px 0 12px;
    }

    .page-header {
        padding: 12px 0;
    }

    .success-card {
        padding: 20px;
    }

    .success-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .modal-card {
        max-height: 95vh;
    }
}

/* ---- Scrollbar Styling ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Admin Theme Badge ---- */
.theme-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--theme-card-bg);
    color: var(--theme-accent-light);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-badge .badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--theme-accent);
}

/* ---- Back Link ---- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 0;
    transition: var(--transition-fast);
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--theme-accent);
}

/* ---- Responsive table scroll wrapper ---- */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
