:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --primary-hover: #4834d4;
    --secondary: #a29bfe;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-light: #dfe6e9;
    --bg-body: #f4f7f6;
    --white: #ffffff;
    --danger: #ff7675;
    --success: #00b894;
    --warning: #fdcb6e;
    --font-title: 'Fredoka', 'Segoe UI', sans-serif;
    --font-main: 'Quicksand', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    background: var(--bg-body);
    display: flex;
    min-height: 100vh;
    color: var(--text-dark);
}


.sidebar {
    width: 260px;
    background: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    overflow-y: auto;
    z-index: 100;
    transition: width 0.3s, transform 0.3s;
}

.sidebar-logo {
    padding: 30px;
    text-align: center;
}

.sidebar-logo img {
    width: 80px;
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(108, 92, 231, 0.2));
}

.sidebar-logo h2 {
    margin: 0;
    color: var(--primary);
    font-family: var(--font-title);
    font-size: 1.8rem;
}

.sidebar-greeting {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
    font-weight: 600;
}

.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu li a {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.menu li a:hover, .menu li a.active {
    background: #f0f3f8;
    color: var(--primary);
    border-left-color: var(--primary);
}

.menu li a .icon {
    margin-right: 15px;
    font-size: 1.2rem;
    width: 25px;
    text-align: center;
}


.main-content {
    margin-left: 260px;
    padding: 40px;
    width: calc(100% - 260px);
    box-sizing: border-box;
    padding-bottom: 180px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-title);
    color: var(--text-dark);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 30px;
}


.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert.badge-blue { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert.alert-pink { background: #fce4ec; color: #c2185b; border: 1px solid #f8bbd0; }

.btn, .button, button[type="submit"] {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(108, 92, 231, 0.2);
}

.btn:hover, .button:hover, button[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(108, 92, 231, 0.3);
}

.btn-confirm {
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}


input[type="text"], input[type="number"], input[type="password"], input[type="date"], select, textarea, .input {
    width: 100%;
    padding: 12px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    box-sizing: border-box;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color 0.3s;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
}


.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.product-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #f0f0f0;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: var(--secondary);
}

.product-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.product-price {
    display: inline-block;
    background: #eef2ff;
    padding: 6px 14px;
    border-radius: 15px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.product-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.product-input {
    width: 80px;
    text-align: center;
    font-weight: bold;
    color: var(--primary);
}

.category-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    margin-top: 50px;
    margin-bottom: 25px;
    color: var(--primary);
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}


.cart-summary {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 90%;
    min-width: 300px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 10px;
    z-index: 999;
    pointer-events: none;
    justify-content: center;
    flex-wrap: wrap;
}

.cart-chip {
    background: white;
    color: var(--text-dark);
    padding: 8px 15px;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--primary);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
}

.cart-chip span.qty {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


.total-section {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(108, 92, 231, 0.4);
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 1000;
    width: auto;
    min-width: 300px;
    justify-content: space-between;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.total-info {
    display: flex;
    flex-direction: column;
}

.total-label {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-title);
}

.total-btn {
    background: white;
    color: var(--primary);
    font-weight: 800;
    padding: 12px 30px;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.total-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}


.drop-zone {
    border: 2px dashed var(--primary);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    color: var(--primary);
    margin: 20px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    background: rgba(108, 92, 231, 0.1);
    border-color: var(--primary-hover);
}

.drop-zone-text {
    font-size: 1.1rem;
    font-weight: 700;
}

.drop-zone-subtext {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 5px;
}

.drop-zone-preview {
    max-width: 100%;
    max-height: 250px;
    margin-top: 15px;
    border-radius: 10px;
    display: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.drop-zone.has-file .drop-zone-text,
.drop-zone.has-file .drop-zone-subtext {
    display: none;
}

.drop-zone.has-file .drop-zone-preview {
    display: block;
}


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

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    font-family: var(--font-title);
}


.table-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    overflow-x: auto;
    margin-bottom: 30px;
    padding: 10px;
}

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

th, td {
    padding: 18px 25px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background: #fafbfc;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background: #fcfcfc;
}

.btn-action {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.2s;
}

.btn-action:hover {
    background: #eee;
}

.btn-delete { color: var(--danger); }
.btn-edit { color: var(--primary); }
.btn-warning { color: var(--warning); }


.form-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-dark);
}

.form-group.full-width {
    width: 100%;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.filters label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}


.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5); 
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    line-height: 1;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* --- LOGIN PAGE --- */
.login-body {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    flex-direction: column;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.5);
    animation: fadeIn 0.5s ease-out;
}

.login-logo {
    width: 100px;
    margin: 0 auto 20px auto;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(108, 92, 231, 0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.login-container h1 {
    color: var(--primary);
    margin-bottom: 30px;
    font-size: 2rem;
}

.login-container .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

.login-container input {
    background: #f0f3f8;
    border: 2px solid transparent;
    padding: 15px;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

.login-container input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.login-container button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
    background: var(--primary);
    border-radius: 12px;
}

.login-container button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(108, 92, 231, 0.3);
}

.login-container .footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.8;
}

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


.badge-red { background: #ffe6e6; color: #d63031; padding: 4px 10px; border-radius: 10px; font-weight: 700; font-size: 0.8rem; }
.badge-gray { background: #eee; color: #636e72; padding: 4px 10px; border-radius: 10px; font-weight: 600; font-size: 0.8rem; }
.badge-blue { background: #e0f7fa; color: #0097a7; padding: 4px 10px; border-radius: 10px; font-weight: 700; font-size: 0.8rem; }
.badge-green { background: #e6fffa; color: #00b894; padding: 4px 10px; border-radius: 10px; font-weight: 700; font-size: 0.8rem; }

.warning-wrapper { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.warning-trigger { cursor: pointer; font-size: 1.2rem; }
.warning-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #eee;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 15px;
    border-radius: 10px;
    width: 250px;
    z-index: 10;
    margin-bottom: 10px;
}
.warning-popup.active { display: block; }
.warning-close { position: absolute; top: 5px; right: 10px; cursor: pointer; color: #aaa; }
.warning-header { font-weight: bold; color: var(--danger); margin-bottom: 5px; }


.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.green { color: #00b894; font-weight: bold; }
.red { color: #d63031; font-weight: bold; }

.btn-done {
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    background: #ffe6e6;
    color: #d63031;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.btn-done.done {
    background: #e6fffa;
    color: #00b894;
}

.no-decoration { text-decoration: none; }


.partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.partner-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    position: relative;
    border-left: 5px solid var(--primary);
    transition: transform 0.2s;
}

.partner-card:hover {
    transform: translateY(-3px);
}

.partner-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-family: var(--font-title);
}

.partner-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.partner-contact {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-partner {
    position: absolute;
    top: 15px;
    right: 15px;
    text-decoration: none;
    font-size: 1.1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.delete-partner:hover {
    opacity: 1;
}


.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-item b {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-item span {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.active-filter {
    background: var(--primary);
    color: white;
}

.text-small-gray {
    font-size: 0.9rem;
    color: var(--text-light);
}


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

.table-clean th {
    text-align: left;
    padding: 15px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-bottom: 2px solid #eee;
}

.table-clean td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.table-clean tr:last-child td {
    border-bottom: none;
}


@media (max-width: 768px) {
    .sidebar { width: 0; transform: translateX(-100%); }
    .sidebar.open { width: 260px; transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; padding: 20px; padding-bottom: 180px; }
    .menu-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .cart-summary { bottom: 90px; width: 100%; border-radius: 0; }
    .total-section { width: 90%; padding: 15px; gap: 15px; }
    .form-container { padding: 20px; width: 100%; }
}


/* === LOGIN PAGE STYLES === */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-body) 0%, #dfe6e9 100%);
    position: relative;
    overflow: hidden;
}

.login-body::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, var(--secondary) 10%, transparent 10%),
                radial-gradient(circle, var(--primary) 10%, transparent 10%);
    background-size: 50px 50px;
    background-position: 0 0, 25px 25px;
    opacity: 0.05;
    animation: floatingBackground 60s linear infinite;
    z-index: 0;
}

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

.login-container {
    background: white;
    padding: 50px 40px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(108, 92, 231, 0.15);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 70px rgba(108, 92, 231, 0.2);
}

.login-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(108, 92, 231, 0.2));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-container h1 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 800;
}

.login-container p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.login-container .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-left: 5px;
}

.login-container input {
    width: 100%;
    padding: 15px;
    border: 2px solid #edf2f7;
    border-radius: 15px;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.login-container input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.login-container button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    margin-top: 10px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 10px 20px rgba(108, 92, 231, 0.3);
}

.login-container button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(108, 92, 231, 0.4);
}

.login-container .footer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-light);
    opacity: 0.7;
}

.login-container .alert {
    font-size: 0.9rem;
    padding: 10px 15px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: left;
}
